/* Bago – dopune za dinamički sadržaj (stvarne slike umesto .ph placeholdera). Ne menja style.css iz templejta. */

/* Kartica proizvoda: stvarna slika u kvadratnom okviru */
a.product__media:not(.ph) {
  display: block;
  aspect-ratio: 1 / 1;
  background: #fff;
  overflow: hidden;
}
.product__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

/* Uvod kategorije iz CMS-a (HTML iz admina) */
.page-head__lead p + p { margin-top: 10px; }
.page-head__lead a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.page-head__lead ul, .page-head__lead ol { margin: 10px 0 0 20px; }
.page-head__lead ul { list-style: disc; }
.page-head__lead ol { list-style: decimal; }

/* SEO tekst: HTML iz admina (h2/h3/ul/ol) */
.seo-text h2 { font-size: 24px; margin: 32px 0 12px; }
.seo-text h2:first-child, .seo-text h3:first-child { margin-top: 0; }
.seo-text ul, .seo-text ol { margin: 0 0 16px 22px; }
.seo-text ul { list-style: disc; }
.seo-text ol { list-style: decimal; }

/* Pager: trotačka "…" */
.pager .is-gap { padding: 0 6px; color: var(--c-muted); }

/* Sidebar stablo: tekuca kategorija */
.cattree__row > a[aria-current="page"] { color: var(--c-primary); background: var(--c-surface); }
.shop-empty { padding: 32px 0; color: var(--c-muted); }

