/* :root {
  --brand: #0d6e5f;
  --brand-dark: #0a5548;
  --brand-light: #eaf5f1;
  --accent: #c9a04e;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --bg-body: #f6f8f7;
  --bg-soft: #f3f6f5;
  --border-color: #e4ebe8;
  --radius: 14px;
} */
/* :root {
  --brand: #254b67;
  --brand-dark: #18364c;
  --brand-light: #eaf2f7;
  --accent: #b99555;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-body: #f7f9fb;
  --bg-soft: #eef3f7;
  --border-color: #dce5eb;
  --radius: 14px;
} */

/* :root {
  --brand: #45403d;
  --brand-dark: #292625;
  --brand-light: #f0eeec;
  --accent: #a94b3d;
  --text-main: #292524;
  --text-muted: #737373;
  --bg-body: #f8f7f6;
  --bg-soft: #f1efed;
  --border-color: #dfdbd8;
  --bg-card: #ffffff;
  --text-on-brand: #ffffff;
  --disabled: color-mix(in srgb, var(--text-muted) 55%, var(--bg-soft));
  --overlay: color-mix(in srgb, var(--brand-dark) 48%, transparent);
  --shadow: color-mix(in srgb, var(--brand-dark) 12%, transparent);
  --shadow-strong: color-mix(in srgb, var(--brand-dark) 22%, transparent);
  --brand-border: color-mix(in srgb, var(--brand) 16%, transparent);
  --brand-border-strong: color-mix(in srgb, var(--brand) 28%, transparent);
  --cat-1: var(--brand-light);
  --cat-2: color-mix(in srgb, var(--accent) 10%, var(--bg-soft));
  --cat-3: color-mix(in srgb, var(--brand) 8%, var(--bg-card));
  --cat-4: color-mix(in srgb, var(--accent) 16%, var(--bg-card));
  --cat-5: color-mix(in srgb, var(--brand) 6%, var(--bg-soft));
  --cat-6: color-mix(in srgb, var(--text-muted) 12%, var(--bg-card));
  --footer-bg: var(--brand-dark);
  --footer-text: color-mix(in srgb, var(--bg-card) 70%, var(--brand));
  --footer-bottom: color-mix(in srgb, var(--brand-dark) 82%, var(--text-main));
  --status-pending-bg: color-mix(in srgb, var(--accent) 14%, var(--bg-card));
  --status-pending-fg: var(--accent);
  --status-paid-bg: var(--brand-light);
  --status-paid-fg: var(--brand);
  --status-shipped-bg: color-mix(in srgb, var(--brand) 10%, var(--bg-card));
  --status-shipped-fg: var(--brand-dark);
  --status-delivered-bg: color-mix(in srgb, var(--brand) 16%, var(--bg-card));
  --status-delivered-fg: var(--brand-dark);
  --status-canceled-bg: color-mix(in srgb, var(--accent) 12%, var(--bg-card));
  --status-canceled-fg: var(--accent);
  --danger: var(--accent);
  --success: var(--brand);
  --radius: 14px;
} */

 :root {
  --brand: #29483F;
  --brand-dark: #1B332D;
  --brand-light: #E8F0EC;

  --accent: #C6A15B;

  --text-main: #202725;
  --text-muted: #707875;

  --bg-body: #FAFAF7;
  --bg-soft: #F2F3EE;
  --border-color: #E0E4DE;
  --bg-card: #FFFFFF;

  --text-on-brand: #FFFFFF;

  --disabled: color-mix(in srgb, var(--text-muted) 55%, var(--bg-soft));
  --overlay: color-mix(in srgb, var(--brand-dark) 52%, transparent);
  --shadow: color-mix(in srgb, var(--brand-dark) 10%, transparent);
  --shadow-strong: color-mix(in srgb, var(--brand-dark) 20%, transparent);

  --brand-border: color-mix(in srgb, var(--brand) 16%, transparent);
  --brand-border-strong: color-mix(in srgb, var(--brand) 28%, transparent);

  --cat-1: #E8F0EC;
  --cat-2: #F4EFE5;
  --cat-3: #EEF2EF;
  --cat-4: #F7F1E5;
  --cat-5: #E9EEEB;
  --cat-6: #F1F2EF;

  --footer-bg: #1B332D;
  --footer-text: #FFFFFF;
  --footer-bottom: #142721;

  --status-pending-bg: #F8F0DF;
  --status-pending-fg: #A77D32;

  --status-paid-bg: #E8F0EC;
  --status-paid-fg: #29483F;

  --status-shipped-bg: #EAF0F2;
  --status-shipped-fg: #355664;

  --status-delivered-bg: #DDEBE4;
  --status-delivered-fg: #234B3E;

  --status-canceled-bg: #F7E8E5;
  --status-canceled-fg: #A64C43;

  --danger: #B34D45;
  --success: #2E725A;

  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  scroll-behavior: smooth;
}
body.drawer-open { overflow: hidden; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-bg-success { background: var(--brand) !important; color: var(--text-on-brand) !important; }
.text-bg-secondary { background: var(--text-muted) !important; color: var(--text-on-brand) !important; }
.text-bg-light { background: var(--bg-card) !important; color: var(--text-main) !important; }
.btn-outline-secondary {
  color: var(--brand);
  border-color: var(--border-color);
}
.btn-outline-secondary:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}
.btn-outline-danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--text-on-brand);
}

