/* Komponente — dizajn: dizajn/stranice/Komponente.html, StilVodic.html, Proizvod.html, Porudzbina--ruo-potvrda.html,
   AdminPorudzbine.html, AdminPodesavanja.html. Pravila: ProjekatInfo/02-dizajn-sistem.md. */

/* ============================================================
   Panel — površina bez senke (hijerarhija: bg → surface-1 → surface-2)
   ============================================================ */
.panel {
  padding: 24px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.panel--surface-2 {
  background: var(--surface-2);
}

/* ============================================================
   Dugmad (visina 48, primarno i 52 za glavne akcije)
   ============================================================ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}

.button:focus-visible {
  outline-offset: 3px;
}

.button--large {
  height: 52px;
  padding: 0 20px;
}

.button--block {
  width: 100%;
}

/* Primarno dugme nema okvir (kao u dizajnu) — širina = tekst + padding */
.button--primary {
  border-width: 0;
  background: var(--accent);
  color: var(--on-accent);
}

.button--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* Sekundarno na sajtu: okvir u boji teksta, hover = podloga surface-2 (kao u Main.html) */
.button--secondary {
  border-color: var(--text);
  color: var(--text);
}

.button--secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Sekundarno tiho (admin, „Nazad” u modalu): okvir --line, hover okvir --muted */
.button--quiet {
  border-color: var(--line);
  color: var(--text);
}

.button--quiet:hover {
  border-color: var(--muted);
  color: var(--text);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
}

.button--primary:disabled,
.button--primary[aria-disabled="true"] {
  background: var(--line);
  color: var(--muted);
}

.button--secondary:disabled,
.button--quiet:disabled {
  background: transparent;
  border-color: var(--line);
  color: var(--muted-2);
}

/* Kvadratno dugme sa ikonicom (meni, zatvori, korpa) — dodirna površina 44 px */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
}

.icon-button:hover {
  color: var(--accent-hover);
}

/* Kvadratno akcentno „+” (mobilna kartica) */
.icon-button--accent {
  background: var(--accent);
  color: var(--on-accent);
}

.icon-button--accent:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* Tercijarni link sa strelicom — strelica se pomeri 3 px na hover */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.link-arrow__icon {
  transition: transform var(--dur-base) var(--ease);
}

.link-arrow:hover {
  color: var(--accent-hover);
}

.link-arrow:hover .link-arrow__icon {
  transform: translateX(3px);
}

/* „← Nazad …” */
.link-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  font-size: var(--fs-small);
  color: var(--muted);
}

/* Podvučen link u tekstu */
.text-link,
.prose a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover,
.prose a:hover {
  color: var(--accent-hover);
}

/* ============================================================
   Forme — labela iznad polja
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field__label {
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.5;
}

.field__optional {
  font-weight: 400;
  color: var(--muted);
}

.field__hint {
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--muted);
}

.field__error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--error);
}

.input,
.textarea {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-text);
  font-size: 16px; /* 16 px — iOS ne uvećava stranicu na fokus */
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.input {
  height: 48px;
  padding: 0 16px;
}

.textarea {
  min-height: 96px;
  padding: 12px 16px;
  line-height: 1.5;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
  opacity: 1;
}

.input:focus,
.textarea:focus,
.input:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--error);
}

.input--numeric {
  font-variant-numeric: tabular-nums;
}

/* Okvir sa spiskom grešaka na vrhu forme (greška = ikonica + tekst, nikad samo boja) */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.alert__icon {
  margin-top: 1px;
}

.alert__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert__title {
  font-weight: 600;
}

.alert__text {
  color: var(--muted);
}

.alert--error {
  background: var(--error-08);
  border-color: var(--error-45);
}

.alert--error .alert__icon {
  color: var(--error);
}

/* ============================================================
   Čekboks (20 px; 22 px u RUO potvrdama) — kvačica je SVG u CSS-u
   ============================================================ */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: var(--fs-small);
  line-height: 1.5;
  cursor: pointer;
}

.check--large {
  font-size: 15px;
}

.check a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.checkbox {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  background: var(--surface-2) center / 16px 16px no-repeat;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.check--large .checkbox {
  width: 22px;
  height: 22px;
  background-size: 18px 18px;
}

.checkbox:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0B0C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E");
}

.checkbox[aria-invalid="true"] {
  border-color: var(--error);
}

.checkbox:focus-visible {
  outline-offset: 2px;
}

/* Telefon: red sa čekboksom od jednog reda teksta (23 px) dobija dodirnu površinu od 44 px — produžava se
   podjednako gore i dole u prazan prostor oko reda (razmak 14 px, unutrašnja margina okvira 16 px), izgled se ne menja */