/* ---------- Stranica proizvoda ---------- */
.hidden { display: none !important; }
.pd__main { display: block; overflow: hidden; background: #fff; }
.pd__main img { width: 100%; height: 100%; object-fit: contain; }
.pd__main.ph { display: grid; }
.pd__thumb { display: block; padding: 0; overflow: hidden; background: #fff; }
.pd__thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd__stock--out { color: var(--c-muted); }
.btn.is-disabled, .btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.pd__minqty { margin-top: 10px; font-size: 14px; color: var(--c-muted); }
.tabs__content a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.tabs__content ul, .tabs__content ol { margin: 0 0 14px 22px; }
.tabs__content ul { list-style: disc; }
.tabs__content ol { list-style: decimal; }
.tabs__content h3 { margin: 22px 0 8px; font-size: 18px; }
.tabs__content img { height: auto; }
.spec-table + .spec-table { margin-top: 20px; }

/* ---------- Pocetna ---------- */
/* Hero bez slajdera: jedna kolona */
.hero__inner--single { grid-template-columns: minmax(0, 760px); }
.hero__inner--single .hero__lead { max-width: 60ch; }

/* Kartice kategorija sa slikom (umesto ikone) */
.cat-card--img { padding: 0; gap: 0; overflow: hidden; }
.cat-card__media { display: block; width: 100%; aspect-ratio: 4 / 3; background: #fff; border-bottom: 1px solid var(--c-line); overflow: hidden; }
.cat-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cat-card__text { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.cat-grid { container-type: inline-size; }
.cat-card--promo {
  position: relative;
  overflow: hidden;
  grid-column: span 2;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  background: #d81f26;
  border-color: #d81f26;
  color: #fff;
  min-height: calc((100cqi - 48px) / 4 * 0.75 + 68px);
}
.cat-card--promo:hover { border-color: #d81f26; }
.cat-promo__mark {
  position: absolute;
  z-index: 0;
  right: -8%;
  top: 50%;
  height: 155%;
  width: auto;
  max-width: 58%;
  transform: translateY(-50%);
  object-fit: contain;
  object-position: right center;
  opacity: 0.1;
  pointer-events: none;
  user-select: none;
}
.cat-promo__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  max-width: 36rem;
}
.cat-promo__kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .85);
}
.cat-promo__title { font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; }
.cat-promo__text { font-size: 15px; line-height: 1.45; max-width: 42ch; color: rgba(255, 255, 255, .95); }
.cat-promo__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.cat-promo__phone { font-weight: 800; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cat-promo__phone:hover { color: #fff; }
.cat-promo__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
}
.cat-promo__links a { color: rgba(255, 255, 255, .92); text-decoration: underline; text-underline-offset: 2px; }
.cat-promo__links a:hover { color: #fff; }
.cat-promo__links span { opacity: .7; }
@media (max-width: 1024px) {
  .cat-card--promo { min-height: calc((100cqi - 32px) / 3 * 0.75 + 72px); }
}
@media (max-width: 520px) {
  .cat-card--promo { grid-column: 1 / -1; min-height: calc((100cqi - 16px) / 2 * 0.75 + 72px); }
  .cat-promo__body { max-width: none; }
  .cat-promo__title { font-size: 20px; }
}

/* Brendovi: naziv (ili logo) u kartici */
.brand-card__box { display: grid; place-items: center; aspect-ratio: 2 / 1; padding: 10px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--r); text-align: center; font-weight: 800; font-size: 15px; line-height: 1.2; color: var(--c-ink); }
.brand-card__box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-card:hover .brand-card__box { box-shadow: var(--shadow); }
.solution__media img { width: 100%; height: 100%; object-fit: cover; }

/* Sadrzaj iz admina (Zasto Bago) */
#zasto-bago .section__head + .stats { margin-top: 0; }

/* Katalog: slika kategorije u hub-kartici */
.hub-card__media { background: #fff; border-bottom: 1px solid var(--c-line); overflow: hidden; }
.hub-card__media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }

/* Brend u kartici proizvoda kao link */
a.product__brand:hover { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
/* CMS info stranice (bez bocnog menija) */
.cms-single { padding-top: 12px; padding-bottom: 72px; }
.cms-faq { margin-top: 48px; }
.cms-faq .section__title { margin-bottom: 16px; }

/* Kontakt forma: poruke i honeypot */
.form-msg { margin-bottom: 18px; padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--c-line); font-size: 14.5px; font-weight: 600; }
.form-msg[hidden] { display: none; }
.form-msg--ok { background: #eaf7ee; border-color: #8fd1a2; color: #17582b; }
.form-msg--err { background: var(--c-primary-050); border-color: var(--c-primary); color: var(--c-primary-600); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checks { display: grid; gap: 10px; }
.checks label { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.checks input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--c-primary); flex: none; }
.field input[type="file"] { padding: 10px 13px; }

/* Kontakt mapa: placeholder dok se ne klikne, zatim iframe */
.map__box { position: relative; display: grid; place-items: center; min-height: 320px; padding: 24px; text-align: center; }
.map__consent { display: grid; gap: 10px; max-width: 520px; justify-items: center; }
.map__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 6px; }
.map__box--loaded { display: block; padding: 0; aspect-ratio: auto; min-height: 420px; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--c-line); }
.map__box--loaded iframe { display: block; width: 100%; height: 100%; min-height: 420px; border: 0; }

/* ---------- Korpa: dopune za dinamicki sadrzaj (shop-cart-page.js menja ove klase) ---------- */
.cart-row__media:not(.ph) { display: block; background: #fff; border: 1px solid var(--c-line); overflow: hidden; }
.cart-row__media img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cart-row__old { margin-left: 6px; color: var(--c-muted); }
.cart-row .product__price-now { font-weight: 800; }
/* JS dodaje/skida ove klase na dugmetu "Nastavi ka naplati" i na "-" kada je minimum */
.opacity-60 { opacity: .55; }
.pointer-events-none { pointer-events: none; }
.qty button.opacity-40 { opacity: .4; }
.qty button.cursor-not-allowed { cursor: not-allowed; }
.summary .coupon .btn { margin-top: 0; }
.cart-ship { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r); background: var(--c-primary-050); color: var(--c-ink); font-size: 13.5px; font-weight: 700; }
.cart-ship .ico { flex: 0 0 auto; width: 20px; height: 20px; fill: currentColor; color: var(--c-primary); }
.cart-coupon-msg { margin: -8px 0 14px; font-size: 13.5px; font-weight: 600; }
.cart-coupon-msg--err { color: var(--c-primary-600); }
.cart-coupon-msg--ok { color: #17582b; }
.cart-delivery { display: grid; gap: 8px; margin-bottom: 14px; }
.cart-delivery__title { font-size: 14px; font-weight: 800; margin: 0; }
.cart-delivery__opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--c-line); border-radius: var(--r); cursor: pointer; }
.cart-delivery__opt.is-selected { border-color: var(--c-primary); background: var(--c-primary-050); }
.cart-delivery__opt.is-unavailable { opacity: .6; cursor: default; }
.cart-delivery__opt input { margin-top: 3px; accent-color: var(--c-primary); }
.cart-delivery__text { display: grid; gap: 2px; min-width: 0; }
.cart-delivery__name { font-weight: 700; font-size: 14px; }
.cart-delivery__desc { font-size: 12.5px; color: var(--c-muted); }
.cart-delivery__price { font-size: 13.5px; font-weight: 700; }
.cart-zone { display: grid; gap: 6px; margin: -2px 0 2px 28px; }
.cart-zone__label { font-size: 12.5px; font-weight: 700; margin: 0; }
.cart-zone__opt { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.cart-zone__opt input { accent-color: var(--c-primary); }
.cart-terms { display: grid; gap: 8px; margin-top: 16px; }
.cart-terms__link { justify-self: start; padding: 0; font-size: 13.5px; font-weight: 700; color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.cart-terms__check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.cart-terms__check input { margin-top: 3px; accent-color: var(--c-primary); }
.summary .cart-terms + .btn { margin-top: 14px; }

/* Modal "Uslovi kupovine" */
body.is-cart-terms-open { overflow: hidden; }
.cart-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; }
.cart-modal[hidden] { display: none; }
.cart-modal__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .55); }
.cart-modal__dialog { position: relative; display: flex; flex-direction: column; width: min(760px, 100%); max-height: calc(100vh - 40px); background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.cart-modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-line); }
.cart-modal__header h2 { font-size: 20px; margin: 0; }
.cart-modal__close { width: 40px; height: 40px; font-size: 28px; line-height: 1; color: var(--c-muted); }
.cart-modal__close:hover { color: var(--c-primary); }
.cart-modal__body { padding: 20px; overflow-y: auto; }
.cart-modal__empty { color: var(--c-muted); }