/* ---------- Top bar & Navbar ---------- */
.top-bar {
  background: var(--brand-dark);
  color: var(--text-on-brand);
}
.top-bar a { color: var(--text-on-brand); opacity: .85; }
.top-bar a:hover { opacity: 1; }

.main-navbar {
  background: var(--bg-card);
  box-shadow: 0 2px 12px var(--shadow);
  padding: .28rem 0;
  z-index: 1030;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 0;
}
.menu-toggle,
.drawer-close {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--bg-soft);
  color: var(--text-main);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.navbar-brand.has-logo {
  flex: 0 0 auto;
  min-width: auto;
}
.brand-logo {
  height: 52px;
  width: auto;
  max-width: min(260px, 52vw);
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  display: block;
}
.brand-text {
  font-size: clamp(0.95rem, 2.6vw, 1.25rem);
  font-weight: 800;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.desktop-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.1rem;
  align-items: center;
}
.desktop-nav > li {
  display: flex;
  align-items: center;
  height: 42px;
}
.desktop-nav a {
  color: var(--text-main);
  font-weight: 600;
  font-size: .95rem;
  padding: .35rem .15rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  right: 0; left: 0; bottom: 0;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform .18s ease;
}
.desktop-nav a:hover::after,
.desktop-nav a.active::after { transform: scaleX(1); }
.desktop-nav a:hover,
.desktop-nav a.active { color: var(--brand); }

.has-mega { position: static; }
.mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.mega-trigger i { font-size: .9em; }
.mega-panel { display: none; }
.mega-page-dim { display: none; }

@media (min-width: 992px) {
  .has-mega:hover .mega-trigger::after,
  .has-mega:focus-within .mega-trigger::after,
  .has-mega.is-open .mega-trigger::after { transform: scaleX(1); }
  .has-mega:hover .mega-panel,
  .has-mega:focus-within .mega-panel,
  .has-mega.is-open .mega-panel {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 1045;
    margin-top: -12px;
    padding-top: 12px;
  }
  .cat-explorer-mega {
    max-width: min(1180px, calc(100vw - 48px));
    margin: 0 auto;
    height: min(72vh, 640px);
    border-radius: 0 0 16px 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 18px 40px rgba(27, 51, 45, .16);
  }
  .mega-page-dim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 20, .28);
    z-index: 1025;
    pointer-events: none;
  }
  body:has(.has-mega:hover) .mega-page-dim,
  body:has(.has-mega:focus-within) .mega-page-dim,
  body:has(.has-mega.is-open) .mega-page-dim {
    display: block;
  }
}