@media (max-width: 640px) {
  .check {
    position: relative;
  }

  .check::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: max(100%, 44px);
    transform: translateY(-50%);
  }

  /* Link u tekstu labele (npr. „RUO uslove”) ostaje iznad dodirne površine i otvara se na dodir */
  .check a {
    position: relative;
    z-index: 1;
  }
}

/* ============================================================
   Prekidač 40 × 24
   ============================================================ */
.switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  padding: 2px;
  border: 0;
  border-radius: 12px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease);
}

/* Nevidljivo proširenje dodirne površine na 44 × 44 (izgled ostaje 40 × 24) */
.switch::before {
  content: '';
  position: absolute;
  inset: -10px -2px;
}

.switch::after {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform var(--dur-base) var(--ease), background-color var(--dur-base) var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--accent);
}

.switch[aria-checked="true"]::after {
  transform: translateX(16px);
  background: var(--on-accent);
}

/* Zaključan (obavezno): akcenat na 45 %, svetli kružić */
.switch[aria-disabled="true"] {
  cursor: not-allowed;
}

.switch[aria-disabled="true"][aria-checked="true"] {
  background: var(--accent-45);
}

.switch[aria-disabled="true"][aria-checked="true"]::after {
  background: var(--text);
}

.locked-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Red sa prekidačem (podešavanja) */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.switch-row__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.45;
}

.switch-row__title {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 500;
}

.switch-row__hint {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ============================================================
   Oznake na proizvodu (potpuno zaobljene, verzal 11 px)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--tracking-label);
  white-space: nowrap;
}

.badge--new {
  background: var(--text);
  border-color: var(--text);
  color: var(--on-accent);
}

.badge--sale {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.badge--bestseller {
  background: var(--badge-dark);
  border-color: var(--text);
  color: var(--text);
}

.badge--out {
  background: var(--line);
  border-color: var(--line);
  color: var(--text);
}

/* RUO oznaka: „RESEARCH USE ONLY” / „RUO · RESEARCH USE ONLY” */
.badge--ruo {
  padding: 0 9px;
  background: var(--ruo-12);
  border-color: var(--ruo-45);
  color: var(--ruo);
}

.badge--ruo-large {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  font-size: 12px;
}

/* ============================================================
   Statusni čipovi porudžbine (podloga 12 %, okvir 45 %, tekst u boji)
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.chip--nova {
  background: var(--accent-12);
  border-color: var(--accent-45);
  color: var(--accent-hover);
}

.chip--potvrdjena {
  background: var(--text-08);
  border-color: var(--line-strong);
  color: var(--text);
}

.chip--poslata {
  background: var(--info-12);
  border-color: var(--info-45);
  color: var(--info);
}

.chip--isporucena {
  background: var(--success-12);
  border-color: var(--success-45);
  color: var(--success);
}

.chip--nije_preuzeta {
  background: var(--error-12);
  border-color: var(--error-45);
  color: var(--error);
}

.chip--otkazana {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

/* ============================================================
   Tabovi — donja linija 2 px u akcentu na aktivnom
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 1 0 auto;
  height: 56px;
  margin-bottom: -1px;
  padding: 0 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab[aria-selected="true"] {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.tab:focus-visible {
  outline-offset: -2px;
}

/* ============================================================
   RUO napomena (žuta) i okviri
   ============================================================ */
.ruo-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ruo-06);
  border: 1px solid var(--ruo-45);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.ruo-note__icon {
  margin-top: 1px;
  color: var(--ruo);
}

.ruo-note strong {
  font-weight: 600;
}

