/* ═════════════════════════════════════════════════════════════
   COMPONENTS — dijelovi koji se ponavljaju ili otvaraju
     1. Kartica likera (grid, zapremnine, količina)
     2. Dijalozi (osnova)
     3. Brzi pregled likera
     4. Popis za upit (ladica)
     5. Obrazac za slanje upita
     6. Pravne stranice i cjenik
     7. Provjera dobi
     8. Kolačići, toast, plutajući gumb
   ═════════════════════════════════════════════════════════════ */

/* ── 1. Kartica likera ───────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 64px 36px;
}
@media (max-width: 1020px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .product-grid { grid-template-columns: 1fr; gap: 56px; } }

.product { display: flex; flex-direction: column; }

.product__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .35s var(--ease), border-color .35s;
}
.product__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--ease); }
.product__media:hover { box-shadow: var(--shadow-lift); border-color: var(--rule-strong); }
.product__media:hover img { transform: scale(1.03); }

.product__badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 3px 11px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--paper-light);
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
}

.product__body { padding-top: 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.product__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.product__name { font-family: var(--f-display); font-size: var(--fs-lg); line-height: 1.1; }

/* Odabir zapremnine — radio gumbi kao „čipovi" */
.sizes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; border: 0; }
.sizes label { position: relative; }
.sizes input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.sizes span {
  display: grid;
  place-items: center;
  height: 40px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-family: var(--f-ui);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.sizes label:hover span { border-color: var(--ink); }
.sizes input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper-light); }
.sizes input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.price { display: grid; gap: 2px; font-family: var(--f-ui); }
.price__line { display: flex; align-items: baseline; gap: 10px; }
.price__amount { font-size: 1.45rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.price__size { font-size: var(--fs-xs); color: var(--ink-soft); }
.anchor { display: block; font-family: var(--f-ui); font-size: 13px; color: var(--ink-soft); }

.buy-row { display: flex; gap: 10px; }
.buy-row .btn { flex: 1; }

.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  height: 46px;
  flex: none;
}
.stepper button { width: 38px; font-size: 1.2rem; color: var(--ink); }
.stepper button:hover { background: rgba(30,45,107,.06); }
.stepper input {
  width: 42px;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: var(--f-ui);
  font-weight: 500;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper--light { border-color: rgba(217,188,114,.45); }
.stepper--light button, .stepper--light input { color: var(--paper-light); }
.stepper--light button:hover { background: rgba(217,188,114,.12); }
.stepper--sm { height: 34px; }
.stepper--sm button { width: 30px; font-size: 1rem; }
.stepper--sm input { width: 32px; font-size: 15px; }

.product__more { align-self: flex-start; }

/* Pločica „Zagreb in my ❤️" na kraju grida (popunjava zadnji red) */
.promo {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--ink-deep);
  color: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
}
.promo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.promo:hover img { transform: scale(1.03); }
.promo__text { padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.promo__new { font-family: var(--f-ui); font-size: var(--fs-xs); color: var(--gold-light); }
.promo__title { font-family: var(--f-display); font-size: var(--fs-xl); color: var(--paper-light); }
.promo__text p:not(.promo__new):not(.promo__price) { color: rgba(240,226,197,.75); }
.promo__price { font-family: var(--f-ui); font-size: 1.45rem; font-weight: 500; color: var(--paper-light); margin-top: 6px; }
.promo__anchor { color: rgba(240,226,197,.6); margin-top: -8px; }
.promo .btn { align-self: flex-start; margin-top: 8px; }
@media (max-width: 620px) {
  .promo { grid-column: auto; grid-template-columns: 1fr; }
  .promo img { order: -1; aspect-ratio: 1; }
}

/* ── 2. Dijalozi — osnova ────────────────────────────────────── */
dialog {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
}
dialog::backdrop { background: rgba(20, 28, 71, .62); backdrop-filter: blur(3px); }

.dialog {
  margin: auto;
  width: min(580px, calc(100vw - 24px));
  max-height: calc(100svh - 32px);
  border-radius: var(--radius);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.6);
  overflow-y: auto;
}
.dialog[open] { animation: dialog-in .35s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px); } }
.dialog--wide { width: min(1000px, calc(100vw - 24px)); }
.dialog--doc  { width: min(780px, calc(100vw - 24px)); }

