/* Stranica proizvoda: desktop ≥ 900 px; mobilni raspored (< 900 px) je na kraju datoteke. */

/* Podloga cijele stranice (breadcrumb je izvan <main>) i boje breadcrumba za svijetlu podlogu. */
body.product-bg--white, body.product-bg--cream {
  color: var(--ink-dark);
  --crumb-color: var(--ink-muted);
  --crumb-hover: var(--burgundy-800);
  --crumb-current: var(--ink-dark);
}
body.product-bg--white { background: var(--paper-white); }
body.product-bg--cream { background: var(--paper-cream); }
.single-product .site-main { max-width: none; padding: 0; }

.product { color: var(--ink-dark); }
.product--white { background: var(--paper-white); }
.product--cream { background: var(--paper-cream); }
.product a:not(.btn) { color: inherit; }

.product__main {
  max-width: calc(var(--content-max-wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 36px var(--gutter) 110px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: start;
}
@media (max-width: 899px) { .product__main { grid-template-columns: minmax(0, 1fr); } }

/* ---- Galerija ---- */
.gallery { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; position: sticky; top: 28px; }
.gallery:has(.gallery__thumbs) { grid-template-columns: 76px minmax(0, 1fr); }
.gallery__thumbs { display: flex; flex-direction: column; gap: 12px; }
.gallery__thumb { width: 100%; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; cursor: pointer; background: none; border: 1px solid transparent; transition: border-color .3s; }
.gallery__thumb.is-active { border-color: var(--burgundy-800); }
.gallery__thumb:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: 2px; }
.gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery__stage { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.gallery__slide { width: 100%; height: 100%; }
.gallery__slide:not(.is-active) { display: none; }
.gallery__slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery__share { position: absolute; top: 18px; right: 18px; display: flex; align-items: center; gap: 10px; }
.gallery__status { font-size: 11px; letter-spacing: .12em; padding: 6px 10px; background: var(--surface-glass); color: var(--ink-dark); }
.gallery__status:empty { display: none; }
.gallery__arrows { position: absolute; right: 18px; bottom: 18px; display: flex; gap: 10px; }

/* Okrugli gumbi na slici (svijetla varijanta) */
.btn-round-light {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; cursor: pointer;
  color: var(--ink-dark); background: var(--surface-glass); border: 0; border-radius: 50%;
  box-shadow: var(--shadow-round);
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}
.btn-round-light:hover { color: var(--burgundy-600); }
.btn-round-light:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: 3px; }
.btn-round-light--outline { background: var(--surface-glass-soft); border: 1px solid var(--line-bordo-round); box-shadow: none; }
.btn-round-light--outline:hover { background: var(--burgundy-800); color: var(--paper-cream); border-color: var(--burgundy-800); }

/* ---- Informacije ---- */
.info { display: flex; flex-direction: column; padding-top: 6px; min-width: 0; }
.info__eyebrow { letter-spacing: .38em; }
.info__title { margin: 16px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(42px, 4.6vw, 60px); line-height: 1.02; letter-spacing: .01em; text-wrap: balance; }
.info__sub { margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; font-weight: 450; color: var(--ink-secondary); }
.info__rating { color: var(--ink-dark); }
/* Bez podcrte dok ne postoji sekcija recenzija (inače izgleda kao poveznica koja ništa ne radi). */
.info__reviews { text-decoration: none; }
.info__price { margin-top: 28px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.info__amount { font-family: var(--font-display); font-size: 40px; font-weight: 500; line-height: 1; }
.info__amount .woocommerce-Price-amount, .info__amount bdi { font: inherit; }
.info__amount del { font-size: .6em; color: var(--ink-muted); margin-right: 8px; }
.info__amount ins { text-decoration: none; }
.info__unit { font-size: 12px; font-weight: 450; color: var(--ink-muted); }
.info__rule { height: 1px; margin: 30px 0 26px; border: 0; background: var(--line-dark); }
.info__pairing { display: flex; gap: 12px; align-items: flex-start; margin: 0; font-size: 15px; font-weight: 500; line-height: 1.6; }
.info__pairing .diamond { margin-top: 8px; }
.info__desc { margin-top: 14px; font-size: 15px; font-weight: 450; line-height: 1.85; color: var(--ink-body); text-wrap: pretty; }
.info__desc > :first-child { margin-top: 0; }
.info__desc > :last-child { margin-bottom: 0; }
.info__delivery { margin: 18px 0 0; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-secondary); }
.info__free { font-size: 12px; font-weight: 450; color: var(--ink-secondary); }

/* ---- Karakteristike ---- */
.facts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 30px 0 0; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.fact { padding: 18px 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fact__label { font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-muted); }
.fact__value { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 500; line-height: 1.3; }

/* ---- Kupnja ---- */
.buy { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.qty { display: flex; align-items: center; height: 58px; border: 1px solid var(--line-bordo-field); }
.qty__btn { width: 48px; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0; color: var(--ink-dark); background: transparent; border: 0; cursor: pointer; transition: background-color var(--ease); }
.qty__btn:hover { background: var(--ph-base); }
.qty__btn:focus-visible, .qty__input:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: -3px; }
.qty__input { width: 44px; height: 100%; padding: 0; font: inherit; font-size: 16px; font-weight: 500; text-align: center; color: var(--ink-dark); background: transparent; border: 0; border-radius: 0; -moz-appearance: textfield; appearance: textfield; }
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy__add { order: 2; flex: 1 1 220px; height: 58px; padding: 0 24px; gap: 14px; }
.buy__wish { order: 3; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; padding: 0; color: var(--ink-dark); background: transparent; border: 1px solid var(--line-bordo-field); border-radius: 0; cursor: pointer; transition: border-color var(--ease), color var(--ease); }
.buy__wish:hover { border-color: var(--burgundy-800); }
.buy__wish:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: 3px; }
.buy__wish[aria-pressed="true"] { color: var(--burgundy-600); }
.buy__wish[aria-pressed="true"] svg { fill: currentColor; }
.buy__wish svg { transition: fill .3s; }

