[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
button:disabled { background-color: #c9c5bd; cursor: not-allowed; }

header nav ul { align-items: center; flex-wrap: wrap; justify-content: center; }
.cart-btn { padding: 0.35rem 1.1rem; }
.cart-btn b { background: var(--off-white); color: var(--primary); border-radius: 99px; padding: 0 0.5rem; margin-inline-start: 0.4rem; }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1rem; }
.filters button { padding: 0.35rem 1rem; }

.wine-card {
  cursor: pointer;
  grid-template:
    "image name name"
    "image region region"
    "image grapes grapes"
    "image stock stock"
    "image . ."
    "image price buy" /
    auto 1fr auto;
}
.wine-card .buy { grid-area: buy; align-self: center; margin-bottom: 2rem; }
.overview {
  grid-template:
    "image name name"
    "image description description"
    "image region region"
    "image grapes grapes"
    "image stock stock"
    "image price buy"
    "image . ." /
    auto 1fr auto;
}

.stock, .description, .back-link { position: relative; }
.stock { grid-area: stock; font-size: 0.85rem; font-weight: 600; color: oklch(45% 0.1 150); }
.stock.low { color: oklch(55% 0.15 60); }
.stock.out { color: var(--primary); }
.empty { text-align: center; opacity: 0.7; padding: 3rem 0; }

dialog { border: 0; border-radius: 1rem; padding: 0; width: min(560px, calc(100% - 24px)); max-height: 90vh; background: var(--off-white); color: var(--off-black); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dlg { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.9rem; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { margin: 0; font-size: 1.2rem; }
.row { display: grid; grid-template-columns: 1fr auto auto; gap: 0.6rem; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--off-white-darker); }
.row small { display: block; opacity: 0.7; }
.row input { width: 72px; }
.total { font-size: 1.15rem; font-weight: 700; }
dialog label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
dialog input, dialog textarea { font: inherit; padding: 0.55rem 0.6rem; border: 1px solid var(--off-white-darker); border-radius: 0.5rem; background: #fff; }
.error { color: var(--primary); min-height: 1.2em; margin: 0; }
.success { text-align: center; padding: 2rem 0.6rem; }
.success h2 { color: var(--primary); }
.success p { margin: 0.4rem 0; font-size: 1.05rem; }
.order-no { font-size: 1.6rem; font-weight: 800; letter-spacing: 1px; }

body.has-cart main { padding-bottom: 7rem; }
.checkout-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 6; background: var(--off-white); border-top: 1px solid var(--off-white-darker);
  box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08); padding: 0.75rem 1rem; }
.checkout-bar button { display: block; width: 100%; max-width: 520px; margin: 0 auto; padding: 0.9rem; font-size: 1.1rem; font-weight: 700; }

.balloons { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.balloon { position: absolute; bottom: -170px; width: 54px; height: 66px; border-radius: 50% 50% 48% 48%;
  animation: rise var(--dur) linear var(--delay) forwards, sway 2.4s ease-in-out var(--delay) infinite alternate; }
.balloon::before { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-bottom: 0; border-top-color: inherit; }
.balloon::after { content: ''; position: absolute; left: 50%; top: 100%; width: 12px; height: 90px; margin-left: -6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 90'%3E%3Cpath d='M6 0 C1 12 11 22 6 34 S1 56 6 68 S11 84 6 90' fill='none' stroke='%239a948a' stroke-width='1.3'/%3E%3C/svg%3E") center / 100% 100% no-repeat; transform-origin: top center; animation: string-wave 1.1s ease-in-out infinite alternate; }
@keyframes rise { from { translate: 0 0; } to { translate: 0 calc(-100vh - 280px); } }
@keyframes sway { from { transform: translateX(calc(var(--sway) * -1)) rotate(-4deg); } to { transform: translateX(var(--sway)) rotate(4deg); } }
@keyframes string-wave { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
.merge { border: 1px solid currentColor; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.merge p { margin: 0; }
.merge div { display: flex; gap: 8px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .balloons { display: none; } }