.search-form {
  display: flex;
  flex: 1 1 240px;
  max-width: 440px;
  min-width: 0;
}
.search-form .form-control {
  border-radius: 0 999px 999px 0;
  border-color: var(--border-color);
  border-left: 0;
}
.search-form .form-control:focus {
  box-shadow: none;
  border-color: var(--brand);
}
.search-btn {
  border-radius: 999px 0 0 999px;
  background: var(--brand);
  color: var(--text-on-brand);
  border: 1px solid var(--brand);
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
.search-btn:hover { background: var(--brand-dark); color: var(--text-on-brand); }

.header-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-inline-start: auto;
  flex-shrink: 0;
}
.header-icon {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--text-main);
  padding: .35rem .45rem;
  border-radius: 10px;
  font-size: 1.45rem;
  line-height: 1;
}
.header-icon:hover { color: var(--brand); background: var(--brand-light); }
.header-icon-label { font-size: .82rem; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-link { position: relative; }
.cart-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--accent);
  color: var(--text-on-brand);
  font-size: .65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
}

/* ---------- Mobile drawer (opens from the right) ---------- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1080;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(86vw, 360px);
  background: var(--bg-card);
  z-index: 1090;
  transform: translateX(110%);
  transition: transform .28s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px var(--shadow-strong);
  overflow-y: auto;
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.drawer-search {
  max-width: none;
  margin: 1rem;
  flex: 0 0 auto;
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: .5rem .75rem 1.5rem;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .85rem .8rem;
  border-radius: 10px;
  font-weight: 600;
  color: var(--text-main);
}
.drawer-nav a:hover, .drawer-nav a:focus, .drawer-nav a.active { background: var(--brand-light); color: var(--brand); }
.drawer-nav i { font-size: 1.25rem; }
.drawer-phone {
  margin: auto 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--brand);
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn-primary-brand, .btn-add-cart {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: var(--text-on-brand);
  font-weight: 600;
  border-radius: 10px;
  transition: all .2s ease;
}
.btn-primary-brand:hover, .btn-add-cart:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--text-on-brand);
}
.btn-add-cart:disabled { background: var(--disabled); border-color: var(--disabled); }

/* ---------- Hero banner ---------- */
.hero-banner { background: var(--bg-soft); }
.hero-banner-link { display: block; }
.hero-banner img {
  width: 100%;
  height: clamp(220px, 40vw, 480px);
  object-fit: cover;
}

/* ---------- Section heading ---------- */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.section-heading h2 {
  font-size: 1.4rem;
  font-weight: 800;
  position: relative;
  padding-right: 14px;
  border-right: 4px solid var(--brand);
}
.section-heading .see-all {
  font-size: .9rem;
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}
.section-sub { color: var(--text-muted); font-size: .85rem; margin-top: .2rem; }

/* ---------- Category tiles ---------- */
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  background: var(--cat-1);
  border: 1px solid var(--brand-border);
  border-radius: 18px;
  padding: 1.2rem .55rem 1.05rem;
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
  color: var(--brand-dark);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  height: 100%;
}
.row > [class*="col-"]:nth-child(6n+1) .category-tile { background: var(--cat-1); }
.row > [class*="col-"]:nth-child(6n+2) .category-tile { background: var(--cat-2); }
.row > [class*="col-"]:nth-child(6n+3) .category-tile { background: var(--cat-3); }
.row > [class*="col-"]:nth-child(6n+4) .category-tile { background: var(--cat-4); }
.row > [class*="col-"]:nth-child(6n+5) .category-tile { background: var(--cat-5); }
.row > [class*="col-"]:nth-child(6n+6) .category-tile { background: var(--cat-6); }
.category-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px var(--shadow);
  border-color: var(--brand-border-strong);
  color: var(--brand-dark);
}
.category-tile img {
  width: 62px; height: 62px; object-fit: cover; border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 4px 12px var(--shadow);
}
.category-tile-placeholder {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--bg-card); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  box-shadow: 0 4px 12px var(--shadow);
}