/* ---- Harmonika ---- */
.accordion { margin-top: 36px; border-top: 1px solid var(--line-dark); }
.accordion__item { border-bottom: 1px solid var(--line-dark); }
.accordion__title { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; list-style: none; cursor: pointer; font-size: 12px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; transition: color var(--ease); }
.accordion__title::-webkit-details-marker { display: none; }
.accordion__title::after { content: "+"; font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: 0; }
.accordion__item[open] > .accordion__title::after { content: "−"; }
.accordion__title:hover { color: var(--burgundy-600); }
.accordion__title:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: 2px; }
.accordion__body { padding: 0 0 22px; max-width: 520px; font-size: 14px; font-weight: 450; line-height: 1.8; color: var(--ink-body); }
.accordion__body > :first-child { margin-top: 0; }
.accordion__body > :last-child { margin-bottom: 0; }

/* ---- Karakteristike kave: ikona + oznaka + vrijednost (3 / 2 / 1 stupac) ---- */
.specs { padding: 0 0 70px; }
.specs__grid { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 8px 28px; background: var(--gold-wash); border: 1px solid var(--line-dark); border-radius: var(--radius); }
.specs__item { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "icon label" "icon value"; column-gap: 16px; row-gap: 4px; align-content: center; padding: 22px 0; min-width: 0; }
/* Crta ispod svakog reda osim zadnjeg — i kad zadnji red nije pun, crta ide ispod svih stupaca. */
.specs__item { border-bottom: 1px solid var(--line-dark); }
.specs__item:last-child { border-bottom: 0; }
.specs__icon { grid-area: icon; display: flex; align-items: flex-start; justify-content: center; color: var(--burgundy-700); }
.specs__icon .icon { width: 30px; height: 30px; }
.specs__label { grid-area: label; margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--ink-dark); }
.specs__value { grid-area: value; margin: 0; font-size: 15px; font-weight: 450; line-height: 1.5; color: var(--ink-body); overflow-wrap: anywhere; }
@media (min-width: 600px) {
  .specs__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}
@media (min-width: 600px) and (max-width: 1099.98px) {
  .specs__item:nth-child(2n+1):nth-last-child(-n+2),
  .specs__item:nth-child(2n+1):nth-last-child(-n+2) ~ .specs__item { border-bottom: 0; }
}
@media (min-width: 1100px) {
  .specs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .specs__item:nth-child(3n+1):nth-last-child(-n+3),
  .specs__item:nth-child(3n+1):nth-last-child(-n+3) ~ .specs__item { border-bottom: 0; }
}

/* ---- Srodni proizvodi ---- */
.related { border-top: 1px solid var(--line-dark); padding: 90px 0 110px; }
.related__head { text-align: center; margin-bottom: 52px; }
.related__title { margin: 12px 0 0; font-size: clamp(34px, 4vw, 46px); letter-spacing: .02em; line-height: 1.2; }
.related__rule { display: block; width: 60px; height: 1px; margin: 18px auto 0; background: var(--gold-700); }