.dialog__close {
  position: sticky;           /* ostaje vidljiv dok se skrola sadržaj */
  top: 10px;
  display: block;
  margin: 10px 10px -54px auto;
  z-index: 2;
  background: var(--paper);
  width: 44px; height: 44px;
  font-size: 30px;
  line-height: 1;
  color: var(--ink-soft);
  border-radius: 50%;
}
.dialog__close:hover { color: var(--ink); background: rgba(30,45,107,.07); }
.dialog__title { font-family: var(--f-display); font-size: var(--fs-xl); margin-bottom: 6px; }
.dialog__sub   { color: var(--ink-soft); margin-bottom: 24px; }

/* ── 3. Brzi pregled likera ──────────────────────────────────── */
.quickview { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.quickview__art { background: var(--paper); }
.quickview__art img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.quickview__body {
  padding: 48px 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid var(--rule);
}
.quickview__badge {
  align-self: flex-start;
  font-family: var(--f-ui); font-size: 13px;
  border: 1px solid var(--rule-strong); border-radius: 99px; padding: 2px 12px;
}
.quickview__name { font-family: var(--f-display); font-size: var(--fs-xl); }
.quickview__desc { color: var(--ink-soft); }
.quickview__buy { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--rule); display: grid; gap: 14px; }

@media (max-width: 760px) {
  .quickview { grid-template-columns: 1fr; }
  .quickview__body { padding: 24px 20px 28px; border-left: 0; border-top: 1px solid var(--rule); }
}

/* ── 4. Popis za upit (ladica s desne strane) ────────────────── */
.drawer {
  margin: 0 0 0 auto;
  width: min(440px, 100vw);
  height: 100svh;
  max-height: 100svh;
  max-width: 100vw;
  box-shadow: -30px 0 80px -30px rgba(0,0,0,.5);
}
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .4s var(--ease); }
@keyframes drawer-in { from { transform: translateX(100%); } }

.drawer__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 16px 18px 24px;
  border-bottom: 1px solid var(--rule);
}
.drawer__head h2 { font-family: var(--f-display); font-size: var(--fs-lg); }
.drawer__head .dialog__close { position: static; margin: 0; }
.drawer__items { flex: 1; overflow-y: auto; padding: 8px 24px; }
.drawer__foot { padding: 18px 24px 24px; border-top: 1px solid var(--rule); background: var(--paper-light); }

.cart-empty { padding: 56px 0; text-align: center; color: var(--ink-soft); }
.cart-empty p { margin: 0 auto 18px; }

