/* ==========================================================
   Medxpress — Core Stylesheet
   ========================================================== */

:root {
  --green: #2277a4;
  --green-dark: #185f85;
  --green-darker: #0f3a51;
  --green-footer: #0d2f42;
  --green-soft: #e7f1f5;
  --green-soft-2: #d4e8ef;
  --pink-soft: #fdeaf0;
  --lilac-soft: #f0eefc;
  --text-dark: #1c2a24;
  --text-muted: #6b7a73;
  --nav-purple: #3d2e6b;
  --border-color: #e7ece9;
  --white: #ffffff;
  --danger: #e6435a;
  --star: #f5a623;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow: 0 4px 18px rgba(18, 61, 44, 0.06);
  --shadow-md: 0 10px 30px rgba(18, 61, 44, 0.10);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

.container {
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: all 0.18s ease;
}
.btn-primary {
  background: var(--white);
  color: var(--green-dark);
}
.btn-primary:hover { background: var(--green-soft); }
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.6);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }
.btn-solid {
  background: var(--green);
  color: var(--white);
}
.btn-solid:hover { background: var(--green-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }

/* ---------- Topbar / promo strip ---------- */
.promo-strip {
  background: var(--green);
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  padding: 8px 12px;
  letter-spacing: 0.02em;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border-color);
  padding: 18px 0;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 50;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-dark);
  white-space: nowrap;
}
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f5f7f6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 4px 6px 4px 20px;
  max-width: 620px;
}
.search-form input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.92rem;
  padding: 8px 0;
}
.search-form button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  white-space: nowrap;
}
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  position: relative;
}
.lang-switcher svg { flex-shrink: 0; }
.lang-select {
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-dark);
  cursor: pointer;
  outline: none;
  appearance: none;
  padding-right: 4px;
}
.header-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 0.92rem;
}
.header-link svg { width: 20px; height: 20px; }
.cart-link { position: relative; }
.cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--green);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-nav {
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 40;
}
.nav-row-mega {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 16px 0;
  overflow: visible;
}
.nav-item { position: relative; flex-shrink: 0; }
.nav-item > a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--nav-purple);
  white-space: nowrap;
  transition: color 0.15s;
}
.nav-item > a:hover { color: var(--green-dark); }
.nav-item-accent > a { color: var(--green-dark); }
.nav-item.has-dropdown > a svg { transition: transform 0.15s; }
.nav-item.has-dropdown:hover > a svg { transform: rotate(180deg); }

/* ---------- Dropdown panel (shared base for the mega menu AND the
   simpler Shop By Condition / Shop By Brand dropdowns) ---------- */
.dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  width: max-content;
  max-width: min(1100px, 90vw);
}
.nav-item.has-dropdown:hover .dropdown-panel,
.nav-item.has-dropdown.force-open .dropdown-panel {
  display: flex;
}

/* ---- Shop By Category mega menu (sidebar + conditions/brands panel) ---- */
.mega-sidebar {
  width: 250px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  padding: 12px 0;
  max-height: 520px;
  overflow-y: auto;
}
.mega-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 22px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--nav-purple);
  transition: background 0.12s, color 0.12s;
}
.mega-sidebar-item svg { flex-shrink: 0; opacity: 0.5; }
.mega-sidebar-item:hover,
.mega-sidebar-item.active {
  background: var(--green-soft);
  color: var(--green-dark);
}
.mega-sidebar-item.all-products {
  font-weight: 800;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
  padding-bottom: 14px;
}

.mega-content {
  flex: 1;
  min-width: 520px;
  max-height: 520px;
  overflow-y: auto;
  padding: 28px 32px;
}
.mega-content-panel {
  display: none !important;
  gap: 48px;
}
.mega-content-panel.active { display: flex !important; }
.mega-col { flex: 1; min-width: 190px; }
.mega-col h4 {
  margin: 0 0 16px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-dark);
}
.mega-col-list { display: flex; flex-direction: column; gap: 11px; }
.mega-col-list.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 24px; }
.mega-col-list a { font-size: 0.85rem; color: var(--text-muted); }
.mega-col-list a:hover { color: var(--green-dark); }