/* ============================================================
   Toast obaveštenja
   ============================================================ */
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.toast--floating {
  box-shadow: var(--shadow-float);
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.toast__icon--success {
  border-radius: 50%;
  background: var(--success);
  color: var(--on-accent);
}

.toast__icon--success .icon {
  stroke-width: 2.5;
}

.toast__icon--error {
  color: var(--error);
}

.toast__icon--info {
  color: var(--info);
}

.toast__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast__title {
  font-weight: 600;
}

.toast__text {
  color: var(--muted);
}

.toast__link {
  margin-top: 6px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.toast__close {
  position: relative;
  width: 32px;
  height: 32px;
  margin: -6px -6px 0 0;
  color: var(--muted);
}

/* Dodirna površina 44 × 44 oko dugmeta od 32 px */
.toast__close::before {
  content: '';
  position: absolute;
  inset: -6px;
}

/* Mala bočica (sličica 56/48 px) — pregled porudžbine i admin (Porudzbina.html, AdminDetalj.html) */
.mini-vial {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 14px;
  height: 36px;
}

.mini-vial__cap {
  width: 72%;
  height: 12%;
  background: var(--cap-kost);
}

.mini-vial--cap-grafit .mini-vial__cap { background: var(--cap-grafit); }
.mini-vial--cap-siva .mini-vial__cap { background: var(--cap-siva); }
.mini-vial--cap-tamna .mini-vial__cap { background: var(--cap-tamna); }
.mini-vial--cap-narandzasta .mini-vial__cap { background: var(--cap-narandzasta); }

.mini-vial__ring {
  width: 80%;
  height: 8%;
  background: var(--muted);
}

.mini-vial__body {
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 1px;
  border-radius: 1px 1px 2px 2px;
  background: rgba(237, 234, 228, 0.12);
  box-shadow: inset 0 0 0 1px rgba(237, 234, 228, 0.24);
}

.mini-vial__label {
  width: 100%;
  height: 45%;
  background: var(--label);
}

/* Lepljiva traka na dnu ekrana na telefonu (stranica proizvoda, korpa) — u stranici posle footera */
.buy-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 16px;
  background: var(--float-bar-bg);
  border-top: 1px solid var(--line);
}

/* Mesto za plutajuće obaveštenje: dole desno (telefon: dole, cela širina, iznad lepljive trake) */
.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-region .toast {
  pointer-events: auto;
  animation: toast-in var(--dur-panel) var(--ease);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 640px) {
  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}

/* ============================================================
   Količina − / +
   ============================================================ */
.qty {
  display: inline-flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.qty__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text);
}

.qty__button:hover {
  color: var(--accent-hover);
}

.qty__button:disabled {
  color: var(--muted-2);
  cursor: not-allowed;
}

.qty__value {
  width: 32px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Način plaćanja (informacija, ne izbor)
   ============================================================ */
.payment-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--text);
  border-radius: var(--radius);
}

.payment-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.payment-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-small);
  line-height: 1.5;
}

.payment-card__title {
  font-size: 16px;
  font-weight: 600;
}

.payment-card__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text);
  color: var(--on-accent);
}

.payment-card__check .icon {
  stroke-width: 2.5;
}

/* ============================================================
   Modal — prekrivač 72 % + zamućenje, panel surface-1, padding 40 (mobilni 24)
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fade-in var(--dur-panel) var(--ease);
}

.modal__panel {
  position: relative;
  width: 560px;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-float);
  animation: modal-in var(--dur-panel) var(--ease);
}

.modal__title {
  font-family: var(--font-display);
  font-size: 32px;
  font-stretch: var(--stretch-h2);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.modal__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.modal__actions {
  display: flex;
  gap: 12px;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* Dok je modal ili meni otvoren, stranica ispod se ne skroluje */
body.is-locked {
  overflow: hidden;
}

@media (max-width: 640px) {
  .modal {
    padding: 16px;
  }

  .modal__panel {
    gap: 20px;
    padding: 24px 20px;
  }

  .modal__actions {
    flex-direction: column;
  }

  .modal__title {
    font-size: 28px;
  }
}

