:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --header-h: 72px;
  --sidebar-w: 248px;
  --layout-max: 1320px;
  --page-pad: clamp(12px, 3vw, 24px);
  --touch-min: 44px;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

img,
video {
  max-width: 100%;
  height: auto;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--primary); }

/* Gornja traka — baner + valuta desno */
.site-top-bar {
  background: var(--announcement-bg, linear-gradient(90deg, #1e3a5f, var(--primary)));
  color: var(--announcement-text, #fff);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-top-bar-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 7px clamp(12px, 3vw, 24px);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.site-top-bar .announcement {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 0;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}

.site-top-bar .announcement:empty {
  display: none;
}

.site-top-bar .currency-switch {
  flex-shrink: 0;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.site-top-bar .currency-switch-btn {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 5px 11px;
}

.site-top-bar .currency-switch-btn + .currency-switch-btn {
  border-left-color: rgba(255, 255, 255, 0.25);
}

.site-top-bar .currency-switch-btn.active {
  background: #fff;
  color: var(--primary, #2563eb);
}

@media (min-width: 961px) {
  .site-top-bar-inner {
    position: relative;
    justify-content: flex-end;
  }

  .site-top-bar .announcement {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    flex: none;
    width: max-content;
    max-width: calc(100% - 130px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 960px) {
  .site-top-bar-inner {
    padding: 6px 12px;
    min-height: 32px;
    justify-content: space-between;
  }

  .site-top-bar .announcement {
    text-align: left;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-top-bar:not(:has(.announcement:not(:empty))) .site-top-bar-inner {
    justify-content: flex-end;
  }
}

/* Legacy — ako negde ostane samostalan baner */
.announcement {
  background: var(--announcement-bg, linear-gradient(90deg, #1e3a5f, var(--primary)));
  color: var(--announcement-text, #fff);
  text-align: center;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
}
.announcement:empty { display: none; }

/* Header — centriran sadržaj */
.header {
  background: var(--header-bg, var(--card));
  color: var(--header-text, var(--text));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.header--static {
  position: relative;
  top: auto;
}

.header--dark,
.header--brand {
  border-bottom-color: color-mix(in srgb, var(--header-bg) 85%, #000);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.header--dark .header-search input,
.header--brand .header-search input {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.header--dark .header-search input::placeholder,
.header--brand .header-search input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.header--dark .btn-ghost,
.header--brand .btn-ghost {
  color: var(--header-text, #fff);
}

.header--dark .btn-ghost:hover,
.header--brand .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}


.header-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 14px 24px;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(200px, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--header-text, var(--primary));
  text-decoration: none;
  letter-spacing: -0.02em;
  max-width: 100%;
  min-width: 0;
}

.logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-img {
  display: block;
  width: auto;
  max-width: min(200px, 100%);
  object-fit: contain;
}

.logo-tagline {
  display: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  line-height: 1.2;
  max-width: 140px;
}

@media (min-width: 900px) {
  .logo-tagline { display: block; }
}

.header-search {
  justify-self: center;
  width: 100%;
  max-width: 520px;
}

.header-search input {
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.currency-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #f8fafc);
  flex-shrink: 0;
}

.currency-switch-btn {
  border: none;
  background: transparent;
  color: var(--muted, #64748b);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s;
}

.currency-switch-btn + .currency-switch-btn {
  border-left: 1px solid var(--border, #e2e8f0);
}

.currency-switch-btn.active {
  background: var(--primary, #2563eb);
  color: #fff;
}

.currency-switch-btn:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -2px;
}

.btn-categories-mobile { display: none; }

#btn-favorites .fav-count-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

#btn-favorites .fav-count-badge[hidden] {
  display: none;
}

#btn-favorites.has-favs .fav-icon {
  color: #e11d48;
}

/* Buttons */
.btn {
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: #e2e8f0; }

.btn-icon-label { min-width: 44px; }

.btn-block { width: 100%; display: block; text-align: center; }

.btn-close {
  border: none;
  background: var(--bg);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.btn-close:hover { background: var(--border); color: var(--text); }

.btn-load-more {
  display: block;
  margin: 28px auto;
  background: var(--card);
  border: 2px solid var(--border);
  padding: 12px 28px;
}

.btn-load-more:hover { border-color: var(--primary); color: var(--primary); }

/* Layout: levo kategorije, desno proizvodi */
.shop-layout {
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: var(--page-pad) var(--page-pad) 40px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 24px;
  align-items: start;
}

.cat-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cat-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc, var(--card));
}

.cat-sidebar-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.cat-sidebar-head .btn-close { display: none; }

.cat-nav {
  padding: 10px 8px 14px;
  max-height: calc(100vh - var(--header-h) - 80px);
  overflow-y: auto;
}

.cat-nav-all {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
}

.cat-nav-all:hover,
.cat-nav-all.active {
  background: var(--primary);
  color: #fff;
}

.cat-group {
  margin-bottom: 4px;
}

.cat-group-title {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  border-radius: 6px;
}

.cat-group-title:hover,
.cat-group-title.active {
  background: var(--bg);
  color: var(--primary);
}

.cat-group-items {
  padding-left: 4px;
  margin-bottom: 6px;
}

.cat-nav-sub {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 12px 7px 20px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.84rem;
  font-family: inherit;
  color: var(--muted);
  position: relative;
}

.cat-nav-sub::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
  transform: translateY(-50%);
}

.cat-nav-sub:hover,
.cat-nav-sub.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.cat-nav-sub.active::before {
  background: var(--primary);
}

.shop-content {
  min-width: 0;
}

.main {
  padding: 0;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.results-meta {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
}

.sort-select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--card);
  cursor: pointer;
}

.loading {
  text-align: center;
  padding: 48px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: clamp(12px, 2.5vw, 18px);
}

.product-card-media {
  position: relative;
}

.product-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
  transition: transform 0.15s, color 0.15s, background 0.15s;
}

.product-fav-btn:hover {
  transform: scale(1.06);
  color: #e11d48;
}

.product-fav-btn.is-active {
  color: #e11d48;
  background: #fff;
}

.product-fav-btn--detail {
  position: static;
  flex-shrink: 0;
}

.product-detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.product-detail-title-row .product-detail-title {
  margin: 0;
  flex: 1;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  border-color: var(--primary-light);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e2e8f0;
}

.product-card .ph {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
  color: var(--muted);
  font-size: 2.5rem;
}

.product-card .body { padding: 16px; }

.product-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
}

.product-card .price {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.2rem;
}

.product-card .price-old {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 500;
}

/* Mobile: kategorije kao drawer */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 90;
}

.sidebar-overlay[hidden] {
  display: none !important;
  pointer-events: none;
}

@media (max-width: 960px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 12px;
  }

  .logo {
    grid-column: 1;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .btn-categories-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 9px 12px;
  }

  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    justify-self: stretch;
  }

  .shop-layout {
    grid-template-columns: 1fr;
    padding: var(--page-pad);
  }

  .cat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: 100;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    max-height: none;
  }

  .cat-sidebar.open {
    transform: translateX(0);
  }

  .cat-sidebar-head .btn-close {
    display: block;
  }

  .cat-nav {
    max-height: none;
    flex: 1;
  }
}

/* Modals */
[hidden] {
  display: none !important;
}

.modal {
  border: none;
  padding: 0;
  max-width: min(520px, 94vw);
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

.modal-inner { padding: 24px; }

/* Modal proizvoda */
#modal-product.modal {
  max-width: min(720px, 96vw);
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.modal-product-inner {
  padding: 0;
  position: relative;
}

.product-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  min-height: 280px;
}

.product-detail-media {
  background: linear-gradient(160deg, #f1f5f9 0%, #e2e8f0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 20px;
  min-height: 240px;
}

.product-detail-figure {
  margin: 0;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.product-detail-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.product-detail-ph {
  font-size: 3.5rem;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
}

.product-detail-body {
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.product-detail-meta {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-detail-title {
  margin: 0 0 16px;
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.product-detail-prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.product-detail-price-main {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.product-detail-price-compare {
  font-size: 0.88rem;
  color: var(--muted);
}

.product-detail-price-compare s {
  color: #94a3b8;
}

.product-detail-price-hint {
  font-size: 0.88rem;
  color: var(--muted);
}

.product-detail-price-badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d1fae5;
  color: #047857;
}

.product-detail-desc {
  margin-bottom: 16px;
}

.product-detail-desc p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.product-detail-field {
  display: block;
  margin-bottom: 16px;
}

.product-detail-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.product-detail-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--card);
}

.product-detail-cta {
  margin-top: auto;
  padding: 14px 20px;
  font-size: 1rem;
  width: 100%;
}

@media (max-width: 600px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
  .product-detail-media {
    min-height: 200px;
    padding: 20px 16px 12px;
  }
  .product-detail-body {
    padding: 20px 20px 24px;
  }
  .product-detail-close {
    top: 8px;
    right: 8px;
  }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-head h2 { margin: 0; font-size: 1.25rem; }

.modal-cart-dialog,
.modal-wishlist-dialog {
  max-width: min(640px, 96vw);
  width: min(640px, 96vw);
}

.modal-wishlist .wishlist-hint {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.wishlist-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
}

.wishlist-loading {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.wishlist-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: center;
}

.wishlist-item-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.wishlist-item-ph {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  border-radius: 10px;
  flex-shrink: 0;
  font-size: 1.5rem;
}

.wishlist-item-body {
  flex: 1;
  min-width: 0;
}

.wishlist-item-body h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  line-height: 1.3;
}

.wishlist-item-price {
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--primary);
}

.wishlist-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wishlist-item-actions .wishlist-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.wishlist-remove {
  margin-left: auto;
  color: var(--muted);
}

.modal-cart-dialog {
  max-width: min(640px, 96vw);
  width: min(640px, 96vw);
}

.cart-step { display: block; }
.cart-back {
  margin: 0 0 12px;
  padding: 6px 0;
  font-size: 0.88rem;
}

.checkout-quick-lead {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.checkout-quick-summary { margin-bottom: 16px; }
.quick-summary-card {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}
.quick-summary-card p { margin: 0 0 8px; }
.quick-summary-card p:last-child { margin-bottom: 0; }
.quick-summary-total {
  margin-top: 12px !important;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 1rem;
}
.quick-summary-note {
  font-size: 0.85rem;
  color: var(--muted);
}
.checkout-quick .btn-lg { margin-bottom: 10px; }
.field-hint-inline {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

@media (min-width: 641px) {
  .modal-cart .address-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .modal-cart .cart-items-list {
    max-height: min(40vh, 320px);
  }
}

@media (max-width: 640px) {
  .modal-cart-dialog {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
  }
  .modal-cart .modal-inner {
    max-height: 92vh;
    overflow-y: auto;
  }
}

.cart-summary-bar {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--primary-dark, #1e3a5f);
  background: var(--primary-light, #eff6ff);
  border: 1px solid color-mix(in srgb, var(--primary, #2563eb) 22%, var(--border, #e2e8f0));
}

.modal-cart .cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: min(50vh, 360px);
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.cart-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--muted);
}
.cart-empty-icon { font-size: 2.5rem; display: block; margin-bottom: 8px; opacity: 0.5; }
.cart-empty p { margin: 0 0 4px; font-weight: 600; color: var(--text); }

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }

.cart-item-media {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item-img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-ph { font-size: 1.5rem; opacity: 0.4; }

.cart-item-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}
.cart-item-variant {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.cart-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.cart-item-price {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}
.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}
.cart-qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
  line-height: 1;
}
.cart-qty-btn:hover { background: var(--primary-light); color: var(--primary); }
.cart-qty-val {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 4px;
}
.cart-item-remove {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}
.cart-item-remove:hover { background: #fee2e2; color: #b91c1c; }

.checkout-form-title {
  margin: 16px 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.address-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.address-form-grid .span-2 { grid-column: span 2; }
.address-form .field-label { margin-bottom: 0; }
.country-fixed-wrap { margin: 0; }
.country-fixed {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.country-flag { font-size: 1.25rem; line-height: 1; }
.modal-cart .checkout-form,
.modal-account .address-form {
  margin-top: 4px;
}
@media (max-width: 480px) {
  .address-form-grid { grid-template-columns: 1fr; }
  .address-form-grid .span-2 { grid-column: span 1; }
}

.modal-cart .cart-totals {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.modal-cart .cart-totals > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.modal-cart .total {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea,
.address-form input:not([type="hidden"]),
.address-form textarea,
#form-login input,
#form-register input,
#form-register textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}

.checkout-form input:focus,
.address-form input:focus,
.address-form textarea:focus,
#form-login input:focus,
#form-register input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tabs .tab {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-tabs .tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
}

.field-hint {
  margin: -6px 0 14px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Galerija slika proizvoda */
.product-gallery-main-wrap { margin: 0; }
.product-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 280px;
  width: 100%;
}
.product-gallery-thumb {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transition: border-color 0.15s, transform 0.15s;
}
.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-gallery-thumb:hover { transform: scale(1.04); }
.product-gallery-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* Prijava / registracija */
.modal-auth-dialog {
  max-width: min(440px, 96vw);
  width: calc(100% - 24px);
  box-sizing: border-box;
}
.modal-auth .auth-form,
.modal-auth .account-type-picker,
.modal-auth .account-type-option {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.modal-account-dialog { max-width: min(520px, 96vw); }

.modal-account .account-user-line {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.account-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.account-tabs .tab {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  padding: 10px 8px;
}
.account-tabs .tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.account-panel-hint {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}
.account-panel { margin-bottom: 8px; }
.account-empty,
.account-loading {
  text-align: center;
  padding: 24px 12px;
}
.account-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-account-active {
  background: var(--primary-light);
  color: var(--primary-dark, var(--primary));
}

.my-orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(55vh, 420px);
  overflow-y: auto;
}
.my-order-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--card);
}
.my-order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.my-order-head time {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}
.order-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.order-status-pill.status-new { background: #dbeafe; color: #1d4ed8; }
.order-status-pill.status-processing { background: #fef3c7; color: #b45309; }
.order-status-pill.status-done { background: #d1fae5; color: #047857; }
.order-status-pill.status-cancelled { background: #f1f5f9; color: #64748b; }
.my-order-items {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}
.my-order-items li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.my-order-items li:last-child { border-bottom: none; }
.my-order-addr {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.my-order-foot {
  font-size: 0.9rem;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
  font-size: 0.88rem;
  cursor: pointer;
}
.field-checkbox input { width: auto; margin: 0; accent-color: var(--primary); }
.checkout-save-label span { color: var(--text); }

#form-delivery-address textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}
.auth-lead {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.auth-hint { margin-top: 14px; }

.account-type-picker {
  margin: 0 0 16px;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.account-type-picker legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  padding: 0;
}
.account-type-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.account-type-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.account-type-option.is-selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.account-type-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 1px 0 0;
  padding: 0;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
}
.account-type-option input[type="radio"]:checked {
  border-color: var(--primary);
  background: radial-gradient(circle, var(--primary) 0 5px, #fff 5px 20px);
}
.account-type-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.account-type-option strong {
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.account-type-option small {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.btn-lg {
  padding: 14px 20px;
  font-size: 1rem;
  margin-top: 4px;
}
#form-login .field-label:last-of-type,
#form-register .field-label:last-of-type { margin-bottom: 4px; }

/* Slanje porudžbine */
.order-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.order-loading-overlay[hidden] {
  display: none !important;
}

.order-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(320px, 100%);
  padding: 28px 32px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  text-align: center;
}

.order-loading-box p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.order-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: order-spin 0.75s linear infinite;
}

@keyframes order-spin {
  to { transform: rotate(360deg); }
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

/* Notifikacije */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
}
.toast-show {
  opacity: 1;
  transform: translateX(0);
}
.toast-hide {
  opacity: 0;
  transform: translateX(16px);
}
.toast-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}
.toast-text { flex: 1; min-width: 0; word-break: break-word; }
.toast-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.toast-success .toast-icon {
  background: #10b981;
  color: #fff;
}
.toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.toast-error .toast-icon {
  background: #ef4444;
  color: #fff;
}
.toast-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.toast-info .toast-icon {
  background: #3b82f6;
  color: #fff;
}

#btn-cart.cart-pulse {
  animation: cart-pulse 0.7s ease;
}
@keyframes cart-pulse {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.12); }
  55% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.25); }
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 56px 24px;
  font-size: 1rem;
}

.admin-link { font-size: 0.85rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Početna — hero, sekcije */
.home-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.home-hero-tagline {
  margin: 0 0 8px;
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}

.home-hero-sub {
  margin: 0 0 20px;
  max-width: 52ch;
  opacity: 0.95;
  font-size: 1rem;
}

.home-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.home-hero-cta .btn-primary {
  background: #fff;
  color: var(--primary);
}

.home-hero-cta .btn-primary:hover { background: #f1f5f9; }

.home-hero-cta .btn-ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: transparent;
}

.home-hero-cta .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.home-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 0.88rem;
}

.home-benefits li::before {
  content: "✓ ";
  font-weight: 700;
}

.home-section { margin-bottom: 28px; }

.home-section-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 700;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.category-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.category-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

.product-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.how-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.how-step h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--primary);
}

.how-step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.guest-hint {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--primary-light);
  border-radius: 10px;
  font-size: 0.9rem;
  color: #1e40af;
}

.guest-hint--banner {
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  line-height: 1.45;
}

.guest-hint-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: underline;
  cursor: pointer;
}

.user-status-banner {
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  color: #92400e;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
}

.user-status-banner[hidden] {
  display: none !important;
}

.mobile-info-strip {
  display: block;
}

.product-stock-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.product-card--out {
  opacity: 0.82;
}

.product-card--out .price {
  color: var(--muted);
}

.btn-b2b-pending {
  box-shadow: inset 0 0 0 2px #fbbf24;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: 40px;
  padding: 40px 24px 24px;
}

.footer-inner {
  max-width: var(--layout-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px;
}

.footer-col strong,
.footer-col h3 {
  color: #f1f5f9;
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.footer-col p {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.footer-col a { color: #93c5fd; }

.footer-copy {
  max-width: var(--layout-max);
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid #334155;
  text-align: center;
  font-size: 0.8rem;
}

/* Mobilna donja traka */
.mobile-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0));
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}

.mobile-tabbar button {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.65rem;
  color: var(--muted);
  padding: 6px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mobile-tabbar button span {
  font-size: 1.2rem;
  line-height: 1;
}

.mobile-tabbar .tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
}

.mobile-tabbar .tab-link span {
  font-size: 1.2rem;
  line-height: 1;
}

.mobile-tabbar button.active,
.mobile-tabbar .tab-link.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

@media (max-width: 960px) {
  .mobile-tabbar { display: grid; }
}

@media (max-width: 640px) {
  :root { --header-h: 56px; }

  .header-inner { padding: 10px 14px; }
  .announcement { font-size: 0.8rem; padding: 8px 12px; }

  .product-grid,
  .product-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card .body { padding: 10px; }
  .product-card h3 { font-size: 0.8rem; }
  .product-card .price { font-size: 1.05rem; }
  .product-fav-btn { width: 34px; height: 34px; top: 8px; right: 8px; }

  #btn-favorites .fav-label { display: none; }
  .header-actions .btn { min-height: var(--touch-min); }
  #btn-auth {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-inline: 10px;
    font-size: 0.82rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .sort-select { width: 100%; }

  .home-hero { padding: 20px 18px; margin-bottom: 18px; }
  .home-hero-cta .btn { flex: 1; min-width: 120px; justify-content: center; }
  .category-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-steps { grid-template-columns: 1fr; }

  .site-footer { padding: 28px var(--page-pad) 20px; margin-top: 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }

  .guest-hint { font-size: 0.85rem; padding: 10px 12px; }

  .toast-stack {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0));
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .auth-form-row { grid-template-columns: 1fr; }

  .modal,
  #modal-product.modal,
  .modal-cart-dialog,
  .modal-wishlist-dialog,
  .modal-auth-dialog,
  .modal-account-dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    max-height: min(92dvh, 92vh);
    border-radius: 16px 16px 0 0;
  }

  .modal-inner {
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0));
    max-height: inherit;
    overflow-y: auto;
  }

  .modal-product-inner { padding: 0; }
  #modal-product.modal { border-radius: 16px 16px 0 0; }

  .wishlist-item {
    flex-wrap: wrap;
  }
  .wishlist-item-actions {
    width: 100%;
  }
  .wishlist-item-actions .wishlist-btn { flex: 1; }

  .cart-item {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
  }
  .cart-item-footer {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  .my-order-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .header-actions { gap: 4px; }
  .header-actions .btn-ghost { padding: 8px 10px; }
  .site-top-bar-inner { min-height: 30px; }
  .site-top-bar .currency-switch-btn { padding: 4px 8px; font-size: 0.66rem; }
  .logo { font-size: 1.1rem; }
  .account-type-picker {
    gap: 10px;
    margin-bottom: 14px;
  }
  .account-type-option {
    padding: 11px 12px;
    border-radius: 12px;
  }

  .product-grid,
  .product-grid-compact {
    grid-template-columns: 1fr;
  }

  .category-cards { grid-template-columns: 1fr; }
  .mobile-tabbar button { font-size: 0.58rem; }
}

@media (max-width: 380px) {
  .header-inner {
    gap: 8px;
  }
  #btn-auth { max-width: 5.5rem; }
}

/* Tablet landscape / uži laptop */
@media (min-width: 641px) and (max-width: 960px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* Veći ekrani — malo više kolona */
@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}

/* Sprečava horizontalni skrol na uskim uređajima */
@media (max-width: 960px) {
  body {
    overflow-x: clip;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
  }
}