/* ---- Shop By Condition / Shop By Brand: simpler single-panel dropdowns ---- */
.simple-panel {
  padding: 26px 30px;
  max-width: min(900px, 90vw);
}
.simple-panel-narrow { max-width: 420px; }
.simple-columns {
  display: flex;
  gap: 40px;
  max-height: 520px;
  overflow-y: auto;
}
.simple-col { min-width: 170px; }
.simple-col h4 {
  margin: 0 0 14px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-dark);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

@media (max-width: 1024px) {
  .dropdown-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    width: auto;
    max-width: none;
    max-height: 70vh;
  }
  .mega-sidebar, .mega-content { max-height: 60vh; }
  .mega-content { min-width: 0; flex-direction: column; }
  .mega-content-panel { flex-direction: column; gap: 24px; }
  .simple-columns { flex-direction: column; gap: 24px; max-height: 60vh; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--green) 0%, var(--green-dark) 100%);
  border-radius: var(--radius-lg);
  color: var(--white);
  margin-top: 24px;
  overflow: hidden;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 24px;
  padding: 56px 56px 0 56px;
}
.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: 2.75rem;
  line-height: 1.14;
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.hero p {
  font-size: 1rem;
  color: rgba(255,255,255,0.88);
  max-width: 440px;
  margin: 0 0 30px;
}
.hero-actions { display: flex; gap: 14px; margin-bottom: 48px; }
.hero-figure {
  align-self: flex-end;
  display: flex;
  justify-content: center;
}
.hero-figure svg { width: 100%; max-width: 380px; height: auto; }
.hero-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding-bottom: 22px;
}
.hero-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.45);
}
.hero-dots span.active { background: var(--white); width: 20px; border-radius: 4px; }

/* ---------- Feature strip ---------- */
.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 44px 0;
  border-bottom: 1px solid var(--border-color);
}
.feature-item { display: flex; align-items: center; gap: 14px; }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--green-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--green-dark);
}
.feature-item h4 { margin: 0 0 3px; font-size: 0.95rem; font-weight: 700; }
.feature-item p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Promo banner cards (3-up) ---------- */
.promo-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 40px 0 8px;
}
.promo-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  color: var(--text-dark);
}
.promo-card .promo-bg { position: absolute; inset: 0; z-index: 0; }
.promo-card .promo-content { position: relative; z-index: 1; }
.promo-card .badge {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  background: var(--white);
  color: var(--text-dark);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}
.promo-card .sale-badge {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  background: #ffcf3d;
  color: var(--text-dark);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 50%;
  text-align: center;
  line-height: 1.1;
}
.promo-card h3 { margin: 0; font-size: 1.3rem; font-weight: 800; }

/* ---------- Section headers ---------- */
.section { padding: 44px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
}
.section-head h2 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.section-head a { font-size: 0.85rem; font-weight: 700; color: var(--green-dark); }

