/* ═══════════════════════════════════════════════════
   main.css — Lunari Store — Clean Modern RTL
   Aesthetic: Refined minimal, warm neutrals, bold accents
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary:    #3D35A8;
  --primary-l:  #5A52C5;
  --primary-xl: #EEEDFB;
  --accent:     #E8642A;
  --accent-l:   #FFF0E8;
  --success:    #1A9E6A;
  --success-l:  #E8F7F1;
  --danger:     #DC2626;
  --danger-l:   #FEE2E2;
  --warn:       #D97706;
  --warn-l:     #FEF3C7;
  --text:       #111827;
  --text-m:     #4B5563;
  --text-l:     #9CA3AF;
  --bg:         #FFFFFF;
  --bg-2:       #F9F8F6;
  --bg-3:       #F3F1EC;
  --border:     #E5E2D9;
  --border-l:   #F0EDE7;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12);
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --header-h:   64px;
  --nav-h:      44px;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Heebo', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 1.25rem; }

/* ═══ HEADER ════════════════════════════════════════ */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  height: var(--header-h);
  max-width: 1240px; margin: 0 auto; padding: 0 1.25rem;
}

/* Logo */
.site-logo {
  font-size: 1.5rem; font-weight: 900;
  color: var(--primary); letter-spacing: -.02em;
  flex-shrink: 0;
  display: flex; align-items: center; gap: .35rem;
}
.site-logo .logo-dot { color: var(--accent); }

/* Search */
.header-search {
  flex: 1; position: relative; max-width: 500px;
}
.header-search input {
  width: 100%; height: 42px;
  padding: 0 2.75rem 0 1rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: .9rem; font-family: inherit;
  background: var(--bg-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
  color: var(--text);
}
.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--primary-xl);
}
.header-search input::placeholder { color: var(--text-l); }
.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  font-size: .95rem; pointer-events: none; opacity: .5;
}

/* Search dropdown */
#search-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; display: none; z-index: 300;
}
#search-dropdown.open { display: block; }
.search-result {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem; transition: background .1s; cursor: pointer;
}
.search-result:hover { background: var(--bg-2); }
.search-result img { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.search-result .sr-name { font-size: .875rem; font-weight: 500; }
.search-result .sr-price { font-size: .82rem; color: var(--primary); font-weight: 600; margin-top: 1px; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: .3rem; flex-shrink: 0; }
.header-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 10px;
  font-size: 1.25rem; transition: background .12s; color: var(--text-m);
}
.header-btn:hover { background: var(--bg-2); color: var(--text); }
.cart-badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--accent); color: #fff;
  font-size: .65rem; font-weight: 700;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ═══ NAVIGATION BAR ════════════════════════════════ */
.site-nav {
  background: var(--bg);
  border-top: 1px solid var(--border-l);
}
.site-nav ul {
  display: flex; list-style: none; gap: 0;
  max-width: 1240px; margin: 0 auto; padding: 0 1.25rem;
  overflow-x: auto; scrollbar-width: none;
  overflow-y: visible; /* allow dropdown to show */
  position: relative;
}
.site-nav ul::-webkit-scrollbar { display: none; }
.site-nav li { flex-shrink: 0; position: relative; }
.site-nav a {
  display: flex; align-items: center; gap: .35rem;
  padding: 0 .875rem; height: var(--nav-h);
  font-size: .875rem; font-weight: 500; color: var(--text-m);
  white-space: nowrap;
  transition: color .12s;
  position: relative;
}
.site-nav a::after {
  content: ''; position: absolute; bottom: 0; right: 0; left: 0;
  height: 2px; background: var(--primary);
  transform: scaleX(0); transform-origin: center;
  transition: transform .2s ease;
}
.site-nav a:hover { color: var(--primary); }
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { color: var(--primary); font-weight: 600; }
.site-nav .nav-all { color: var(--primary); font-weight: 600; }

/* Mega dropdown */
.site-nav li:hover .nav-dropdown { opacity:1; visibility:visible; transform:translateY(0); }
/* ═══ MEGA MENU ══════════════════════════════════════════════ */
.site-nav .nav-caret {
  font-size: .6rem; opacity: .5; margin-right: .2rem;
  transition: transform .2s;
}
.site-nav li.has-dropdown:hover .nav-caret { transform: rotate(180deg); }
.site-nav .nav-icon { margin-left: .35rem; }
/* ── Mega Panel ─────────────────────────────────────────────
   li is position:relative (its own stacking context).
   Panel is display:none by default, shown on li:hover.
   A tall ::before pseudo on the li acts as a "bridge"
   between the link and the panel — mouse never leaves
   the hover zone while crossing the gap.
──────────────────────────────────────────────────────────── */
.site-nav li.has-dropdown { position: relative; }

