/* OnlinePet Storefront CSS */
/* Pet store theme with shop-configurable colors via CSS variables */

:root {
  --primary: var(--shop-primary, #2563eb);
  --primary-hover: color-mix(in srgb, var(--primary) 85%, black);
  --secondary: var(--shop-secondary, #1d4ed8);
  --accent: var(--shop-accent, #f59e0b);
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ─── Header (sticky topbar, Alza style) ──────────────── */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header__inner {
  display: flex; align-items: center;
  height: 68px; gap: 16px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}
.site-header__logo {
  font-size: 20px; font-weight: 800;
  color: var(--primary); text-decoration: none;
  flex-shrink: 0;
  display: flex; align-items: center;
}
.site-header__logo img { height: 52px; width: auto; }

.site-header__hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  color: var(--text);
  border-radius: 8px;
  padding: 0;
}
.site-header__hamburger:hover { background: var(--bg-alt); }

/* Header actions row */
.site-header__actions {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex-shrink: 0;
  height: 52px;
}

/* Doporučení na míru — premium CTA button (positioned at the very end) */
.site-header__reco {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  margin-left: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px -3px rgba(245, 158, 11, .4);
  transition: transform .15s, box-shadow .15s;
}
.site-header__reco:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -3px rgba(245, 158, 11, .45);
}
.site-header__reco svg { flex-shrink: 0; }

/* Icon actions (account / orders / favorites / notifications / cart) */
.site-header__icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 12px;
  min-width: 58px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  position: relative;
  transition: background .15s, color .15s;
}
.site-header__icon svg { flex-shrink: 0; }
.site-header__icon:hover {
  background: var(--bg-alt);
  color: var(--text);
  text-decoration: none;
}
.site-header__icon-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1;
  white-space: nowrap;
}
.site-header__icon:hover .site-header__icon-label { color: var(--text-muted); }
.site-header__cart .site-header__cart-count {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .12);
}
.site-header__cart {
  color: var(--primary);
}

/* Legacy nav classes kept for mobile nav partial compatibility */
.site-header__nav { display: none; }
.nav-item { position: relative; }
.nav-dropdown { display: none; }

/* ─── Search box + live dropdown ────────────────────── */
/* Search is centered with auto margins so the space on left (after logo)
   and right (before actions) is distributed equally. */