/* ---------- Product grid & cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.product-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--white);
  transition: box-shadow 0.18s, transform 0.18s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-thumb {
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}
.product-thumb img, .product-thumb svg { width: 68%; height: 68%; object-fit: contain; }
.product-discount-tag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
}
.rx-badge-row { margin-bottom: 6px; }
.rx-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 800;
  color: #a5690f;
  background: #fdf3e2;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.01em;
}
.rx-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fdf3e2;
  color: #8a5a0d;
  font-size: 0.83rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.rx-notice svg { flex-shrink: 0; margin-top: 2px; }
.rx-notice a { color: #8a5a0d; text-decoration: underline; font-weight: 700; }

.rx-submit-block { margin: 16px 0; }
.rx-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green-dark);
  border-color: var(--border-color);
  font-size: 0.88rem;
}
.rx-toggle-btn:hover { border-color: var(--green); background: var(--green-soft); }
.rx-chevron { transition: transform 0.15s ease; margin-left: 2px; }
.rx-toggle-btn[aria-expanded="true"] .rx-chevron { transform: rotate(180deg); }

.rx-form-panel {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fbfcfc;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.rx-form-panel input[type="file"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.rx-form-error {
  background: #fdeaea;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  margin-bottom: 14px;
}
.product-stars {
  display: flex;
  gap: 2px;
  color: var(--star);
  font-size: 0.75rem;
  margin-bottom: 6px;
}
.product-name {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.35;
  min-height: 2.4em;
}
.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.product-price {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--text-dark);
}
.product-price .old {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-right: 6px;
}
.add-cart-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--green);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.add-cart-btn:hover { background: var(--green-dark); }

.add-cart-btn-full {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: 0.84rem;
  transition: background 0.15s, transform 0.1s;
}
.add-cart-btn-full:hover { background: var(--green-dark); }
.add-cart-btn-full:active { transform: scale(0.97); }
.add-cart-btn-full.is-added { background: var(--green-dark); }
.rx-required-btn {
  background: #fdf3e2;
  color: #a5690f;
}
.rx-required-btn:hover { background: #fbe8c8; color: #8a5a0d; }

/* ---------- Toast notification ---------- */
#toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--text-dark);
  color: var(--white);
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .toast-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast.toast-error .toast-icon { background: var(--danger); }

/* ---------- Special offers (2-up feature cards) ---------- */
.offer-cards {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}
.offer-card {
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.offer-card.bg-mint { background: var(--green-soft-2); }
.offer-card.bg-pink { background: var(--pink-soft); }
.offer-card.bg-lilac { background: var(--lilac-soft); }
.offer-card .tag {
  position: absolute; top: 20px; left: 20px;
  background: var(--white);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--danger);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.offer-card h3 { font-size: 1.15rem; font-weight: 800; margin: 6px 0 2px; }
.offer-card .old-price { font-size: 0.8rem; color: var(--text-muted); text-decoration: line-through; }
.offer-card .price { font-size: 1.2rem; font-weight: 800; margin: 2px 0 0; }
.offer-card .price small { font-weight: 500; font-size: 0.72rem; color: var(--text-muted); }
.offer-split { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* ---------- Top selling (list style rows) ---------- */
.top-selling-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.top-selling-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}
.top-selling-row .thumb {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.top-selling-row .thumb img, .top-selling-row .thumb svg { width: 62%; height: 62%; object-fit: contain; }
.top-selling-row .info { flex: 1; min-width: 0; }
.top-selling-row .info h4 {
  font-size: 0.85rem; font-weight: 700; margin: 0 0 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-selling-row .info .price { font-size: 0.9rem; font-weight: 800; }
.top-selling-row .add-mini {
  border: none;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.top-selling-row .add-mini:hover { background: var(--green); color: var(--white); }
.top-selling-row .add-mini-rx { background: #fdf3e2; color: #a5690f; }
.top-selling-row .add-mini-rx:hover { background: #fbe8c8; color: #8a5a0d; }

/* ---------- Category pills / breadcrumb ---------- */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 18px 0;
}
.breadcrumb a { color: var(--green-dark); font-weight: 600; }
.category-hero {
  background: var(--green-soft);
  border-radius: var(--radius-lg);
  padding: 34px 40px;
  margin-bottom: 30px;
}
.category-hero h1 { margin: 0 0 6px; font-size: 1.6rem; }
.category-hero p { margin: 0; color: var(--text-muted); }

/* ---------- Product filters (sidebar + toolbar) ---------- */
.filters-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 34px;
  align-items: start;
  padding-bottom: 50px;
}
.filters-layout > form { margin: 0; min-width: 0; }
.filters-sidebar {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  position: sticky;
  top: 90px;
}
.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.filter-head h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.filter-clear { font-size: 0.78rem; font-weight: 700; color: var(--green-dark); }
.filter-group { margin-bottom: 22px; }
.filter-group h4 { margin: 0 0 12px; font-size: 0.85rem; font-weight: 800; color: var(--text-dark); }
.filter-checkbox-list { display: flex; flex-direction: column; gap: 10px; }
.filter-checkbox-list-scroll { max-height: 220px; overflow-y: auto; padding-right: 4px; }
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}
.filter-checkbox input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--green);
  flex-shrink: 0;
  cursor: pointer;
}
.filter-checkbox:hover span { color: var(--green-dark); }
.price-range-inputs { display: flex; align-items: center; gap: 8px; }
.price-range-inputs input {
  width: 0;
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
}
.price-range-inputs input:focus { border-color: var(--green); }
.price-bounds-hint { font-size: 0.72rem; color: var(--text-muted); margin: 8px 0 0; }

.filters-content { min-width: 0; }
.filters-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.results-count { font-size: 0.85rem; color: var(--text-muted); }
.sort-select {
  padding: 9px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--white);
  outline: none;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .filters-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; }
}

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  padding: 30px 0 60px;
}
.product-detail-thumb {
  background: var(--green-soft);
  border-radius: var(--radius-lg);
  aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
}
.product-detail-info { min-width: 0; }
.product-detail-thumb img, .product-detail-thumb svg { width: 48%; height: 48%; }
.product-detail-info h1 { font-size: 1.6rem; margin: 6px 0 10px; }
.product-detail-info .price-row {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 20px;
}
.product-detail-info .price { font-size: 1.6rem; font-weight: 800; }
.product-detail-info .old-price { font-size: 1rem; color: var(--text-muted); text-decoration: line-through; }
.product-detail-info .discount-pill {
  background: var(--danger); color: var(--white); font-size: 0.75rem;
  font-weight: 800; padding: 4px 10px; border-radius: var(--radius-pill);
}
.qty-row { display: flex; align-items: center; gap: 16px; margin: 24px 0; }
.qty-selector {
  display: flex; align-items: center; border: 1px solid var(--border-color);
  border-radius: var(--radius-pill); overflow: hidden;
}
.qty-selector button {
  width: 38px; height: 38px; border: none; background: var(--green-soft);
  font-size: 1.1rem; font-weight: 700; color: var(--green-dark);
}
.qty-selector input {
  width: 44px; text-align: center; border: none; font-weight: 700; outline: none;
}