.mega-panel {
  display: none;
  position: absolute;
  top: 100%;               /* flush with bottom of li */
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 2rem));
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.14);
  z-index: 9000;
  overflow: hidden;
  margin-top: 6px;         /* visual gap */
}

/* Bridge: tall transparent strip that connects li to panel.
   As long as mouse is anywhere in this zone, li stays :hovered. */
.site-nav li.has-dropdown::before {
  content: '';
  position: absolute;
  bottom: -6px;            /* sits in the visual gap */
  left: -60px;
  right: -60px;
  height: 12px;            /* taller than the gap */
  z-index: 9001;           /* above backdrop */
  display: none;           /* only shown while hovering */
}
.site-nav li.has-dropdown:hover::before { display: block; }

.site-nav li.has-dropdown:hover > .mega-panel,
.site-nav li.has-dropdown:focus-within > .mega-panel {
  display: block;
}


/* Mega backdrop — shown via CSS when any dropdown is open */
.mega-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.2);
  z-index: 8998;
  pointer-events: none;
}
.site-nav li.has-dropdown:hover ~ .mega-backdrop,
.has-dropdown:hover ~ * .mega-backdrop {
  display: block;
}

/* ═══ MEGA MENU RENDERER STYLES ═════════════════════════════ */

/* Panel inner columns */
.mega-panel-inner { padding: .75rem; }

/* Panel header variant (used by fallback) */
.mega-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; background: var(--primary-xl);
  border-bottom: 1px solid var(--border-l); margin: -.75rem -.75rem .75rem;
}
.mega-view-all {
  font-size: .78rem; font-weight: 700; color: #fff;
  text-decoration: none; padding: .3rem .75rem;
  background: var(--primary); border-radius: 20px;
  white-space: nowrap; transition: opacity .15s;
}
.mega-view-all:hover { opacity: .85; }

/* Columns */
.mega-col { padding: .375rem; }

/* Blocks */
.mega-block { margin-bottom: .875rem; }
.mega-block:last-child { margin-bottom: 0; }
.mega-block-title {
  font-size: .7rem; font-weight: 700; color: var(--text-l);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 0 .375rem .4rem; margin-bottom: .375rem;
  border-bottom: 1px solid var(--border-l);
}

/* Links group */
.mega-links { list-style: none; padding: 0; margin: 0; }
.mega-links li + li { margin-top: 1px; }
.mega-link {
  display: flex; align-items: center; gap: .45rem;
  padding: .45rem .5rem; border-radius: 7px;
  font-size: .84rem; color: var(--text);
  text-decoration: none; transition: background .12s, color .12s;
}
.mega-link::after { display: none !important; }
.mega-link:hover { background: var(--primary-xl); color: var(--primary); }
.mega-link-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; color: var(--text-l); }
.mega-link:hover .mega-link-icon { color: var(--primary); }
.mega-link-dot { color: var(--border); font-size: .9rem; }
.mega-link-badge {
  margin-right: auto; font-size: .65rem; font-weight: 700;
  background: var(--accent); color: #fff;
  padding: .1rem .4rem; border-radius: 10px;
}
.mega-entity-link { font-weight: 600; color: var(--primary); }

/* Brands grid */
.mega-brands { display: flex; flex-wrap: wrap; gap: .4rem; padding: .25rem 0; }
.mega-brand-pill {
  display: flex; align-items: center; justify-content: center;
  height: 36px; padding: .25rem .625rem;
  border: 1px solid var(--border-l); border-radius: 8px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
  text-decoration: none;
}
.mega-brand-pill:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.mega-brand-pill img { max-height: 24px; max-width: 70px; object-fit: contain; }
.mega-brand-init { font-size: .75rem; font-weight: 700; color: var(--primary); }