.cart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--rule); border-radius: var(--radius); }
.cart-item__name { font-family: var(--f-display); font-size: var(--fs-md); line-height: 1.2; }
.cart-item__meta { font-family: var(--f-ui); font-size: var(--fs-xs); color: var(--ink-soft); }
.cart-item__row  { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.cart-item__sum  { font-family: var(--f-ui); font-weight: 500; font-variant-numeric: tabular-nums; }
.cart-item__remove { width: 32px; height: 32px; font-size: 22px; color: var(--ink-soft); border-radius: 50%; }
.cart-item__remove:hover { color: var(--danger); background: rgba(155,44,44,.08); }

.total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--f-ui);
  margin-bottom: 14px;
}
.total-row span { color: var(--ink-soft); font-size: var(--fs-sm); }
.total-row strong { font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── 5. Obrazac za slanje upita ──────────────────────────────── */
.checkout, .success { padding: 36px 36px 28px; }
@media (max-width: 560px) { .checkout, .success { padding: 28px 18px 22px; } }

.summary {
  background: var(--paper-light);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 18px 2px;
  margin-bottom: 24px;
  font-family: var(--f-ui);
  font-size: var(--fs-sm);
}
.summary__line { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.summary__line span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary .total-row { border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 8px; }
.summary .total-row strong { font-size: 1.2rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span { font-family: var(--f-ui); font-size: var(--fs-xs); font-weight: 500; }
.field em, .check em { color: var(--danger); font-style: normal; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;               /* sprječava zoom na iOS-u */
  font-family: var(--f-ui);
  background: var(--paper-light);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(30,45,107,.15); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.check {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  margin: 4px 0 18px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  font-family: var(--f-ui); font-size: var(--fs-sm); line-height: 1.45;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--ink); margin-top: 1px; }
.check.is-invalid { border-color: var(--danger); background: rgba(155,44,44,.05); }

.form-error {
  font-family: var(--f-ui); font-size: var(--fs-sm);
  color: var(--danger);
  margin-bottom: 14px;
  max-width: none;
}

.success { text-align: center; }
.success svg { width: 64px; height: 64px; margin: 8px auto 20px; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.success p { margin: 0 auto 24px; color: var(--ink-soft); }

/* ── 6. Pravne stranice i cjenik ─────────────────────────────── */
.doc__head {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 16px 18px 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.doc__head h2 { font-family: var(--f-display); font-size: var(--fs-lg); }
.doc__head .dialog__close { position: static; margin: 0; }
.doc__body { padding: 24px 32px 40px; font-size: var(--fs-sm); }
.doc__body h3 { font-family: var(--f-display); font-size: var(--fs-md); margin: 26px 0 6px; }
.doc__body h3:first-child { margin-top: 0; }
.doc__body p + p { margin-top: .8em; }
.doc__updated { margin-top: 28px !important; padding-top: 14px; border-top: 1px solid var(--rule); font-family: var(--f-ui); font-size: var(--fs-xs); color: var(--ink-soft); }
@media (max-width: 560px) {
  .doc__head { padding-left: 20px; }
  .doc__body { padding: 20px 20px 32px; }
}

.table-wrap { overflow-x: auto; margin-top: 14px; }
.cjenik { width: 100%; border-collapse: collapse; font-family: var(--f-ui); font-size: 15px; }
.cjenik th {
  text-align: left; font-weight: 600; font-size: 13px;
  padding: 10px 8px; border-bottom: 2px solid var(--ink);
  vertical-align: bottom;
}
.cjenik td { padding: 8px; border-bottom: 1px solid var(--rule); }
.cjenik .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cjenik__sku { color: var(--ink-soft); width: 52px; }
@media (max-width: 520px) {
  .cjenik { font-size: 13.5px; }
  .cjenik th, .cjenik td { padding: 7px 4px; }
  .cjenik__sku { display: none; }
}

/* ── 7. Provjera dobi ────────────────────────────────────────── */
.gate {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(20, 28, 71, .78);
  backdrop-filter: blur(8px);
}
.age-ok .gate { display: none; }

.gate__card {
  width: min(440px, 100%);
  padding: 44px 36px 32px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--ink);
  outline: 1px solid var(--gold);
  outline-offset: -8px;
  box-shadow: 0 40px 100px -20px rgba(0,0,0,.6);
}
.gate__card[hidden] { display: none; }
.gate__logo { height: 34px; width: auto; margin: 0 auto 26px; }
.gate__title { font-family: var(--f-display); font-size: var(--fs-xl); margin-bottom: 12px; }
.gate__card p { margin: 0 auto; color: var(--ink-soft); }
.gate__actions { display: grid; gap: 10px; margin-top: 26px; }
.gate__fine { margin-top: 20px !important; font-family: var(--f-ui); font-size: var(--fs-xs); line-height: 1.55; }

/* ── 8. Kolačići, toast, plutajući gumb ──────────────────────── */
.cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 12px 28px;
  padding: 16px var(--gutter);
  background: var(--ink-deep);
  color: rgba(240,226,197,.85);
  font-family: var(--f-ui); font-size: var(--fs-sm); line-height: 1.5;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar p { max-width: 640px; }
.cookie-bar a { color: var(--gold-light); }
@media (max-width: 600px) { .cookie-bar .btn { width: 100%; } }

.toast {
  position: fixed; inset: auto auto 28px 50%; z-index: 3000;
  margin: 0; border: 0; overflow: visible;
  transform: translate(-50%, 24px);
  max-width: min(92vw, 440px);
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper-light);
  border-radius: var(--radius);
  font-family: var(--f-ui); font-size: var(--fs-sm);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .35s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast:popover-open { display: block; }

.upit-fab { display: none; }
@media (max-width: 900px) {
  .upit-fab:not([hidden]) {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 450;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    height: 52px;
    background: var(--ink); color: var(--paper-light);
    border-radius: var(--radius);
    font-family: var(--f-ui); font-weight: 500;
    box-shadow: 0 16px 30px -12px rgba(20,28,71,.6);
  }
  .upit-fab span { background: var(--gold-light); color: var(--ink-deep); border-radius: 99px; min-width: 24px; padding: 0 7px; font-size: 13px; font-weight: 600; }
  body:has(.upit-fab:not([hidden])) .site-footer { padding-bottom: 72px; }
}