/* ---------- Cart page ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.cart-table th {
  text-align: left; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); padding: 0 10px 14px;
  border-bottom: 1px solid var(--border-color);
}
.cart-table td { padding: 16px 10px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.cart-product { display: flex; align-items: center; gap: 14px; }
.cart-product .thumb {
  width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--green-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.cart-product .thumb img, .cart-product .thumb svg { width: 62%; }
.cart-summary {
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  padding: 26px; max-width: 380px; margin-left: auto;
}
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.92rem; }
.cart-summary .row.total { font-size: 1.1rem; font-weight: 800; border-top: 1px solid var(--border-color); padding-top: 14px; }
.remove-link { color: var(--danger); font-size: 0.8rem; font-weight: 700; }

/* ---------- Auth forms ---------- */
.auth-wrap {
  max-width: 420px; margin: 60px auto; padding: 36px;
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
}
.auth-wrap h1 { font-size: 1.5rem; margin: 0 0 6px; }
.auth-wrap p.sub { color: var(--text-muted); margin: 0 0 26px; font-size: 0.9rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 0.92rem; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--green); }
.form-error {
  background: #fdeaea; color: var(--danger); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 0.85rem; margin-bottom: 16px;
}
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--text-muted); }
.auth-switch a { color: var(--green-dark); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-footer); color: rgba(255,255,255,0.82); margin-top: 60px; }
.footer-top { padding: 56px 0 40px; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 30px; }
.footer-logo { display: flex; align-items: center; gap: 8px; color: var(--white); font-weight: 800; font-size: 1.25rem; margin-bottom: 16px; }
.footer-logo .logo-mark { background: var(--white); color: var(--green-dark); }
.footer-col h4 { color: var(--white); font-size: 0.9rem; margin: 0 0 16px; }
.footer-col ul li { margin-bottom: 11px; font-size: 0.86rem; }
.footer-col ul li a:hover { color: var(--white); }
.footer-contact p { font-size: 0.86rem; margin: 0 0 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem;
}
.payment-icons { display: flex; gap: 8px; }
.payment-icons span {
  background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 4px; font-size: 0.68rem; font-weight: 700;
}