/* Featured products */
.mega-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.mega-product {
  display: flex; flex-direction: column; gap: .25rem;
  text-decoration: none; color: var(--text);
  padding: .5rem; border-radius: 8px;
  border: 1px solid var(--border-l); transition: border-color .15s;
}
.mega-product:hover { border-color: var(--primary); }
.mega-product img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 5px; }
.mega-product-name { font-size: .76rem; color: var(--text); line-height: 1.3; }
.mega-product-price { font-size: .8rem; font-weight: 700; color: var(--primary); }

/* Promo banner */
.mega-promo {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1rem; border-radius: 10px;
  text-decoration: none; transition: opacity .15s;
}
.mega-promo:hover { opacity: .9; }
.mega-promo-img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.mega-promo-text { display: flex; flex-direction: column; gap: .2rem; }
.mega-promo-text strong { font-size: .9rem; font-weight: 800; }
.mega-promo-text span  { font-size: .78rem; opacity: .8; }

/* Rich HTML */
.mega-rich { font-size: .84rem; line-height: 1.6; }
.mega-rich a { color: var(--primary); }

/* Nav badge */
.nav-badge {
  display: inline-block; font-size: .6rem; font-weight: 800;
  padding: .1rem .4rem; border-radius: 10px;
  background: var(--accent); color: #fff;
  margin-right: .25rem; vertical-align: middle;
  text-transform: uppercase; letter-spacing: .3px;
}