.site-header__search {
  position: relative;
  flex: 0 1 420px;
  min-width: 180px;
  margin-left: auto;
  margin-right: auto;
}
.site-header__search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.site-header__search-input {
  padding: 11px 16px 11px 40px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  width: 100%;
  font-family: var(--font);
  background: var(--bg-alt, #f8fafc);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.site-header__search-input:hover {
  background: #fff;
  border-color: #cbd5e1;
}
.site-header__search-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px -8px rgba(15, 23, 42, .22);
  overflow: hidden;
  z-index: 120;
  max-height: 70vh;
  display: flex; flex-direction: column;
}
.search-dropdown[hidden] { display: none !important; }
.search-dropdown__results { overflow-y: auto; max-height: 70vh; }
.search-dropdown__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.search-dropdown__item:last-child { border-bottom: none; }
.search-dropdown__item:hover,
.search-dropdown__item.is-active { background: var(--bg-alt); text-decoration: none; }
.search-dropdown__img { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 6px; flex-shrink: 0; border: 1px solid #ebeef2; padding: 3px; }
.search-dropdown__name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-dropdown__price { font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.search-dropdown__empty { padding: 24px 14px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* ═══════════════════════════════════════════════════════
   Top root-categories quick bar (under header)
   ═══════════════════════════════════════════════════════ */
.top-cats {
  background: #fff;
  box-shadow: 0 2px 8px -3px rgba(15, 23, 42, .1);
  position: sticky;
  top: 68px;
  z-index: 90;
}
.top-cats__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: visible;
}
.top-cats__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.top-cats__item:hover {
  color: var(--primary);
  background: var(--bg-alt, #f8fafc);
  text-decoration: none;
}
.top-cats__item--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.top-cats__icon {
  width: 20px; height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.top-cats__item svg { flex-shrink: 0; }
.top-cats__count {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  background: var(--bg-alt, #f1f5f9);
  color: var(--text-light, #94a3b8);
  border-radius: 10px;
  line-height: 1;
}
.top-cats__item:hover .top-cats__count,
.top-cats__item--active .top-cats__count {
  background: rgba(37, 99, 235, .1);
  color: var(--primary);
}

/* Hover dropdown */
.top-cats__group { position: relative; flex-shrink: 0; }

.top-cats__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 10px 28px -6px rgba(15,23,42,.12);
  padding: 4px 0;
  z-index: 200;
  flex-direction: column;
}
.top-cats__group:hover > .top-cats__dropdown { display: flex; }
.top-cats__group:hover > .top-cats__item {
  color: var(--primary);
  background: var(--bg-alt, #f8fafc);
  border-bottom-color: var(--primary);
}

.top-cats__dropdown-group { position: relative; }

.top-cats__dropdown-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 500; color: var(--text);
  text-decoration: none; white-space: nowrap;
  transition: background .1s, color .1s;
}
.top-cats__dropdown-item:hover { background: var(--bg-alt, #f8fafc); color: var(--primary); }
.top-cats__dropdown-item--active { color: var(--primary); font-weight: 700; }
.top-cats__dropdown-item svg { color: var(--text-light); flex-shrink: 0; }
.top-cats__dropdown-item:hover svg { color: var(--primary); }

/* Nested dropdown — opens to the right on hover */
.top-cats__dropdown--nested {
  display: none;
  position: absolute;
  left: 100%;
  top: -1px;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 2px solid var(--primary);
  border-radius: 0 10px 10px 0;
  box-shadow: 0 10px 28px -6px rgba(15,23,42,.12);
  padding: 4px 0;
  z-index: 201;
  flex-direction: column;
}
.top-cats__dropdown-group:hover > .top-cats__dropdown--nested { display: flex; }

/* ═══════════════════════════════════════════════════════
   Site shell: left category sidebar + main content
   ═══════════════════════════════════════════════════════ */
.site-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  min-height: 400px;
}
.site-shell--no-sidebar { grid-template-columns: 1fr; max-width: 1440px; }
.site-shell > .main { min-width: 0; padding: 24px 0 40px; }

/* Left sidebar (categories) — positioned top-left, not sticky */
.cat-sidebar-left {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 0;
  margin-top: 20px;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .05);
  align-self: start;
}
.cat-sidebar-left__nav {
  display: flex; flex-direction: column;
}
.cat-sidebar-left__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.cat-sidebar-left__item:hover {
  background: var(--bg-alt);
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none;
}
.cat-sidebar-left__item.is-active {
  background: rgba(37, 99, 235, .06);
  color: var(--primary);
  border-left-color: var(--primary);
}
.cat-sidebar-left__icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cat-sidebar-left__icon img {
  width: 24px; height: 24px; object-fit: contain;
}
.cat-sidebar-left__item:hover .cat-sidebar-left__icon { color: var(--primary); }
.cat-sidebar-left__label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-sidebar-left__arrow {
  color: var(--text-light);
  flex-shrink: 0;
  opacity: .6;
}
.cat-sidebar-left__item:hover .cat-sidebar-left__arrow { opacity: 1; color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   Multi-level mega menu (Alza-style)
   3 columns: L1 list | L2 list | products grid
   ═══════════════════════════════════════════════════════ */
.cat-megamenu {
  position: absolute;
  top: 20px;
  left: 284px; /* 260 sidebar + 24 gap */
  right: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px -12px rgba(15, 23, 42, .22);
  z-index: 90;
  min-height: 440px;
  pointer-events: auto;
  display: grid;
  grid-template-columns: 240px 240px 1fr;
  overflow: hidden;
}
.cat-megamenu[hidden] { display: none !important; }

.cat-megamenu__col {
  padding: 20px 18px;
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow-y: auto;
  max-height: 560px;
}
.cat-megamenu__col:last-child { border-right: none; }
.cat-megamenu__col--l2[hidden] { display: none; }
.cat-megamenu__col--l2[hidden] + .cat-megamenu__col--products {
  /* Expand products col when L2 is not shown */
  /* CSS adjacent sibling gets auto-expanded via grid-column span */
}
.cat-megamenu:has(.cat-megamenu__col--l2[hidden]) {
  grid-template-columns: 240px 1fr;
}
.cat-megamenu:has(.cat-megamenu__col--l2[hidden]) .cat-megamenu__col--l2 { display: none; }

.cat-megamenu__col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.cat-megamenu__col-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.cat-megamenu__col-all {
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}
.cat-megamenu__col-all:hover { text-decoration: underline; }

.cat-megamenu__list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cat-megamenu__list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: background .1s, color .1s;
}
.cat-megamenu__list-item:hover,
.cat-megamenu__list-item.is-active {
  background: var(--bg-alt);
  color: var(--primary);
  text-decoration: none;
}
.cat-megamenu__list-item.is-active { font-weight: 600; }
.cat-megamenu__list-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-megamenu__list-count {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  padding: 1px 7px;
  background: #f1f5f9;
  border-radius: 999px;
}
.cat-megamenu__list-arrow {
  color: var(--text-light);
  opacity: .6;
  flex-shrink: 0;
}
.cat-megamenu__list-item:hover .cat-megamenu__list-arrow,
.cat-megamenu__list-item.is-active .cat-megamenu__list-arrow {
  opacity: 1;
  color: var(--primary);
}
.cat-megamenu__empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 10px;
  text-align: center;
}
.cat-megamenu__empty-products {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

/* Products grid inside the 3rd col */
.cat-megamenu__col--products {
  padding: 20px 24px;
}
.cat-megamenu__products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.cat-megamenu__product {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  transition: transform .12s;
}
.cat-megamenu__product:hover {
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--primary);
}
.cat-megamenu__product-img {
  aspect-ratio: 1;
  background: var(--bg-alt);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-megamenu__product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}
.cat-megamenu__product-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}
.cat-megamenu__product-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
}
.cat-megamenu__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.cat-megamenu__cta:hover { text-decoration: underline; }

/* Hide mega menu when sidebar is hidden */
.site-shell--no-sidebar .cat-megamenu { display: none !important; }

/* ─── Mobile slide-in nav ───────────────────────────── */
.mobile-nav {
  position: fixed; top: 0; right: 0;
  width: min(340px, 85vw);
  height: 100vh;
  background: #fff;
  z-index: 9998;
  transform: translateX(100%);
  transition: transform .28s ease;
  box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column;
}
.mobile-nav[hidden] { display: none !important; }
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mobile-nav__title { font-size: 17px; font-weight: 800; color: var(--text); }
.mobile-nav__close {
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1;
  color: var(--text-muted);
  border-radius: 8px;
}
.mobile-nav__close:hover { background: var(--bg-alt); color: var(--text); }

.mobile-nav__body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.mobile-nav__search { padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mobile-nav__search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
}
.mobile-nav__search-input:focus { outline: none; border-color: var(--primary); }

.mobile-nav__links { flex: 1; padding: 8px 0; }
.mobile-nav__group { border-bottom: 1px solid #f1f5f9; }
.mobile-nav__parent {
  display: flex; align-items: center;
  padding-right: 6px;
}
.mobile-nav__link {
  flex: 1;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.mobile-nav__link:hover { color: var(--primary); text-decoration: none; }
.mobile-nav__toggle {
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  border-radius: 8px;
  transition: transform .2s;
}
.mobile-nav__toggle:hover { background: var(--bg-alt); }
.mobile-nav__group.is-expanded .mobile-nav__toggle { transform: rotate(180deg); }

.mobile-nav__children {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  background: var(--bg-alt);
}
.mobile-nav__group.is-expanded .mobile-nav__children { max-height: 1000px; }
.mobile-nav__child {
  display: block;
  padding: 11px 32px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-top: 1px solid #e8edf2;
}
.mobile-nav__child:hover { color: var(--primary); text-decoration: none; }

.mobile-nav__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
  flex-shrink: 0;
}
.mobile-nav__action {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px;
  background: var(--bg-alt);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.mobile-nav__action:hover { background: #e2e8f0; text-decoration: none; }

.mobile-nav__backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 9997;
  opacity: 0;
  transition: opacity .28s;
}
.mobile-nav__backdrop[hidden] { display: none !important; }
.mobile-nav__backdrop.is-open { opacity: 1; }

body.nav-open { overflow: hidden; }

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; padding: 80px 0; text-align: center;
}
.hero__title { font-size: 40px; font-weight: 800; margin-bottom: 12px; }
.hero__subtitle { font-size: 18px; opacity: .9; margin-bottom: 24px; }

/* ─── Sections ──────────────────────────────────────────── */
.section { padding: 48px 0; }
.section__title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.section__desc { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: all .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-secondary { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.input {
  display: block; width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 14px; font-family: var(--font);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input--sm { padding: 6px 10px; width: auto; }

/* ─── Category Grid ────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.category-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px; background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-lg); text-decoration: none; color: var(--text); transition: all .15s;
}
.category-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); text-decoration: none; }
.category-card__image { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }
.category-card__name { font-weight: 600; font-size: 15px; }
.category-card__count { font-size: 13px; color: var(--text-muted); }

/* ─── Product Grid ─────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
  align-items: stretch;
}
.product-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow .15s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-md); }
.product-card__image-link { display: block; position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-alt); flex-shrink: 0; }
.product-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform .3s, opacity .3s; }
.product-card__image--secondary { position: absolute; inset: 0; opacity: 0; }
.product-card--has-swap:hover .product-card__image--primary { opacity: 0; }
.product-card--has-swap:hover .product-card__image--secondary { opacity: 1; }
.product-card:hover .product-card__image { transform: scale(1.03); }
.product-card__cart-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: auto; padding: 8px; background: var(--shop-primary, #2563eb); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; }
.product-card__cart-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.product-card__cart-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.product-card__tags { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.product-card__body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.product-card__name { display: block; font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; margin-bottom: 6px; }
.product-card__name:hover { color: var(--primary); text-decoration: none; }
.product-card__price { display: flex; align-items: center; gap: 8px; }
.product-card__price-current { font-size: 18px; font-weight: 700; color: var(--text); }
.product-card__price-old { font-size: 14px; color: var(--text-light); text-decoration: line-through; }

/* ─── Badge ────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ─── Product Detail ───────────────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.product-detail__main-image img { width: 100%; border-radius: var(--radius-lg); }
.product-detail__thumbs { display: flex; gap: 8px; margin-top: 12px; }
.product-detail__thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius); border: 2px solid transparent; cursor: pointer; }
.product-detail__thumb--active { border-color: var(--primary); }
.product-detail__tags { display: flex; gap: 6px; margin-bottom: 8px; }
.product-detail__name { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.product-detail__rating { display: flex; align-items: center; gap: 2px; margin-bottom: 12px; }
.star { color: #d4d4d8; font-size: 18px; }
.star--filled { color: var(--accent); }
.product-detail__review-count { font-size: 13px; color: var(--text-muted); margin-left: 4px; }
.product-detail__price { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.product-detail__price-current { font-size: 32px; font-weight: 800; color: var(--text); }
.product-detail__price-old { font-size: 18px; color: var(--text-light); text-decoration: line-through; }
.product-detail__short-desc { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.product-detail__variants { margin-bottom: 20px; }
.product-detail__actions { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.quantity-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.quantity-control button { width: 36px; height: 36px; border: none; background: var(--bg-alt); cursor: pointer; font-size: 18px; }
.quantity-control input { width: 48px; height: 36px; border: none; text-align: center; font-size: 14px; -moz-appearance: textfield; }
.quantity-control input::-webkit-inner-spin-button { -webkit-appearance: none; }
.product-detail__sku { font-size: 13px; color: var(--text-light); }
.product-detail__categories { display: flex; gap: 8px; margin-top: 12px; }
.product-detail__category-link { font-size: 13px; padding: 2px 10px; background: var(--bg-alt); border-radius: 12px; color: var(--text-muted); }
.product-detail__description { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.product-detail__description h2 { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.prose { font-size: 15px; line-height: 1.7; color: var(--text); }
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin-bottom: 12px; padding-left: 24px; }

/* ─── Filter bar ───────────────────────────────────────── */
.filter-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.filter-bar__count { font-size: 14px; color: var(--text-muted); }

/* ─── Pagination ───────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; text-decoration: none; color: var(--text-muted); }
.pagination a:hover { background: var(--bg-alt); text-decoration: none; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Footer ───────────────────────────────────────────── */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 64px; }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.site-footer__col { display: flex; flex-direction: column; gap: 6px; }
.site-footer__heading { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.site-footer__text { font-size: 13px; color: var(--text-muted); }
.site-footer__link { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.site-footer__link:hover { color: var(--primary); }
.site-footer__bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-light); }
.site-footer__bottom a { color: var(--primary); }

/* ─── Form Label ───────────────────────────────────────── */
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }

/* ═══════════════════════════════════════════════════════
   Premium Product Card (pcard)
   ═══════════════════════════════════════════════════════ */
.pcard {
  display: flex; flex-direction: column;
  background: #fff;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  transition: box-shadow .35s ease, transform .35s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.pcard:hover {
  box-shadow: 0 20px 48px -12px rgba(0,0,0,.14);
  transform: translateY(-6px);
}

/* Media area */
.pcard__media {
  display: block;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f7f6;
  text-decoration: none;
}
.pcard__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.02) 100%);
  opacity: 0; transition: opacity .35s;
  pointer-events: none;
}
.pcard:hover .pcard__media::after { opacity: 1; }
.pcard__img {
  width: 100%; height: 100%; object-fit: contain; padding: 8px;
  transition: transform .5s cubic-bezier(.22,1,.36,1), filter .4s;
}
.pcard:hover .pcard__img { transform: scale(1.1); }

.pcard__badges {
  position: absolute; top: 14px; left: 14px;
  display: flex; gap: 6px; flex-wrap: wrap;
  pointer-events: none;
  max-width: calc(100% - 28px);
}
.pcard__badge {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .3px;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(6px);
  color: #475569;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08), 0 0 0 1px rgba(15, 23, 42, .04);
  pointer-events: auto;
}
.pcard__badge--sale {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(239, 68, 68, .45);
}

.pcard__variants-info {
  position: absolute; bottom: 10px; right: 10px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, .75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px; font-weight: 600;
  border-radius: 999px;
}

.pcard__soldout {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.pcard__soldout span {
  background: #fff;
  color: #0f172a;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, .4);
}

/* Favorite (heart) button — top-right overlay on pcard__media */
.pcard__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, .15);
  transition: transform .15s, color .15s, background .15s, box-shadow .15s;
  padding: 0;
}
.pcard__fav:hover {
  transform: scale(1.08);
  color: #e11d48;
  background: #fff;
  box-shadow: 0 4px 12px -2px rgba(225, 29, 72, .25);
}
.pcard__fav--on {
  color: #e11d48;
  background: #fff;
}
.pcard__fav--on:hover {
  color: #be123c;
}
.pcard__fav svg { display: block; }