/* ---- Proizvod zaštićen lozinkom: naslov + WordPressov obrazac (.post-password-form) ---- */
.product-locked { padding: 56px 0 110px; text-align: center; color: var(--ink-dark); }
.product-locked__title { margin: 0 0 28px; font-size: clamp(36px, 4.5vw, 54px); letter-spacing: .02em; line-height: 1.15; overflow-wrap: anywhere; }
.post-password-form { max-width: 520px; margin: 0 auto; font-size: 15px; line-height: 1.8; color: var(--ink-body); }
.post-password-form p:last-child { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 12px; margin-bottom: 0; }
.post-password-form label { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; text-align: left; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-muted); }
.post-password-form input[type="password"] { font: inherit; font-size: 14px; letter-spacing: normal; text-transform: none; color: var(--ink-dark); background: transparent; border: 1px solid var(--line-bordo-field); border-radius: var(--radius); padding: 15px 18px; }
.post-password-form input[type="submit"] { padding: 18px 36px; font: inherit; font-size: 11px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--paper-cream); background: var(--bordo-gradient); border: 0; border-radius: var(--radius); box-shadow: var(--ring-bordo-btn), var(--shadow-bordo-btn); cursor: pointer; }
.post-password-form input:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: 3px; }

/* ---- Mobilni dodaci: skriveni od 900 px ---- */
.gallery__back, .gallery__wish, .gallery__dots, .info__variant, .info__more, .product-sticky { display: none; }