/* ═══ ADMIN BUILDER STYLES ═══════════════════════════════════ */
.mm-item {
  border: 1px solid var(--adm-border); border-radius: 10px;
  margin-bottom: .75rem; overflow: hidden;
}
.mm-item-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem .875rem; background: var(--adm-bg);
  cursor: default;
}
.mm-drag { cursor: grab; color: var(--adm-muted); font-size: 1.1rem; flex-shrink: 0; }
.mm-item-icon { font-size: 1.1rem; }
.mm-item-label { font-weight: 600; font-size: .875rem; flex: 1; }
.mm-item-type { font-size: .7rem; color: var(--adm-muted); }
.mm-tag { padding: .1rem .45rem; border-radius: 4px; font-size: .68rem; font-weight: 700; }
.mm-tag-off  { background: var(--adm-warn-l); color: var(--adm-warn); }
.mm-tag-mega { background: var(--adm-accent-l,#EEEDFB); color: var(--adm-accent); }
.mm-badge { padding: .1rem .45rem; border-radius: 10px; font-size: .68rem; font-weight: 700; color: #fff; }
.mm-del { background: none; border: none; cursor: pointer; color: var(--adm-danger); font-size: .9rem; padding: .1rem .3rem; border-radius: 4px; }
.mm-del:hover { background: var(--adm-danger-l,#FEE2E2); }
.mm-del-sm { background: none; border: none; cursor: pointer; color: var(--adm-muted); font-size: .78rem; padding: .1rem .25rem; }
.mm-del-sm:hover { color: var(--adm-danger); }
.mm-edit-btn { color: var(--adm-accent) !important; }
.mm-edit-btn:hover { background: var(--adm-accent-l,#EEEDFB) !important; color: var(--adm-accent) !important; }
.mm-item-bar .mm-del { margin-right: 0; }

/* Category row hover actions */
.cat-row-actions button:hover { opacity: .85; }

.mm-columns-wrap { padding: .75rem; background: var(--adm-bg); border-top: 1px solid var(--adm-border); }
.mm-columns { display: flex; gap: .625rem; overflow-x: auto; align-items: flex-start; padding-bottom: .25rem; }
.mm-col {
  min-width: 200px; flex-shrink: 0;
  background: #fff; border: 1px solid var(--adm-border);
  border-radius: 8px; padding: .625rem;
}
.mm-col-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.mm-block {
  background: var(--adm-bg); border: 1px solid var(--adm-border);
  border-radius: 6px; padding: .5rem; margin-bottom: .375rem;
}
.mm-block-header { display: flex; align-items: center; gap: .3rem; margin-bottom: .35rem; }
.mm-block-type { font-size: .7rem; font-weight: 700; color: var(--adm-accent); flex: 1; }
.mm-block-title-label { font-size: .7rem; color: var(--adm-muted); }
.mm-links { padding: 0; }
.mm-link-row {
  display: flex; align-items: center; gap: .4rem;
  padding: .2rem 0; border-bottom: 1px solid var(--adm-border);
  font-size: .75rem;
}
.mm-link-url { color: var(--adm-muted); font-size: .68rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-add-link { font-size: .72rem; color: var(--adm-accent); background: none; border: none; cursor: pointer; padding: .2rem 0; margin-top: .2rem; }
.mm-add-block {
  width: 100%; font-size: .75rem; background: none;
  border: 1px dashed var(--adm-border); border-radius: 6px;
  padding: .4rem; cursor: pointer; color: var(--adm-muted);
  margin-top: .25rem;
}
.mm-add-block:hover { border-color: var(--adm-accent); color: var(--adm-accent); }
.mm-add-col {
  min-width: 80px; border: 2px dashed var(--adm-border);
  border-radius: 8px; background: none; cursor: pointer;
  color: var(--adm-muted); padding: 1rem .5rem;
  font-size: .78rem; align-self: stretch;
}
.mm-add-col:hover { border-color: var(--adm-accent); color: var(--adm-accent); }

/* ═══ MOBILE DRAWER ══════════════════════════════════════════ */
.hamburger {
  display: none; /* shown via media query */
  flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: .5rem; border-radius: 8px;
  width: 38px; height: 38px; flex-shrink: 0;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(340px, 90vw);
  background: var(--bg); z-index: 9100;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,.14);
  overflow: hidden;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 9099;
}
.mobile-overlay.show { display: block; }

.mobile-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border-l);
  flex-shrink: 0;
}
.mobile-drawer-title { font-size: 1rem; font-weight: 800; }
.mobile-close-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--text-l); line-height: 1;
  padding: .25rem;
}
.mobile-nav { flex: 1; overflow-y: auto; }
.mobile-nav-list { list-style: none; padding: .5rem 0; margin: 0; }
.mobile-item + .mobile-item { border-top: 1px solid var(--border-l); }
.mobile-item-row { display: flex; align-items: center; }
.mobile-nav-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .8rem 1.25rem; color: var(--text); font-size: .9rem;
  text-decoration: none; flex: 1;
  transition: background .12s;
}
.mobile-nav-link:hover { background: var(--bg-2); }
.mobile-nav-link::after { display: none !important; }
.mobile-nav-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.mobile-badge {
  margin-right: auto; font-size: .65rem; font-weight: 700;
  background: var(--accent); color: #fff;
  padding: .1rem .4rem; border-radius: 10px;
}
.mobile-acc-btn {
  background: none; border: none; cursor: pointer;
  padding: .8rem 1.25rem; color: var(--text-l); font-size: 1.1rem;
}
.mobile-acc-caret { display: inline-block; transition: transform .2s; font-style: normal; }
.mobile-sub { list-style: none; padding: 0; margin: 0; background: var(--bg-2); }
.mobile-sub-all { font-size: .82rem; font-weight: 700; color: var(--primary); }
.mobile-sub-heading {
  padding: .45rem 1.5rem .2rem;
  font-size: .68rem; font-weight: 700; color: var(--text-l);
  text-transform: uppercase; letter-spacing: .5px;
}
.mobile-sub-link { padding-right: 2rem; font-size: .85rem; }
.mobile-drawer-footer {
  display: flex; gap: 0; border-top: 1px solid var(--border-l);
  flex-shrink: 0;
}
.mobile-footer-link {
  flex: 1; text-align: center; padding: .875rem .5rem;
  font-size: .82rem; font-weight: 600; color: var(--primary);
  text-decoration: none; transition: background .12s;
}
.mobile-footer-link:hover { background: var(--primary-xl); }
.mobile-footer-link + .mobile-footer-link { border-right: 1px solid var(--border-l); }

/* Show hamburger / hide desktop nav on mobile */
@media (max-width: 768px) {
  .site-nav { display: none !important; }
  .hamburger { display: flex !important; }
  .mega-backdrop { display: none !important; }
}

/* ═══ HERO SECTION ══════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-l) 60%, #7C6FF0 100%);
  color: #fff; text-align: center;
  padding: 5rem 1.25rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 900; margin-bottom: .875rem; line-height: 1.2; }
.hero p  { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; max-width: 500px; margin-left: auto; margin-right: auto; }

/* ═══ SECTION TITLE ════════════════════════════════ */
.section-title {
  font-size: 1.35rem; font-weight: 800;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .75rem;
}
.section-title::before {
  content: ''; width: 4px; height: 1.4em;
  background: var(--primary); border-radius: 2px; flex-shrink: 0;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.section-header .section-title { margin-bottom: 0; }

/* ═══ CATEGORY GRID (Home) ══════════════════════════ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px,1fr));
  gap: .875rem;
}
.cat-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem .875rem 1rem;
  background: var(--bg-2); border: 1.5px solid var(--border-l);
  border-radius: var(--radius-lg); text-align: center;
  transition: all .18s; cursor: pointer; text-decoration: none; color: inherit;
}
.cat-card:hover {
  border-color: var(--primary); background: var(--primary-xl);
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.cat-card .cat-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: .75rem;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all .18s;
}
.cat-card:hover .cat-icon { border-color: var(--primary); background: var(--primary-xl); }
.cat-card .cat-name { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.cat-card .cat-count { font-size: .74rem; color: var(--text-l); margin-top: .2rem; }

/* ═══ PRODUCT GRID ══════════════════════════════════ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 1.25rem;
}

/* Product card */
.product-card, .product-card-link {
  background: var(--bg); border: 1.5px solid var(--border-l);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: all .2s; display: flex; flex-direction: column;
  text-decoration: none; color: inherit; cursor: pointer;
}
.product-card:hover, .product-card-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.product-card .img-wrap, .product-card-link .img-wrap {
  position: relative; overflow: hidden;
  background: var(--bg-2);
  aspect-ratio: 1;
}
.product-card img, .product-card-link img {
  width: 100%; height: 100%;
  object-fit: contain; padding: .75rem;
  transition: transform .3s ease;
}
.product-card:hover img, .product-card-link:hover img { transform: scale(1.04); }
.product-card .badge-sale {
  position: absolute; top: .6rem; right: .6rem;
  background: var(--accent); color: #fff;
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 100px;
}
.product-card .badge-new {
  position: absolute; top: .6rem; right: .6rem;
  background: var(--success); color: #fff;
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 100px;
}
.product-card .card-body, .product-card-link .card-body {
  padding: .875rem; flex: 1; display: flex; flex-direction: column; gap: .3rem;
}
.product-card .card-brand {
  font-size: .72rem; color: var(--text-l); font-weight: 500; text-transform: uppercase; letter-spacing: .5px;
}
.product-card .card-name {
  font-size: .9rem; font-weight: 600; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.product-card .card-rating {
  display: flex; align-items: center; gap: .3rem;
  font-size: .78rem; color: var(--warn);
}
.product-card .card-rating .rc { color: var(--text-l); font-size: .72rem; }
.product-card .card-price-row {
  display: flex; align-items: center; gap: .5rem; margin-top: auto; padding-top: .4rem;
}
.product-card .price { font-size: 1.05rem; font-weight: 800; color: var(--primary); }
.product-card .old-price { font-size: .82rem; color: var(--text-l); text-decoration: line-through; }
.product-card .card-footer {
  padding: .625rem .875rem;
  border-top: 1px solid var(--border-l);
}
.product-card .card-footer .btn {
  width: 100%; font-size: .85rem; padding: .55rem;
}

/* ═══ BUTTONS ════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .65rem 1.5rem; border-radius: 100px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; transition: all .15s;
  text-decoration: none; white-space: nowrap; font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-l); border-color: var(--primary-l); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-xl); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #C8521F; border-color: #C8521F; }
.btn-ghost { background: transparent; color: var(--text-m); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-sm { padding: .4rem 1rem; font-size: .82rem; }
.btn-lg { padding: .875rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ═══ PRODUCT PAGE ══════════════════════════════════ */
.product-layout {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: 3rem; margin: 2rem 0;
}

/* Product images */
.product-images { position: sticky; top: calc(var(--header-h) + var(--nav-h) + 1rem); align-self: start; }
.main-img {
  background: var(--bg-2); border-radius: var(--radius-xl);
  overflow: hidden; aspect-ratio: 1; margin-bottom: .75rem;
  border: 1.5px solid var(--border-l);
}
.main-img img { width: 100%; height: 100%; object-fit: contain; padding: 1.5rem; transition: transform .4s ease; }
.main-img:hover img { transform: scale(1.05); }
.product-thumbs {
  display: flex; gap: .5rem; flex-wrap: wrap;
}
.product-thumbs img {
  width: 68px; height: 68px; border-radius: var(--radius);
  object-fit: contain; padding: .3rem;
  border: 2px solid var(--border); cursor: pointer;
  background: var(--bg-2); transition: border-color .12s;
}
.product-thumbs img.active, .product-thumbs img:hover { border-color: var(--primary); background: var(--primary-xl); }

/* Product info */
.product-info { display: flex; flex-direction: column; gap: 0; }

.product-brand {
  font-size: .78rem; font-weight: 600;
  color: var(--text-l); text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: .5rem;
}
.product-info h1 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800; line-height: 1.25;
  margin-bottom: .75rem; color: var(--text);
}

/* Rating */
.product-rating { display: flex; align-items: center; gap: .6rem; margin-bottom: .875rem; }
.stars { color: var(--warn); font-size: 1rem; letter-spacing: .1em; }
.rating-count { font-size: .82rem; color: var(--text-l); }
.rating-count a { color: var(--primary); }

/* Price */
.product-price {
  display: flex; align-items: baseline; gap: .75rem;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  background: var(--primary-xl); border-radius: var(--radius-lg);
}
.product-price .price {
  font-size: 2rem; font-weight: 900; color: var(--primary); line-height: 1;
}
.product-price .old  { font-size: 1.1rem; color: var(--text-l); text-decoration: line-through; }
.product-price .save {
  font-size: .78rem; font-weight: 700; padding: 3px 10px;
  background: var(--accent); color: #fff; border-radius: 100px;
}

/* Short desc */
.product-short-desc {
  font-size: .9rem; color: var(--text-m); line-height: 1.7;
  margin-bottom: 1rem;
}

/* Stock badges */
.in-stock  { display:inline-flex;align-items:center;gap:.35rem;font-size:.82rem;font-weight:600;color:var(--success);background:var(--success-l);padding:4px 12px;border-radius:100px;margin-bottom:.875rem; }
.out-stock { display:inline-flex;align-items:center;gap:.35rem;font-size:.82rem;font-weight:600;color:var(--danger);background:var(--danger-l);padding:4px 12px;border-radius:100px;margin-bottom:.875rem; }
.low-stock { display:inline-flex;align-items:center;gap:.35rem;font-size:.82rem;font-weight:600;color:var(--warn);background:var(--warn-l);padding:4px 12px;border-radius:100px;margin-bottom:.875rem; }

/* Variants */
.variant-group { margin-bottom: 1rem; }
.variant-group label { display:block;font-size:.82rem;font-weight:600;color:var(--text-m);margin-bottom:.5rem; }
.variant-label-selected { color: var(--primary); }
.variant-options { display:flex;flex-wrap:wrap;gap:.4rem; }
.variant-btn {
  padding: .4rem .9rem; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--bg);
  font-size: .85rem; cursor: pointer; transition: all .12s; font-family: inherit;
}
.variant-btn:hover { border-color: var(--primary); color: var(--primary); }
.variant-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.variant-btn.out { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.variant-color-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--border);
  cursor: pointer; transition: all .12s;
}
.variant-color-btn.selected { border-color: var(--primary); transform: scale(1.15); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }

/* Add to cart row */
.add-to-cart-row {
  display: flex; gap: .75rem; align-items: stretch;
  margin: 1.25rem 0;
}
.qty-control {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 100px;
  overflow: hidden; flex-shrink: 0;
}
.qty-control button {
  width: 40px; height: 46px; border: none; background: var(--bg-2);
  font-size: 1.1rem; cursor: pointer; color: var(--text-m);
  transition: background .12s;
}
.qty-control button:hover { background: var(--primary-xl); color: var(--primary); }
.qty-control input {
  width: 50px; text-align: center; border: none;
  font-size: 1rem; font-weight: 600; outline: none; font-family: inherit;
}

/* Wishlist / share */
.product-actions-row { display:flex;gap:.5rem;margin-bottom:1.25rem; }
.action-pill {
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.45rem 1rem;border-radius:100px;border:1.5px solid var(--border);
  font-size:.82rem;color:var(--text-m);background:var(--bg);cursor:pointer;
  transition:all .12s;
}
.action-pill:hover { border-color:var(--primary);color:var(--primary);background:var(--primary-xl); }

/* Product meta info */
.product-meta-info {
  padding: 1rem 0;
  border-top: 1px solid var(--border-l);
  display: flex; flex-direction: column; gap: .5rem;
}
.product-meta-row {
  display: flex; align-items: center; gap: .75rem;
  font-size: .85rem;
}
.product-meta-row .meta-label { color: var(--text-l); min-width: 80px; font-weight: 500; }
.product-meta-row .meta-value { color: var(--text); font-weight: 500; }

/* ═══ PRODUCT TABS (details) ════════════════════════ */
.product-tabs-wrap { margin: 2.5rem 0; }
.product-tabs {
  display: flex; border-bottom: 2px solid var(--border);
  margin-bottom: 0; gap: 0;
}
.product-tab-btn {
  padding: .75rem 1.5rem; font-size: .9rem; font-weight: 600;
  color: var(--text-l); cursor: pointer; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .12s, border-color .12s; font-family: inherit;
}
.product-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.product-tab-content {
  padding: 1.75rem; background: var(--bg-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--border); border-top: none;
  line-height: 1.8; color: var(--text-m); font-size: .9rem;
}
.product-tab-content h2,h3,h4 { color:var(--text);margin-bottom:.5rem; }
.product-tab-content ul { padding-right: 1.25rem; }

/* ═══ FOOTER ════════════════════════════════════════ */
/* Footer vars */
.site-footer {
  background: #16192a; color: #9CA3AF;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3,1fr);
  gap: 3rem;
  padding: 3rem 1.25rem;
  max-width: 1240px; margin: 0 auto;
}
.footer-col h4 {
  font-size: .82rem; font-weight: 700; color: #fff;
  text-transform: uppercase; letter-spacing: .7px;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col a { color: #9CA3AF; font-size: .875rem; transition: color .12s; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: .875rem; line-height: 1.7; }
.footer-logo { font-size: 1.4rem; font-weight: 900; color: #fff; margin-bottom: .75rem; display: block; }
.footer-bottom {
  border-top: 1px solid #2a2d3a;
  text-align: center; padding: 1.25rem;
  font-size: .8rem; color: #6B7280;
}

/* ═══ TOAST ══════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: #1a1a2e; color: #fff;
  padding: .75rem 1.5rem; border-radius: 100px;
  font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); white-space: nowrap;
  animation: toastIn .25s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warn); }
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ═══ BREADCRUMB ════════════════════════════════════ */
.breadcrumb {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text-l);
  padding: .875rem 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-l); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: .4; }
.breadcrumb .current { color: var(--text); }

/* ═══ CART ═══════════════════════════════════════════ */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; margin: 1.5rem 0; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; font-size: .875rem; background: #fff; border: 1.5px solid var(--border-l); border-radius: var(--radius-lg); overflow: hidden; }
.cart-table thead { background: var(--bg-2); }
.cart-table th { text-align: right; padding: .75rem 1rem; font-size: .78rem; font-weight: 600; color: var(--text-l); background: var(--bg-2); border-bottom: 2px solid var(--border); }
.cart-table td { padding: .875rem 1rem; border-bottom: 1px solid var(--border-l); vertical-align: middle; }
.cart-item-img { width: 64px; height: 64px; border-radius: var(--radius); object-fit: contain; background: var(--bg-2); padding: 4px; border: 1px solid var(--border-l); flex-shrink: 0; }
.cart-item-name { font-weight: 600; font-size: .9rem; }
.cart-item-name a { color: var(--text); }
.cart-item-name a:hover { color: var(--primary); }
.cart-item-variant { font-size: .78rem; color: var(--text-l); margin-top: .2rem; }
.cart-summary { background: #fff; border: 1.5px solid var(--border-l); border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.cart-summary h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: .45rem 0; font-size: .875rem; }
.summary-row.total { font-size: 1.1rem; font-weight: 800; color: var(--primary); border-top: 2px solid var(--border); margin-top: .5rem; padding-top: .75rem; }
.coupon-row { display: flex; gap: .5rem; margin: .875rem 0; }
.coupon-row input { flex: 1; padding: .55rem .875rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: .875rem; font-family: inherit; }
.coupon-row input:focus { outline: none; border-color: var(--primary); }
.cart-item-img { width: 64px; height: 64px; border-radius: var(--radius); object-fit: contain; background: var(--bg-2); padding: 4px; }
.cart-item-name { font-weight: 600; font-size: .9rem; }
.cart-item-variant { font-size: .78rem; color: var(--text-l); }

/* Qty control in cart */
.qty-control input { width: 44px; }

/* ═══ REVIEWS ════════════════════════════════════════ */
.review-card { padding: 1.25rem; background: var(--bg-2); border-radius: var(--radius-lg); margin-bottom: .875rem; border: 1px solid var(--border-l); }
.review-card .reviewer { font-weight: 600; font-size: .875rem; }
.review-card .review-date { font-size: .75rem; color: var(--text-l); }
.review-card .review-text { font-size: .875rem; color: var(--text-m); margin-top: .5rem; line-height: 1.7; }

/* ═══ FORMS ══════════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-m); }
.form-control {
  width: 100%; padding: .65rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit; background: var(--bg);
  transition: border-color .15s, box-shadow .15s; color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-xl); }
.form-control::placeholder { color: var(--text-l); }

/* ═══ PAGINATION ════════════════════════════════════ */
.pagination { display: flex; gap: .4rem; justify-content: center; padding: 1.5rem 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: .85rem; transition: all .12s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ═══ BLOG ════════════════════════════════════════════ */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1.25rem; }
.post-card { background: var(--bg); border: 1.5px solid var(--border-l); border-radius: var(--radius-lg); overflow: hidden; transition: all .18s; }
.post-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card img { width: 100%; height: 185px; object-fit: cover; }
.post-body { padding: 1rem; }
.post-meta { font-size: .75rem; color: var(--text-l); margin-bottom: .4rem; }
.post-title { font-weight: 700; font-size: .95rem; margin-bottom: .4rem; line-height: 1.35; }
.post-excerpt { font-size: .83rem; color: var(--text-m); line-height: 1.6; }

/* ═══ MOBILE ═════════════════════════════════════════ */
@media (max-width: 900px) {
  .product-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .product-images { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 600px) {
  :root { --header-h: 56px; }
  .hero { padding: 3rem 1rem; }
  .products-grid { grid-template-columns: repeat(2,1fr); gap: .75rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(3,1fr); gap: .6rem; }
}


/* ═══ PRODUCT CARD BADGES ════════════════════════════════════ */
.badge {
  position: absolute;
  top: .6rem;
  right: .6rem;
  padding: .25rem .625rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
  z-index: 2;
  line-height: 1.4;
}
.badge-sale     { background: #e63946; color: #fff; }
.badge-new      { background: #2a9d8f; color: #fff; }
.badge-clearance{ background: linear-gradient(135deg,#f77f00,#e63946); color:#fff; font-size:.68rem; }
.badge-outofstock{ background: rgba(0,0,0,.55); color: #fff; }
.badge-discount-pill {
  display: inline-block;
  padding: .1rem .45rem;
  background: #e63946;
  color: #fff;
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 700;
  margin-right: .3rem;
}

/* Price variants */
.price-sale   { color: #e63946 !important; }
.price-soldout{ color: var(--text-l) !important; }

/* Out of stock card dim */
.out-of-stock-card .img-wrap { filter: grayscale(40%); }
.out-of-stock-card .card-body { opacity: .7; }

/* Quick add hover overlay */
.card-quick-add {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: .65rem;
  font-size: .82rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity .2s, transform .2s;
  cursor: pointer;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.product-card:hover .card-quick-add {
  opacity: 1;
  transform: translateY(0);
}

/* ═══ BRANDS CAROUSEL ════════════════════════════════════════ */
.brands-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.brands-carousel::-webkit-scrollbar { display: none; }

.brand-card-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1rem .875rem;
  background: #fff;
  border: 1.5px solid var(--border-l);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: inherit;
  min-width: 110px;
  max-width: 130px;
  flex-shrink: 0;
  transition: all .2s;
}
.brand-card-mini:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.brand-card-mini img {
  height: 44px;
  max-width: 90px;
  object-fit: contain;
}
.brand-initial {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary-xl);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
}
.brand-mini-name {
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

/* ═══ FOOTER MEGA MENU ═══════════════════════════════════════ */
.footer-mega-grid h4 a:hover { color: var(--accent) !important; }
.footer-mega-grid ul { list-style: none; padding: 0; margin: .5rem 0 0; }
.footer-mega-grid ul li + li { margin-top: .3rem; }
.footer-mega-grid ul a { font-size: .84rem; color: #9ca3af; text-decoration: none; transition: color .15s; }
.footer-mega-grid ul a:hover { color: #fff; }

/* ═══ ADMIN BUILDER: block config modal textarea fix ═════════ */
#bcm-rich-html { font-family: 'Fira Code', 'Courier New', monospace; font-size: .78rem; }