@media (max-width: 640px) {
  .cart-row { grid-template-columns: 72px 1fr; }
  .cart-row__media { width: 72px; }
  .cart-row__right { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}

/* ---- nalog / moj nalog (lepak) ---- */
.page-head__actions-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head__actions-row .account-title { margin-bottom: 0; }
.addr-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.addr-list .order-info__title .status { margin-left: 6px; vertical-align: middle; }
.addr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.addr-actions form { margin: 0; }
.auth__form .auth__row { margin-bottom: 0; }
.form-msg + .auth__form, .form-msg + form { margin-top: 12px; }
.side-layout__main > .form-msg { margin-bottom: 16px; }
.side-layout__main > section + section { margin-top: 24px; }

/* ---------- Kolačići (BEM, :root iz style.css) ---------- */
body.is-consent-open { overflow: hidden; }
.consent--banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: var(--c-bg);
  color: var(--c-ink);
  border-top: 1px solid var(--c-line);
  box-shadow: var(--shadow-lg);
  padding: 16px 0;
}
.consent--banner[hidden] { display: none; }
.consent__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.consent__copy { flex: 1 1 280px; min-width: 0; }
.consent__title { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.consent__text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--c-muted); }
.consent__link { color: var(--c-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.consent__link:hover { color: var(--c-primary-600); }
.consent__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consent__actions .btn:focus-visible,
.consent-panel__x:focus-visible,
.consent-cats__label:focus-within,
.consent__reopen:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
}
.consent__reopen {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: #cfd3d9;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.consent__reopen:hover { color: #fff; }

.consent-panel { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.consent-panel[hidden] { display: none; }
.consent-panel__backdrop { position: absolute; inset: 0; background: rgba(20, 23, 27, .55); border: 0; padding: 0; cursor: pointer; }
.consent-panel__dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.consent-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--c-line); }
.consent-panel__title { margin: 0; font-size: 20px; }
.consent-panel__x { width: 40px; height: 40px; font-size: 28px; line-height: 1; color: var(--c-muted); }
.consent-panel__x:hover { color: var(--c-primary); }
.consent-panel__body { padding: 20px; overflow-y: auto; }
.consent-panel__lead { margin: 0 0 16px; font-size: 14.5px; color: var(--c-muted); }
.consent-cats { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.consent-cats__item { margin: 0; padding: 12px 14px; border: 1.5px solid var(--c-line); border-radius: var(--r); background: var(--c-surface); }
.consent-cats__label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14.5px; }
.consent-cats__label input { margin-top: 3px; accent-color: var(--c-primary); }
.consent-cats__hint { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--c-muted); }
.consent-panel__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--c-line); }

@media (max-width: 640px) {
  .consent__actions { width: 100%; }
  .consent__actions .btn { flex: 1 1 100%; }
}

/* ---------- Blog lista (.blog-list) — show.php koristi isti app.css ---------- */
.blog-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  padding-bottom: 72px;
}
.blog-list__card {
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.blog-list__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-surface);
}
.blog-list__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-list__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  padding: 18px 20px 20px;
}
.blog-list__date { font-size: 13px; font-weight: 600; color: var(--c-muted); }
.blog-list__title { font-size: 18px; text-wrap: balance; }
.blog-list__title a:hover { color: var(--c-primary); }
.blog-list__excerpt { font-size: 14.5px; color: var(--c-muted); }
.blog-list > .pager { grid-column: 1 / -1; margin-top: 20px; }

@media (min-width: 640px) {
  .blog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
  .blog-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
}