/* ---------- Cart drawer ---------- */
body.cart-drawer-locked { overflow: hidden; }

.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 40, 30, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 998;
}
.cart-drawer-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 400px;
  max-width: 92vw;
  background: var(--white);
  box-shadow: -12px 0 40px rgba(18, 40, 30, 0.18);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.cart-drawer-header h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.cart-drawer-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--green-soft);
  color: var(--text-dark);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cart-drawer-close:hover { background: var(--green); color: var(--white); }

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 22px;
}
.cart-drawer-loading {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cart-drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 10px;
  color: var(--border-color);
}
.cart-drawer-empty p { color: var(--text-muted); font-weight: 600; margin: 16px 0 20px; }

.cart-drawer-items { display: flex; flex-direction: column; gap: 16px; padding: 12px 0; }
.cart-drawer-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.cart-drawer-item .thumb {
  width: 54px; height: 54px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-drawer-item .thumb svg { width: 62%; height: 62%; }
.cart-drawer-item .info { flex: 1; min-width: 0; }
.cart-drawer-item .info .name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-drawer-item .info .price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 8px;
}
.cart-drawer-remove {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.cart-drawer-remove:hover { background: #fdeaea; color: var(--danger); }

.qty-selector-sm {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.qty-selector-sm .qty-btn {
  width: 26px; height: 26px;
  border: none;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qty-selector-sm .qty-btn:hover { background: var(--green); color: var(--white); }
.qty-selector-sm input {
  width: 32px;
  text-align: center;
  border: none;
  font-weight: 700;
  font-size: 0.82rem;
  outline: none;
  -moz-appearance: textfield;
}
.qty-selector-sm input::-webkit-outer-spin-button,
.qty-selector-sm input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-drawer-footer {
  flex-shrink: 0;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--border-color);
}
.cart-drawer-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.cart-drawer-btn { margin-bottom: 10px; }
.cart-drawer-btn:last-child { margin-bottom: 0; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state h2 { color: var(--text-dark); margin-bottom: 10px; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pagination a, .pagination span {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-color); font-size: 0.85rem; font-weight: 700;
}
.pagination a.active, .pagination span.active { background: var(--green); color: var(--white); border-color: var(--green); }

/* ---------- Brand grid ---------- */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.brand-tile {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px 16px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.brand-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--green); color: var(--green-dark); }

/* ---------- Condition groups (Shop By Condition listing) ---------- */
.condition-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}
.condition-group h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* ---------- Static info pages ---------- */
.static-page-header { max-width: 700px; margin-bottom: 34px; }
.static-page-header h1 { font-size: 1.6rem; margin: 0 0 10px; }
.static-page-header p { color: var(--text-muted); margin: 0; }
.static-form { max-width: 520px; }

.service-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.service-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
}
.service-card h3 { font-size: 1rem; margin: 14px 0 8px; }
.service-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.store-locator-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.store-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
}
.store-card h3 { font-size: 1rem; margin: 0 0 10px; }
.store-card p { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 4px; }
.store-map { border-radius: var(--radius-md); overflow: hidden; margin-bottom: 40px; }

@media (max-width: 1100px) {
  .brand-grid { grid-template-columns: repeat(3, 1fr); }
  .condition-groups { grid-template-columns: repeat(2, 1fr); }
  .service-cards { grid-template-columns: repeat(2, 1fr); }
  .store-locator-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .brand-grid { grid-template-columns: repeat(2, 1fr); }
  .condition-groups { grid-template-columns: 1fr; }
  .service-cards { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; padding: 40px 32px 0; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-figure { display: none; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .promo-cards { grid-template-columns: 1fr; }
  .offer-cards { grid-template-columns: 1fr; }
  .top-selling-list { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .product-detail { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .header-row { flex-wrap: wrap; }
  .search-form { order: 3; max-width: 100%; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .nav-row-mega { overflow-x: auto; padding-bottom: 14px; }
}