/* ============================================================
   „Bina” i CSS ilustracija bočice (kad proizvod nema fotografiju)
   Veličine su u cqw — ista bočica radi i na kartici i u korpi/porudžbini/adminu.
   ============================================================ */
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  container-type: inline-size;
  overflow: hidden;
  background: var(--stage-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.vial {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 24%;
  height: 60%;
}

.vial--small {
  height: 66%;
}

/* Senka ispod bočice */
.vial::before {
  content: '';
  position: absolute;
  left: -36%;
  right: -36%;
  bottom: -5%;
  height: 10%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
}

.vial__cap {
  position: relative;
  width: 72%;
  height: 11%;
  background: var(--cap-kost);
  border-radius: 3px 3px 1px 1px;
}

.vial__ring {
  position: relative;
  width: 78%;
  height: 7%;
  background: var(--vial-ring);
}

.vial__neck {
  position: relative;
  width: 60%;
  height: 5%;
  background: rgba(237, 234, 228, 0.08);
  box-shadow: inset 1px 0 0 rgba(237, 234, 228, 0.22), inset -1px 0 0 rgba(237, 234, 228, 0.22);
}

.vial__body {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  border-radius: 5px 5px 9px 9px;
  background: var(--vial-glass);
  box-shadow: inset 0 0 0 1px rgba(237, 234, 228, 0.24);
}

.vial__label {
  position: absolute;
  left: 0;
  right: 0;
  top: 16%;
  height: 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9cqw;
  background: var(--label);
}

.vial__brand {
  font-family: var(--font-display);
  font-size: 1.9cqw;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2em;
  color: var(--line-strong);
}

.vial__code {
  font-family: var(--font-display);
  font-size: 8cqw;
  font-stretch: 75%;
  font-weight: 800;
  line-height: 0.9;
  color: var(--bg);
}

.vial__amount {
  font-size: 1.9cqw;
  font-weight: 600;
  line-height: 1;
  color: var(--line-strong);
}

.vial__powder {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 4%;
  height: 13%;
  border-radius: 0 0 6px 6px;
  background: var(--vial-powder);
}

/* Boje čepova (samo 5 dozvoljenih) — klasa umesto inline stila zbog CSP-a */
.vial--cap-kost .vial__cap { background: var(--cap-kost); }
.vial--cap-grafit .vial__cap { background: var(--cap-grafit); }
.vial--cap-siva .vial__cap { background: var(--cap-siva); }
.vial--cap-tamna .vial__cap { background: var(--cap-tamna); }
.vial--cap-narandzasta .vial__cap { background: var(--cap-narandzasta); }

/* Hover na kartici: okvir bine u akcentu, bočica 1.04× */
.stage--interactive {
  transition: border-color var(--dur-card) var(--ease);
}

.stage--interactive .vial,
.stage--interactive .stage__image {
  transition: transform var(--dur-panel) var(--ease);
}

.stage--interactive:hover {
  border-color: var(--accent);
}

.stage--interactive:hover .vial,
.stage--interactive:hover .stage__image {
  transform: scale(1.04);
}

/* Nema na stanju: prigušena bina */
.stage--out {
  opacity: 0.55;
}

.stage__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

/* ============================================================
   Kvadrat sa ikonicom (RUO stavke, traka poverenja) — u dizajnu 40 px + okvir = 42 px (mobilni 36 + okvir = 38)
   ============================================================ */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Naslov sekcije sa napomenom desno */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head__note {
  font-size: var(--fs-small);
  color: var(--muted);
}

@media (max-width: 640px) {
  .icon-box {
    width: 38px;
    height: 38px;
  }

  .icon-box .icon {
    width: 18px;
    height: 18px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .section-head .h2 {
    font-size: 28px;
    line-height: 1.15;
  }

  .section-head__note {
    font-size: var(--fs-xs);
  }
}

/* ============================================================
   Kartica proizvoda (Izdvojeno, Slični proizvodi, prazna korpa) — Main.html / PocetnaMobilni.html
   Desktop: „Dodaj u korpu” se pojavi na hover; telefon: uvek vidljivo „+”.
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 32px 24px;
}

.product-grid__status {
  font-size: var(--fs-small);
  color: var(--muted);
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.product-card__cover {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card__cover:focus-visible {
  outline-offset: -2px;
}

.product-card:hover .stage--interactive {
  border-color: var(--accent);
}

.product-card:hover .stage--interactive .vial,
.product-card:hover .stage--interactive .stage__image {
  transform: scale(1.04);
}

.product-card__add {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-card) var(--ease), transform var(--dur-card) var(--ease);
}

.product-card:hover .product-card__add,
.product-card:focus-within .product-card__add {
  opacity: 1;
  transform: none;
}

/* Uređaji bez miša (tablet): dugme je uvek vidljivo */
@media (hover: none) {
  .product-card__add {
    opacity: 1;
    transform: none;
  }
}

.product-card__add-button {
  width: 100%;
  height: 44px;
  font-size: var(--fs-small);
}

.product-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card__name {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.product-card__spec {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}

.product-card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.product-card__prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.product-card__price {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.product-card__old {
  font-size: var(--fs-small);
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 8px;
  }

  .product-card {
    gap: 12px;
  }

  .product-card .stage__badge {
    top: 8px;
    left: 8px;
    height: 20px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 10px;
  }

  .product-card .vial {
    width: 26%;
    height: 62%;
  }

  .product-card .vial__body {
    border-radius: 4px 4px 7px 7px;
  }

  .product-card__add {
    display: none;
  }

  .product-card__info {
    gap: 2px;
  }

  .product-card__name {
    font-size: var(--fs-small);
  }

  .product-card__spec {
    font-size: var(--fs-label);
  }

  .product-card__bottom {
    margin-top: 4px;
  }

  .product-card__prices {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0;
  }

  .product-card__price {
    font-size: 15px;
  }

  .product-card__old {
    font-size: var(--fs-label);
  }
}