/* ---------- Product card ---------- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.product-card:hover {
  box-shadow: 0 16px 32px var(--shadow);
  transform: translateY(-3px);
  border-color: var(--brand-border-strong);
}
.product-card-img { position: relative; display: block; aspect-ratio: 1/1; overflow: hidden; background: var(--bg-soft); }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover .product-card-img img { transform: scale(1.06); }

.badge-discount {
  position: absolute; top: 10px; right: 10px;
  background: var(--accent); color: var(--text-on-brand); font-size: .75rem; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}
.badge-discount.static { position: static; margin-right: .5rem; display: inline-block; }
.badge-outstock {
  position: absolute; top: 10px; left: 10px;
  background: var(--text-muted); color: var(--text-on-brand); font-size: .7rem; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
}

.product-card-body {
  padding: .95rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex-grow: 1;
  background: var(--brand-light);
  color: var(--text-main);
}
.product-card-cat {
  font-size: .7rem;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--bg-card);
  border: 1px solid var(--brand-border);
  display: inline-block;
  width: fit-content;
  padding: .12rem .55rem;
  border-radius: 999px;
}
.product-card-title {
  font-weight: 700; font-size: .92rem; line-height: 1.45;
  color: var(--text-main);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.product-card-title:hover { color: var(--brand-dark); }
.product-card-price { margin-top: auto; }
.product-card-body .old-price { color: var(--text-muted); text-decoration: line-through; font-size: .82rem; margin-left: 6px; }
.product-card-body .new-price { color: var(--brand-dark); font-weight: 800; }
.old-price { color: var(--text-muted); text-decoration: line-through; font-size: .82rem; margin-left: 6px; }
.new-price { color: var(--brand); font-weight: 800; }

/* ---------- Product detail ---------- */
.product-gallery .main-image img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border-color); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border-color); cursor: pointer; }
.thumb.active, .thumb:hover { border-color: var(--brand); }
.qty-input { max-width: 90px; text-align: center; }
.product-description { border-top: 1px solid var(--border-color); padding-top: 1.25rem; margin-top: 1.25rem; }

/* ---------- Trust strip ---------- */
.trust-strip { background: linear-gradient(180deg, var(--bg-body) 0%, var(--brand-light) 100%); color: var(--brand-dark); }
.trust-icon { font-size: 1.7rem; display: block; color: var(--brand); }
.trust-item {
  background: var(--bg-card);
  border: 1px solid var(--brand-border);
  border-radius: 16px;
  padding: 1.1rem .7rem;
  height: 100%;
}

/* ---------- Blog ---------- */
.blog-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); overflow: hidden; transition: box-shadow .25s ease;
}
.blog-card:hover { box-shadow: 0 14px 28px var(--shadow); }
.blog-card img { width: 100%; height: 190px; object-fit: cover; }
.blog-card-body { padding: 1rem; }
.blog-card-body h5 { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.blog-cover { max-height: 420px; object-fit: cover; }
.blog-content { line-height: 2; font-size: 1rem; }
.blog-content img { border-radius: var(--radius); margin: 1rem 0; }

/* ---------- Filters / sidebar ---------- */
.filter-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.filter-list li { margin-bottom: .4rem; }
.filter-list a {
  color: var(--text-main);
  font-size: .92rem;
  display: block;
  padding: .45rem .7rem;
  border-radius: 10px;
}
.filter-list a.active, .filter-list a:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 700;
}

.breadcrumb a { color: var(--brand); }
.page-link { color: var(--brand-dark); border-radius: 8px !important; margin: 0 .15rem; }
.page-item.active .page-link {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}

/* ---------- Cart & Checkout ---------- */
.cart-table th { border-bottom: 2px solid var(--border-color); font-weight: 700; font-size: .85rem; }
.cart-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.summary-box {
  background: var(--bg-soft); border-radius: var(--radius); padding: 1.5rem; position: sticky; top: 100px;
}
.checkout-form .form-control, .checkout-form textarea {
  border-radius: 8px;
}