/* Body — dynamic-slot layout with generous spacing */
.pcard__body {
  padding: 20px 20px 22px;
  display: flex; flex-direction: column;
  flex: 1;
}

.pcard__brand {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--primary);
  height: 14px;
  line-height: 14px;
  margin-bottom: 8px;
}
.product-grid[data-show-brand="0"] .pcard__brand { display: none; }

.pcard__title {
  font-size: 16px; font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: var(--pcard-title-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: calc(var(--pcard-title-lines, 2) * 1.3em);
  margin-bottom: 2px;
  letter-spacing: -.1px;
}
.pcard__title:hover { color: var(--primary); text-decoration: none; }

.pcard__rating {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  min-height: 14px;
  line-height: 1;
  margin-bottom: 2px;
}
.product-grid[data-show-rating="0"] .pcard__rating { display: none; }
.pcard__stars { display: flex; gap: 1px; }
.pcard__stars svg { width: 12px; height: 12px; }
.pcard__rating-score {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
}
.pcard__rating-count {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Description: fixed slot with ellipsis truncation */
.pcard__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: var(--pcard-desc-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  height: calc(var(--pcard-desc-lines, 2) * 1.5em);
  margin: 2px 0 12px;
}
.pcard__desc:empty::before { content: ''; display: inline-block; }
.product-grid[data-show-desc="0"] .pcard__desc { display: none; }

/* Variant pills - in-card switcher */
.pcard__pills {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
  min-height: 28px;
}
.product-grid[data-show-pills="0"] .pcard__pills { display: none; }
.pcard__pills--empty { min-height: 0; margin-bottom: 0; }
.pcard__pill {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  background: #fff;
  border: 1.5px solid #e5eaf0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  letter-spacing: .1px;
}
.pcard__pill:not(.pcard__pill--active):hover {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  color: var(--text);
  transform: translateY(-1px);
}
.pcard__pill--active,
.pcard__pill--active:hover {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 6px 14px -3px rgba(15, 23, 42, .35);
}
.pcard__pill--active:hover { transform: translateY(-1px); }

.pcard__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Attrs: slot height driven by grid (--pcard-attrs-count) */
.pcard__attrs {
  list-style: none;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f8fafc, #f0f7f2);
  border-radius: 10px;
  display: flex; flex-direction: column;
  gap: 4px;
  min-height: calc(var(--pcard-attrs-count, 0) * 16px + (var(--pcard-attrs-count, 0) - 1) * 4px + 16px);
}
.pcard__attrs:empty { padding: 0; background: none; min-height: calc(var(--pcard-attrs-count, 0) * 16px + (var(--pcard-attrs-count, 0) - 1) * 4px + 16px); }
.product-grid[data-show-attrs="0"] .pcard__attrs { display: none; }
.pcard__attrs li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px;
  font-size: 11px;
  line-height: 16px;
  height: 16px;
}
.pcard__attr-name {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcard__attr-val {
  color: var(--text);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.pcard__meta {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  margin-top: auto;
  padding-top: 10px;
  min-height: 22px;
}
.product-grid[data-show-shipping="0"] .pcard__shipping { display: none; }

.pcard__stock {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700;
  font-size: 12px;
}
.pcard__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .15);
}
.pcard__stock--ok  { color: #16a34a; }
.pcard__stock--ok .pcard__dot { box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.pcard__stock--low { color: #d97706; }
.pcard__stock--low .pcard__dot { box-shadow: 0 0 0 3px rgba(217, 119, 6, .15); }
.pcard__stock--out { color: #dc2626; }
.pcard__stock--out .pcard__dot { box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }

.pcard__shipping {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  display: inline-flex; align-items: center; gap: 5px;
}
.pcard__shipping::before {
  content: '';
  width: 14px; height: 10px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='1' y='2' width='14' height='12' rx='1'/><path d='M15 6h4l3 4v4h-7V6z'/><circle cx='5' cy='15' r='2'/><circle cx='17' cy='15' r='2'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Footer: 2-col grid so price + button sit on the SAME row (row 2),
   old-price lives alone in row 1. Button and price are both grid items
   with align-self: center → perfect vertical alignment */
.pcard__footer {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
}

/* Price-block wrapper exists in DOM but is transparent to layout */
.pcard__price-block { display: contents; }

/* Row 1: old price + save pct pill (kept even when hidden to preserve height) */
.pcard__old-row {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  height: 17px;
  margin-bottom: 4px;
}
.pcard__price-old {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(148, 163, 184, .7);
  font-weight: 500;
  line-height: 1;
}
.pcard__save-pct {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}
.pcard__price {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.6px;
  line-height: 1;
  transition: color .2s;
}

/* ── On sale: new price turns red ─────────────────────── */
.pcard--has-sale .pcard__price {
  color: #dc2626;
}
.pcard--has-sale .pcard__price-old {
  color: #94a3b8;
}

.pcard__btn {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s ease;
  letter-spacing: .1px;
}
.pcard__btn:hover { text-decoration: none; transform: translateY(-2px); }
.pcard__btn:active { transform: translateY(0); }
.pcard__btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.pcard__btn--cart {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(22, 163, 74, .45);
}
.pcard__btn--cart:hover { box-shadow: 0 10px 22px -4px rgba(22, 163, 74, .55); }
.pcard__btn--variants {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(15, 23, 42, .35);
}
.pcard__btn--variants:hover { box-shadow: 0 10px 22px -4px rgba(15, 23, 42, .45); }

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-header__search-input { width: 180px; }
  .site-header__search-input:focus { width: 220px; }
  .site-shell { grid-template-columns: 220px 1fr; gap: 16px; }
  .cat-megamenu { left: 244px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .pd-grid, .product-detail { gap: 28px; }
  .site-header__icon-label,
  .site-header__reco span { display: none; }
  .site-header__reco { padding: 9px 10px; }
  .site-header__icon { min-width: 44px; padding: 0 8px; }
}

/* Sidebar becomes a slide-in panel under 900px */
@media (max-width: 900px) {
  .site-shell { grid-template-columns: 1fr; padding: 0 16px; gap: 0; }
  .site-shell > .main { padding: 16px 0 32px; }
  .cat-sidebar-left {
    position: fixed;
    top: 0; left: 0;
    width: min(320px, 88vw);
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border-right: 1px solid var(--border);
    border-top: none;
    border-bottom: none;
    border-left: none;
    overflow-y: auto;
    padding-top: 16px;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform .28s ease;
    box-shadow: 12px 0 40px rgba(15, 23, 42, .18);
  }
  .cat-sidebar-left.is-open { transform: translateX(0); }
  .cat-megamenu { display: none !important; }
  .cat-sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 9998;
    opacity: 0;
    transition: opacity .28s;
  }
  .cat-sidebar-backdrop.is-open { opacity: 1; }
  .cat-sidebar-backdrop[hidden] { display: none !important; }
  body.nav-open { overflow: hidden; }
  .site-header__hamburger { display: inline-flex; }
}

/* ═══ Mobile-only components (hidden on desktop) ═══ */
.site-header__mobile-actions { display: none; }
.mobile-bottom-bar { display: none; }
.mobile-cat-modal { display: none; position: fixed; inset: 0; z-index: 10001; }
.mobile-cat-modal.is-open { display: flex; align-items: flex-end; }
.mobile-cat-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.mobile-cat-modal__panel {
  position: relative; z-index: 1; width: 100%; background: #fff;
  border-radius: 20px 20px 0 0; max-height: 70vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .3s ease;
}
.mobile-cat-modal.is-open .mobile-cat-modal__panel { transform: translateY(0); }
.mobile-cat-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.mobile-cat-modal__header h3 { font-size: 18px; font-weight: 800; margin: 0; }
.mobile-cat-modal__header button {
  width: 36px; height: 36px; border: none; background: #f1f5f9;
  border-radius: 50%; font-size: 20px; cursor: pointer; color: #64748b;
  display: flex; align-items: center; justify-content: center;
}
.mobile-cat-modal__list { padding: 8px 0; }
.mobile-cat-modal__item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; text-decoration: none; color: #1e293b;
  font-size: 15px; font-weight: 600; border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
}
.mobile-cat-modal__item:active { background: #f8fafc; }
.mobile-cat-modal__icon { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; flex-shrink: 0; }
.mobile-cat-modal__item svg { margin-left: auto; flex-shrink: 0; }

.mobile-search-modal {
  display: none; position: fixed; inset: 0; z-index: 10000; background: #fff;
  animation: mobileSearchIn .2s ease;
}
@keyframes mobileSearchIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-search-modal.is-open { display: flex; flex-direction: column; }
.mobile-search-modal__inner { display: flex; flex-direction: column; height: 100%; }
.mobile-search-modal__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid #e2e8f0;
  background: #fff; flex-shrink: 0;
}
.mobile-search-modal__input {
  flex: 1; border: none; outline: none; font-size: 16px; font-family: inherit;
  background: transparent; color: #1e293b;
}
.mobile-search-modal__close {
  width: 36px; height: 36px; border: none; background: #f1f5f9;
  border-radius: 50%; font-size: 20px; cursor: pointer; color: #64748b;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mobile-search-modal__results { flex: 1; overflow-y: auto; }

@media (max-width: 768px) {
  /* Prevent horizontal scroll globally */
  html, body { overflow-x: hidden; max-width: 100vw; }
  .main { overflow-x: hidden; }

  /* ═══ CONSISTENT SIDE PADDING — force 8px from edges everywhere ═══ */
  .home-wrap,
  .cat-wrap,
  .pd-wrap,
  .prof-wrap,
  .crv-wrap,
  .reco-wrap { padding-left: 8px !important; padding-right: 8px !important; }

  /* ═══ MOBILE HEADER: Logo left, action icons right ═══ */
  .site-header { border-bottom: 1px solid #f1f5f9; }
  .site-header__inner { gap: 6px; height: 48px; padding: 0 8px; }
  .site-header__hamburger { display: none; }
  .site-header__search { display: none; }
  .site-header__actions { display: none !important; }
  .site-header__reco { display: none; }
  .site-header__logo { flex: 1; }
  .site-header__logo img { height: 26px; }
  .site-header__logo strong { font-size: 15px; }

  /* Mobile top-right icons */
  .site-header__mobile-actions {
    display: flex; align-items: center; gap: 2px;
  }
  .site-header__mobile-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: none; background: transparent;
    border-radius: 10px; color: var(--text); cursor: pointer;
    text-decoration: none; font-family: inherit;
  }
  .site-header__mobile-btn:hover { background: var(--bg-alt, #f1f5f9); }
  .site-header__mobile-btn:active { background: #e2e8f0; }
  .site-header__mobile-btn svg { width: 20px; height: 20px; }

  /* ═══ MOBILE BOTTOM BAR ═══ */
  .mobile-bottom-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 9998;
    background: #fff; border-top: 1px solid #e2e8f0;
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
  .mobile-bottom-bar__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 6px 2px 4px; font-size: 9px; font-weight: 600; color: #94a3b8;
    text-decoration: none; position: relative; font-family: inherit;
    transition: color .15s; border: none; background: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: .2px;
  }
  .mobile-bottom-bar__item--active { color: var(--primary, #2563eb); }
  .mobile-bottom-bar__item--active svg { stroke-width: 2.5; }
  .mobile-bottom-bar__item svg { width: 20px; height: 20px; }
  .mobile-bottom-bar__badge {
    position: absolute; top: 0; right: calc(50% - 20px);
    min-width: 16px; height: 16px; padding: 0 4px;
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
  }

  /* Body padding for bottom bar */
  body { padding-bottom: 60px; }
  body[data-hide-bottombar="1"] { padding-bottom: 0; }

  /* Top categories bar — hide on mobile (accessible via Katalog in bottom bar) */
  .top-cats { display: none; }

  /* ═══ CONSISTENT PADDING — 8px from edges EVERYWHERE ═══ */
  .container { padding: 0 8px !important; }
  .site-shell { padding: 0 8px !important; }
  .site-header__inner { padding-left: 8px !important; padding-right: 8px !important; }
  /* Override any inline style="padding:Xpx 20px" on ALL containers */
  .container[style] { padding-left: 8px !important; padding-right: 8px !important; }

  /* Hero */
  .hero { padding: 48px 0; }
  .hero__title { font-size: 28px; }
  .hero__subtitle { font-size: 15px; }

  /* Sections */
  .section { padding: 32px 0; }
  .section__title { font-size: 20px; }

  /* Product detail — single column */
  .product-detail, .pd-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .pd-info { padding: 0; }
  /* Tabs — vertical stack on mobile */
  .pd-tabs-nav {
    flex-direction: column;
    gap: 0;
    border-bottom: none;
  }
  .pd-tab-btn {
    width: 100%;
    text-align: left;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 14px 16px;
    font-size: 14px;
  }
  .pd-tab-btn:first-child { border-radius: 10px 10px 0 0; }
  .pd-tab-btn:last-child { border-radius: 0 0 10px 10px; border-bottom: none; }
  .pd-variant-row { flex-wrap: wrap; gap: 10px; }
  .pd-info-strip { grid-template-columns: 1fr; gap: 8px; }
  .pd-info-strip__item { flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px; }
  .pd-meta-table th { width: 100px; font-size: 12px; }
  .pd-meta-table td { font-size: 13px; }

  /* Product detail — actions: qty full width, cart below, fav below */
  /* Product detail actions — handled in product_detail.php at 968px */

  /* Cart — stacked layout */
  .cart-layout, .cart-grid { grid-template-columns: 1fr !important; }
  .cart-sidebar { order: 2; position: static; }

  /* Product grid — 2 columns on tablet */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .pcard { border-radius: 16px; }
  .pcard__body { padding: 14px 14px 16px; }
  .pcard__title { font-size: 14px; height: 38px; }
  .pcard__desc { font-size: 12px; }
  .pcard__price { font-size: 20px; }
  .pcard__btn { padding: 10px 12px; font-size: 13px; min-height: 44px; }
  .pcard__img { padding: 6px; }

  /* Category grid */
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }

  /* Dashboard tiles */
  .acc-stats, .dashboard-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }

  /* Profile cards */
  .prof-card { padding: 22px 20px; }
  .prof-card [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer — centered on mobile */
  .site-footer { padding: 32px 0 16px; margin-top: 40px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; text-align: center; }
  .site-footer__col { display: flex; flex-direction: column; align-items: center; }
  .site-footer__heading { font-size: 14px; }
  .site-footer__link { display: block; }
  .site-footer__text { max-width: 320px; }
  .site-footer__bottom { font-size: 12px; padding-top: 16px; text-align: center; }

  /* Shipping progress bar — centered on mobile */
  #shipping-bar-wrap .container {
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center;
    gap: 8px !important;
    font-size: 12px !important;
  }
  #shipping-bar-wrap .container > div { justify-content: center; }
  #shipping-bar-wrap .container > div[style*="flex:1"] { width: 100%; min-width: 0 !important; }

  /* Touch targets — minimum 44px */
  .btn { padding: 11px 20px; min-height: 44px; }
  .btn-sm { padding: 8px 14px; min-height: 36px; }
  .pagination a, .pagination span { padding: 10px 14px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

  /* Inputs — 16px prevents iOS zoom on focus */
  .input, input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
    font-size: 16px !important;
  }

  /* ═══ PRODUCT CARD — polish for mobile ═══ */
  .pcard__pills { gap: 4px; margin: 4px 0 8px; }
  .pcard__pill { padding: 5px 10px; font-size: 11px; }
  .pcard__attrs { padding: 6px 10px; gap: 3px; font-size: 10px; }
  .pcard__attrs li { gap: 4px; }

  /* ═══ SEARCH DROPDOWN — limit height on mobile ═══ */
  .search-dropdown { max-height: 50vh !important; }
  .search-dropdown__results { max-height: 320px; }

  /* ═══ PRODUCT DETAIL — gallery thumbs scroll ═══ */
  .pd-thumbs, .pd-gallery__thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .pd-thumbs::-webkit-scrollbar, .pd-gallery__thumbs::-webkit-scrollbar { display: none; }
  .pd-thumb, .pd-gallery__thumb { flex-shrink: 0; }

  /* ═══ PRODUCT DETAIL — qty touch targets ═══ */
  .pd-qty__btn { min-width: 48px; min-height: 48px; font-size: 20px; }
  .pd-qty__input { min-height: 48px; }

  /* ═══ PRODUCT DETAIL — reviews responsive ═══ */
  .pd-review { padding: 16px 0; }
  .pd-review__header { flex-wrap: wrap; gap: 6px; }
  .pd-review__avatar { width: 36px; height: 36px; flex-shrink: 0; }
  .pd-review__name { font-size: 13px; }
  .pd-review__date { font-size: 11px; }
  .pd-review__text { font-size: 13px; line-height: 1.6; }
  .pd-review__reply { margin-left: 0; padding: 12px; border-radius: 10px; font-size: 12px; }
  .pd-reviews-bars { gap: 4px; }
  .pd-reviews-bar__label { font-size: 12px; min-width: 24px; }

  /* ═══ PRODUCT DETAIL — variant rows responsive ═══ */
  .pd-variant-row { flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-radius: 10px; }
  .pd-variant-row__name { font-size: 13px; flex: 1 1 100%; }
  .pd-variant-row__price { font-size: 14px; font-weight: 700; }
  .pd-variant-pills { display: flex; gap: 6px; flex-wrap: wrap; }
  .pd-variant-pill { padding: 6px 12px; font-size: 12px; }

  /* ═══ PAGINATION — compact on mobile ═══ */
  .pagination { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
  .pagination a, .pagination span { padding: 8px 10px; min-width: 36px; min-height: 36px; font-size: 13px; border-radius: 8px; }

  /* ═══ CART — sidebar polish ═══ */
  .cart-trust { gap: 8px; margin-top: 16px; }
  .cart-trust__item, .cart-trust__badge { font-size: 12px; }
}

@media (max-width: 480px) {
  .container { padding: 0 8px !important; }
  .site-shell { padding: 0 8px !important; }

  /* Header */
  .site-header__inner { gap: 8px; height: 56px; }
  .site-header__logo img { height: 30px; }
  .site-header__icon svg { width: 18px; height: 18px; }

  /* Hero */
  .hero__title { font-size: 24px; }

  /* Product grid — 1 column on phones */
  .product-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .pcard__footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .pcard__btn { width: 100%; justify-content: center; }
  .pcard__meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pcard__title { height: auto; min-height: 38px; }
  .pcard__img { padding: 4px; }

  /* Category grid (small) */
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Product detail info strip — single column */
  .pd-info-strip { grid-template-columns: 1fr !important; }

  /* Dashboard tiles — 1 column */
  .acc-stats, .dashboard-stats { grid-template-columns: 1fr !important; }

  /* Review modal fullscreen */
  .crv-modal { padding: 0; }
  .crv-modal__panel {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .crv-modal__header { padding: 18px 20px 14px; }
  .crv-modal__product { padding: 14px 20px; }
  .crv-modal__body { padding: 18px 20px; }
  .crv-modal__footer { padding: 16px 20px; }

  /* Cart quantity */
  .cart-qty, .cart-item__qty { justify-content: flex-start; }

  /* Mobile nav full-width */
  .mobile-nav { width: 100vw; }

  /* Header — even more compact on small phones */
  .site-header__inner { height: 44px; }
  .site-header__logo img { height: 24px; }
  .site-header__mobile-btn { width: 36px; height: 36px; }
  .site-header__mobile-btn svg { width: 18px; height: 18px; }

  /* Sections tighter padding */
  .section { padding: 24px 0; }
  .section__title { font-size: 18px; margin-bottom: 18px; }

  /* Toast — full width */
  .toast-container { left: 8px !important; right: 8px !important; max-width: none !important; min-width: auto !important; }

  /* Auth forms + page cards — full width */
  .auth-wrap .btn, .form-actions .btn { width: 100%; justify-content: center; }
  .page-card { padding: 16px; }
  .page-card__header { flex-direction: column; gap: 10px; align-items: flex-start !important; }
  .page-card__header .btn { width: 100%; justify-content: center; }

  /* Product card — full width, stacked footer, polished look */
  .pcard { border-radius: 14px; }
  .pcard__footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .pcard__btn { width: 100%; justify-content: center; min-height: 48px; font-size: 14px; border-radius: 10px; }
  .pcard__body { padding: 12px 14px 16px; }
  .pcard__price { font-size: 18px; }
  .pcard__pills { gap: 3px; }
  .pcard__pill { padding: 4px 8px; font-size: 10px; }

  /* Product grid — force single column on phones */
  .product-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Section titles centered on mobile */
  .section__title { text-align: center; }

  /* Smoother border-radius everywhere on mobile */
  .page-card { border-radius: 12px; }

  /* Product detail — even more compact */
  /* Product detail actions — handled in product_detail.php */
  .pd-name { font-size: 18px; }
  .pd-price-current { font-size: 26px; }
  .pd-info-strip { gap: 6px; }
  .pd-info-strip__item { padding: 8px 10px; font-size: 12px; border-radius: 8px; }

  /* Reviews — more compact */
  .pd-review__avatar { width: 32px; height: 32px; }
  .pd-review__text { font-size: 12px; }

  /* Pagination — smaller */
  .pagination a, .pagination span { padding: 6px 8px; min-width: 32px; min-height: 32px; font-size: 12px; }

  /* Footer — tighter on phones */
  .site-footer__grid { gap: 20px; }
  .site-footer__heading { font-size: 13px; margin-bottom: 10px; }
  .site-footer__link { padding: 6px 0; font-size: 14px; }
  .site-footer { padding: 28px 0 16px; margin-top: 32px; }
  .site-footer__bottom { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════
   Shared review modal (used by /ucet/recenze + product detail)
   ═══════════════════════════════════════════════════════ */
.crv-modal {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.crv-modal.is-open { display: flex; }
.crv-modal__panel {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .4);
}
.crv-modal__header {
  padding: 22px 28px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex; justify-content: space-between; align-items: center;
}
.crv-modal__title { font-size: 18px; font-weight: 800; margin: 0; }
.crv-modal__close {
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 22px;
}
.crv-modal__close:hover { background: #f1f5f9; color: var(--text); }
.crv-modal__product {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px;
  background: #fafbfc;
  border-bottom: 1px solid #f1f5f9;
}
.crv-modal__product-img { width: 56px; height: 56px; background: #fff; border-radius: 8px; border: 1px solid #ebeef2; padding: 4px; }
.crv-modal__product-img img { width: 100%; height: 100%; object-fit: contain; }
.crv-modal__product-name { font-size: 14px; font-weight: 700; }
.crv-modal__body { padding: 22px 28px; }
.crv-modal__label {
  display: block; font-size: 12px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.crv-stars-input { display: flex; gap: 4px; margin-bottom: 22px; }
.crv-star-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  transition: transform .1s;
}
.crv-star-btn:hover { transform: scale(1.15); }
.crv-star-btn svg { width: 38px; height: 38px; fill: #e2e8f0; transition: fill .15s; }
.crv-star-btn--filled svg { fill: #f59e0b; }
.crv-input, .crv-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  margin-bottom: 18px;
}
.crv-input:focus, .crv-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.crv-textarea { resize: vertical; min-height: 110px; }
.crv-modal__footer {
  padding: 18px 28px;
  border-top: 1px solid #f1f5f9;
  display: flex; justify-content: flex-end; gap: 10px;
}
.crv-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border: none; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s;
}
.crv-btn--primary {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  padding: 11px 22px;
  box-shadow: 0 6px 16px -4px rgba(22, 163, 74, .45);
}
.crv-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -4px rgba(22, 163, 74, .55); }
.crv-btn--primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.crv-btn--ghost {
  background: #f1f5f9;
  color: var(--text);
}
.crv-btn--ghost:hover { background: #e2e8f0; }

/* ═══ Global paw print decorations ═══════════════════ */
.section { position: relative; }
.section::after {
  content: ''; position: absolute; bottom: 10px; right: 10px;
  width: 70px; height: 70px; opacity: .025; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 60 60' fill='%2316a34a' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='30' cy='38' rx='14' ry='16'/%3E%3Cellipse cx='14' cy='18' rx='7' ry='9' transform='rotate(-15 14 18)'/%3E%3Cellipse cx='46' cy='18' rx='7' ry='9' transform='rotate(15 46 18)'/%3E%3Cellipse cx='22' cy='10' rx='6' ry='7'/%3E%3Cellipse cx='38' cy='10' rx='6' ry='7'/%3E%3C/svg%3E") no-repeat center/contain;
  transform: rotate(18deg);
}
.section:nth-child(even)::after { left: 10px; right: auto; transform: rotate(-22deg); }