/* ---- Mobitel (< 900 px) ---- */
@media (max-width: 899px) {
  .product { --gutter: 24px; }
  /* Breadcrumb zamjenjuje gumb „natrag” na slici (dizajn počinje galerijom). */
  body.single-product .breadcrumbs { display: none; }
  /* Fokusirani element ne smije ostati ispod sticky trake (visina ≈ 115 px). */
  html:has(.product-sticky) { scroll-padding-bottom: 132px; }
  .product__main { display: block; padding: 0 0 8px; }

  .gallery { position: static; display: block; }
  .gallery:has(.gallery__thumbs) { display: block; }
  .gallery__thumbs, .gallery__arrows { display: none; }
  .gallery__stage { aspect-ratio: 1 / 1.08; touch-action: pan-y; }
  .gallery .btn-round-light { width: 42px; height: 42px; }
  .gallery__back { display: inline-flex; position: absolute; top: 16px; left: 16px; }
  .gallery__share { top: 16px; right: 68px; }
  .gallery__status { position: absolute; top: 52px; right: 0; white-space: nowrap; }
  .gallery__wish { display: inline-flex; position: absolute; top: 16px; right: 16px; }
  .gallery__wish[aria-pressed="true"] { color: var(--burgundy-600); }
  .gallery__wish[aria-pressed="true"] svg { fill: currentColor; }
  .gallery__wish svg { transition: fill .3s; }
  .gallery__dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; }
  /* Gumb je 24×24 radi dodira (WCAG 2.5.8); vidljiva točka je pseudo-element. */
  .gallery__dot { position: relative; width: 24px; height: 24px; padding: 0; background: none; border: 0; cursor: pointer; }
  .gallery__dot::before { content: ""; position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; border-radius: 5px; background: var(--dot-idle-light-bg); transform: translate(-50%, -50%); transition: width .3s, background-color .3s; }
  .gallery__dot.is-active::before { width: 22px; background: var(--ink-dark); }
  .gallery__dot:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: -2px; }

  .info { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: start; padding: 26px var(--gutter) 0; }
  .info > * { grid-column: 1 / -1; }
  .info__eyebrow, .info__sub { display: none; }
  /* Cijena ostaje vidljiva i na mobitelu: prodajna uz „/ pakiranje · PDV uključen”, odmah ispod nje cijena za jedinicu
     mjere (ZZP, Direktiva 98/6/EZ) i „Cijena na upit” kod aparata. Sticky traka nosi ukupni iznos za odabranu količinu. */
  .info__price { margin-top: 16px; gap: 10px; }
  .info__amount { font-size: 28px; }
  .info__price + .product__unit-price { margin-top: 6px; }
  .info__title { grid-column: 1; grid-row: 1; margin: 0; font-weight: 500; font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
  .info__variant { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; font-size: 13px; color: var(--ink-secondary); }
  .info__variant-label { text-decoration: underline; text-underline-offset: 3px; }
  .info__rule { margin: 22px 0; }
  .info__pairing { font-size: 14px; }
  .info__pairing .diamond { margin-top: 7px; }
  .info__desc { margin-top: 12px; font-size: 14px; line-height: 1.75; }
  /* Skraćivanje samo dok radi JS (klasa is-js), da se bez JS-a opis vidi cijeli. */
  .product.is-js .info__desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
  .product.is-js .info__desc.is-expanded { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
  .info__more { display: block; align-self: end; justify-self: end; margin-top: 6px; padding: 6px 0; font: inherit; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--burgundy-800); background: none; border: 0; cursor: pointer; }
  .info__more[hidden] { display: none; }
  .info__more:focus-visible { outline: 1px solid var(--burgundy-800); outline-offset: 2px; }

  .facts { margin: 20px 0 28px; padding: 20px 0; text-align: center; }
  /* Vrijednost iznad oznake kao u dizajnu; u DOM-u ostaje dt → dd. */
  .fact { padding: 0; align-items: center; gap: 6px; flex-direction: column-reverse; justify-content: flex-end; }
  .fact__label { font-size: 10px; letter-spacing: .12em; overflow-wrap: anywhere; }
  .fact__value { font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }

  /* Forma ostaje jedna: na mobitelu se vidi samo količina uz naslov, gumb je u sticky traci (atribut form). */
  .buy { display: contents; }
  .buy > .buy__add, .buy > .buy__wish { display: none; }
  .buy > a.buy__add { display: inline-flex; grid-column: 1 / -1; margin-bottom: 24px; }
  .qty { grid-column: 2; grid-row: 1 / span 2; height: auto; border: 0; gap: 2px; }
  .qty__btn { width: 38px; height: 38px; border-radius: 50%; }
  .qty__input { width: 28px; height: 38px; font-size: 17px; }
  .info__delivery { display: none; }
  .accordion { margin-top: 0; }

  .related { padding: 56px 0 40px; }
  .related__head { margin-bottom: 32px; }

  .product-sticky {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px var(--gutter) max(24px, env(safe-area-inset-bottom));
    background: inherit; border-top: 1px solid var(--line-sticky); box-shadow: var(--shadow-sticky);
  }
  .product-sticky__sum { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .product-sticky__total { font-family: var(--font-display); font-size: 28px; font-weight: 500; line-height: 1; white-space: nowrap; }
  .product-sticky__total .woocommerce-Price-amount, .product-sticky__total bdi { font: inherit; }
  .product-sticky__total del { display: none; }
  .product-sticky__total ins { text-decoration: none; }
  .product-sticky__add { flex: none; gap: 14px; padding: 19px 34px; }
}
@media (max-width: 899px) and (max-width: 380px) {
  .product-sticky { gap: 10px; }
  .product-sticky__total { font-size: 24px; }
  .product-sticky__add { padding: 18px 20px; gap: 10px; letter-spacing: .2em; }
  .fact__label { letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery__thumb, .btn-round-light, .qty__btn, .buy__wish, .buy__wish svg, .accordion__title, .gallery__wish svg, .gallery__dot::before { transition: none; }
}

/* ---- Zaliha, jedinična i najniža cijena, brend, tehnički podaci ---- */
.product__unit-price, .product__lowest, .product__brand { margin: 8px 0 0; font-size: 13px; color: var(--ink-muted); }
/* Oznaka bazne cijene (NN 132/2026): sitno, u svom retku, nikad precrtano; --ink-secondary na kremu 6,25:1, na bijelom 7,39:1 */
.product__base-price { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-secondary); text-decoration: none; overflow-wrap: anywhere; }
.product__brand a { color: var(--gold-text); }
.product__soldout { margin: 32px 0 0; font-size: 14px; color: var(--ink-secondary); }
.product__soldout + .buy { margin-top: 12px; }
.accordion__body dl { margin: 0 0 12px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.accordion__body dt { color: var(--ink-muted); }
.accordion__body dd { margin: 0; }

/* ---- Napomena o prodaji alkohola (način „upit”): iznad gumba „Pošalji upit”; na mobitelu jedan redak iznad sticky trake ---- */
.product__note { margin: 28px 0 0; padding: 12px 16px; background: var(--paper-white); border: 1px solid var(--line-dark); border-left: 3px solid var(--gold-700); font-size: 13px; line-height: 1.6; color: var(--ink-secondary); }
.product__note + .buy { margin-top: 14px; }
.product-sticky__note { display: none; margin: 0; font-size: 12px; line-height: 1.4; color: var(--ink-secondary); }
@media (max-width: 899px) {
  .product-sticky:has(.product-sticky__note) { flex-wrap: wrap; }
  .product-sticky__note { display: block; flex: 1 0 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