/* ---------- Auth & account panel ---------- */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: 0 10px 30px var(--shadow);
}
.auth-icon {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  border-radius: 50%; background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.otp-input {
  letter-spacing: .4em;
  font-size: 1.4rem;
  font-weight: 700;
}
.account-sidebar {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.account-user {
  display: flex; align-items: center; gap: .75rem;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.account-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.account-nav a {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .7rem; border-radius: 8px;
  color: var(--text-main); font-size: .92rem; margin-bottom: .2rem;
}
.account-nav a:hover, .account-nav a.active {
  background: var(--bg-card); color: var(--brand); font-weight: 700;
}
.account-stat {
  background: var(--bg-soft); border-radius: var(--radius); padding: 1.1rem 1.25rem; height: 100%;
}
.account-table { background: var(--bg-card); border-radius: var(--radius); }
.empty-account {
  background: var(--bg-soft); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center;
}
.status-badge {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.status-pending { background: var(--status-pending-bg); color: var(--status-pending-fg); }
.status-paid { background: var(--status-paid-bg); color: var(--status-paid-fg); }
.status-shipped { background: var(--status-shipped-bg); color: var(--status-shipped-fg); }
.status-delivered { background: var(--status-delivered-bg); color: var(--status-delivered-fg); }
.status-canceled { background: var(--status-canceled-bg); color: var(--status-canceled-fg); }
.status-preparing { background: #F8F0DF; color: #A77D32; }
.status-ready { background: #E8F0EC; color: #29483F; }

.seller-captcha-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
}
.seller-captcha-img {
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--brand-light);
}
.seller-period-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.seller-period-btn {
  display: inline-flex;
  align-items: center;
  padding: .42rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
}
.seller-period-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.seller-period-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.cat-picker {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
}
.cat-picker-search {
  position: relative;
  margin-bottom: .75rem;
}
.cat-picker-search i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.cat-picker-search input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: .65rem 2.4rem .65rem .9rem;
  color: var(--text-main);
}
.cat-picker-search input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--bg-card);
}
.cat-picker-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 30px var(--shadow-strong);
  max-height: 280px;
  overflow: auto;
  padding: .35rem;
}
.cat-picker-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  padding: .55rem .7rem;
  border-radius: 8px;
  color: var(--text-main);
}
.cat-picker-result:hover,
.cat-picker-result:focus {
  background: var(--brand-light);
}
.cat-picker-result-name { font-weight: 700; }
.cat-picker-result-path { font-size: .78rem; color: var(--text-muted); }
.cat-picker-empty {
  padding: .8rem;
  color: var(--text-muted);
  font-size: .9rem;
}
.cat-picker-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  list-style: none;
  padding: 0;
  margin: 0 0 .75rem;
}
.cat-picker-crumbs li:not(:last-child)::after {
  content: "/";
  margin-right: .4rem;
  color: var(--text-muted);
}
.cat-picker-crumb {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  padding: 0;
}
.cat-picker-cols {
  display: flex;
  flex-direction: row;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  min-height: 220px;
  background: var(--bg-soft);
}
.cat-picker-col {
  min-width: min(220px, 80vw);
  max-width: 260px;
  flex: 1 0 200px;
  border-left: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}
.cat-picker-col:last-child { border-left: 0; }
.cat-picker-col-title {
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: .55rem .8rem .3rem;
}
.cat-picker-list {
  overflow-y: auto;
  max-height: 280px;
  padding: .25rem;
}
.cat-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  padding: .55rem .7rem;
  border-radius: 8px;
  color: var(--text-main);
  font-size: .92rem;
}
.cat-picker-item i { color: var(--text-muted); font-size: .95rem; }
.cat-picker-item:hover { background: var(--bg-soft); }
.cat-picker-item.is-active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 700;
}
.cat-picker-item.is-active i { color: var(--brand); }
.cat-picker-item.is-leaf.is-active i { color: var(--success); }
.cat-picker-status {
  margin-top: .8rem;
  padding: .7rem .85rem;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: .9rem;
}
.cat-picker-status.is-wait {
  background: var(--status-pending-bg);
  color: var(--status-pending-fg);
}
.cat-picker-status.is-ok {
  background: var(--brand-light);
  color: var(--brand-dark);
}
.cat-picker-status i { margin-left: .35rem; }
@media (max-width: 767.98px) {
  .cat-picker-cols {
    flex-direction: column;
    min-height: 0;
  }
  .cat-picker-col {
    max-width: none;
    min-width: 0;
    flex: 1 0 auto;
    border-left: 0;
    border-bottom: 1px solid var(--border-color);
  }
  .cat-picker-col:last-child { border-bottom: 0; }
  .cat-picker-list { max-height: 180px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: #fff; }
.site-footer p,
.site-footer li,
.site-footer span,
.site-footer .small,
.site-footer .text-muted,
.footer-links,
.footer-bottom,
.footer-bottom .text-muted {
  color: #fff !important;
}
.footer-title { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.footer-links a { color: #fff; font-size: .9rem; }
.footer-links a:hover { color: var(--accent); }
.site-footer i { margin-left: 6px; color: #fff; }
.site-footer .d-flex a { color: #fff; }
.footer-bottom { background: var(--footer-bottom); color: #fff; }

/* ---------- About page ---------- */
.about-hero { background: var(--bg-soft); padding: 1.5rem 0 2rem; }
.about-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 10px 30px var(--shadow);
}
.about-hero-logo {
  height: 88px;
  width: auto;
  max-width: min(380px, 90%);
  margin: 0 auto 1rem;
  object-fit: contain;
}
.about-kicker {
  color: var(--brand);
  font-weight: 800;
  letter-spacing: .02em;
}
.about-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  margin-bottom: .5rem;
}
.about-tagline { color: var(--text-muted); }
.about-body {
  max-width: 760px;
  margin: 0 auto;
  line-height: 2;
  font-size: 1.02rem;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
}
.about-contact { background: var(--bg-soft); }
.contact-card {
  display: block;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px var(--shadow);
  border-color: var(--brand-light);
}
.contact-card-icon {
  width: 52px; height: 52px; margin: 0 auto .85rem;
  border-radius: 50%; background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.contact-card h3 {
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: .35rem;
}
.contact-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.7;
}
.about-socials {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.75rem;
}
.about-socials a {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--brand);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.about-socials a:hover { background: var(--brand); color: var(--text-on-brand); border-color: var(--brand); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; bottom: 24px; left: 24px; width: 44px; height: 44px;
  background: var(--brand); color: var(--text-on-brand); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px var(--shadow-strong); z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 991.98px) {
  .header-inner { gap: .45rem; min-height: 0; }
  .brand-logo { height: 42px; max-width: min(190px, 46vw); }
  .product-card-body { padding: .7rem; }
  .product-card-title { font-size: .82rem; min-height: 2.3em; }
  .btn-add-cart { font-size: .8rem; padding: .4rem .5rem; }
  .hero-banner img { height: 210px; }
  .filter-box { padding: 1rem; }
  .account-sidebar { display: flex; flex-direction: column; }
  .account-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
  .account-nav a { margin: 0; }
  .cart-table { font-size: .85rem; }
  .cart-table th:nth-child(2),
  .cart-table td:nth-child(2) { display: none; }
  body { padding-bottom: 64px; }
  .header-actions .cart-link { display: none; }
  .site-footer { margin-bottom: 8px; }
}

@media (max-width: 767px) {
  .section-heading { gap: .5rem; }
  .section-heading h2 { font-size: 1.05rem; }
  .summary-box { position: static; }
  .blog-card img { height: 160px; }
  .auth-card { padding: 1.4rem 1rem; }
  .pagination { flex-wrap: wrap; }
  .product-gallery .main-image img { max-height: 360px; object-fit: cover; }
  .qty-input { max-width: 72px; }
}

@media (max-width: 575px) {
  .container { padding-inline: 12px; }
  .category-tile { padding: .9rem .35rem; font-size: .76rem; }
  .category-tile img, .category-tile-placeholder { width: 48px; height: 48px; }
  .new-price { font-size: .86rem; }
  .old-price { font-size: .72rem; }
  .back-to-top { bottom: 76px; left: 16px; }
}

/* ---------- Mobile bottom navigation (Digikala-style) ---------- */
.bottom-nav {
  display: none;
}
@media (max-width: 991.98px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 1070;
    height: 60px;
    background: #fff;
    border-top: 1px solid #e0e0e2;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
    justify-content: space-around;
    align-items: stretch;
    padding: 0 4px env(safe-area-inset-bottom);
  }
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #62666d;
  font-size: .68rem;
  font-weight: 500;
  min-width: 0;
  text-decoration: none;
}
.bottom-nav-item i {
  font-size: 1.45rem;
  line-height: 1;
}
.bottom-nav-item.is-active {
  color: var(--brand);
  font-weight: 700;
}
.bottom-nav-icon-wrap {
  position: relative;
  display: inline-flex;
}
.bottom-nav-badge {
  position: absolute;
  top: -6px;
  left: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Digikala-style category explorer ---------- */
.page-categories main {
  padding: 0;
}
.cat-explorer {
  display: flex;
  flex-direction: row;
  height: calc(100dvh - 86px);
  background: #fff;
  overflow: hidden;
}
@media (max-width: 991.98px) {
  .page-categories .site-footer { display: none; }
  .page-categories .back-to-top { display: none; }
  .cat-explorer {
    height: calc(100dvh - 118px);
    height: calc(100dvh - 118px - env(safe-area-inset-bottom));
  }
}
.cat-explorer-rail {
  width: 92px;
  flex: 0 0 92px;
  background: #f0f0f1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.cat-explorer-rail::-webkit-scrollbar { display: none; }
.cat-explorer-rail-item {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 6px 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #3f4064;
  position: relative;
  cursor: pointer;
}
.cat-explorer-rail-item.is-active {
  background: #fff;
  font-weight: 700;
}
.cat-explorer-rail-item.is-active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 0;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: var(--brand);
}
.cat-explorer-rail-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.cat-explorer-rail-item.is-active .cat-explorer-rail-icon {
  background: var(--brand-light);
}
.cat-explorer-rail-label {
  font-size: .68rem;
  line-height: 1.35;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-explorer-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 12px 24px;
  background: #fff;
}
.cat-explorer-all,
.cat-explorer-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #23254e;
  font-weight: 700;
  margin-bottom: 12px;
}
.cat-explorer-all {
  font-size: .92rem;
  padding: 4px 0 10px;
  border-bottom: 1px solid #f0f0f1;
  margin-bottom: 16px;
}
.cat-explorer-group { margin-bottom: 18px; }
.cat-explorer-group-title {
  font-size: .82rem;
  margin-bottom: 10px;
}
.cat-explorer-all i,
.cat-explorer-group-title i {
  color: #9e9fb2;
  font-size: 1rem;
}
.cat-explorer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 8px;
}
.cat-explorer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: #3f4064;
  min-width: 0;
}
.cat-explorer-thumb {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #f0f0f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cat-explorer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-explorer-thumb-ph {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 1.6rem;
  background: var(--brand-light);
}
.cat-explorer-name {
  font-size: .72rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}
@media (min-width: 992px) {
  .cat-explorer {
    max-width: 1100px;
    margin: 16px auto 32px;
    height: calc(100dvh - 140px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 28px var(--shadow);
  }
  .cat-explorer-rail { width: 140px; flex-basis: 140px; }
  .cat-explorer-rail-label { font-size: .78rem; }
  .cat-explorer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-explorer-mega {
    max-width: min(1180px, calc(100vw - 48px));
    margin: 0 auto;
    height: min(72vh, 640px);
  }
}

