/* ===== إتقان - Theme tokens ===== */
:root {
  --bg: #F8F8F3; --surface: #FFFFFF; --surface2: #F1F4EE;
  --text: #14201A; --muted: #56635B; --border: #E2E7DE;
  --green: #1B7A3A; --green-soft: #E3F0E5; --on-green: #FFFFFF;
  --orange: #C4500C; --orange-soft: #FCEBDD; --on-orange: #FFFFFF;
  --hero: #EDF4EA;
  --footer: #0F2618; --footer-text: #D8E4DB; --footer-muted: #A3B6A8;
  --shadow: 0 22px 44px -26px rgba(0,0,0,.35);
  --font-head: 'Alexandria', sans-serif;
  --font-body: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0B120E; --surface: #131D17; --surface2: #1A261F;
  --text: #EDF2EE; --muted: #A4B2A9; --border: #26352C;
  --green: #46C26F; --green-soft: #16301F; --on-green: #06120A;
  --orange: #F47F35; --orange-soft: #33200F; --on-orange: #1A0C03;
  --hero: #101B14;
  --footer: #070C09; --footer-text: #D8E4DB; --footer-muted: #93A69A;
  --shadow: 0 22px 44px -26px rgba(0,0,0,.8);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  transition: background .35s, color .35s;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
input::placeholder { color: var(--muted); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.theme-t { transition: background .35s, color .35s, border-color .35s; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 26px; border-radius: 16px; border: 0;
  font-weight: 700; font-size: 16px; cursor: pointer;
  transition: transform .15s, filter .15s, background .2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn-green { background: var(--green); color: var(--on-green); }
.btn-orange { background: var(--orange); color: var(--on-orange); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); font-weight: 600; }
.btn-outline { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-green:hover, .btn-orange:hover, .btn-ghost:hover { color: inherit; }
.btn-green:hover { color: var(--on-green); } .btn-orange:hover { color: var(--on-orange); } .btn-ghost:hover { color: var(--text); }
.icon-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .15s, background .2s;
}
.icon-btn:active { transform: scale(.95); }

/* ===== Top bar ===== */
.topbar { background: var(--green); color: var(--on-green); font-size: 13px; }
.topbar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-block: 8px; }
.topbar span, .topbar a { display: inline-flex; align-items: center; gap: 8px; }
.topbar a:hover { color: inherit; opacity: .85; }
.topbar .end { display: flex; gap: 18px; }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--border); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.logo-chip { width: 58px; height: 58px; padding: 4px; background: #fff; border-radius: 16px; border: 1px solid var(--border); }
.logo-chip img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name b { font-family: var(--font-head); font-weight: 800; font-size: 22px; color: var(--green); }
.brand-name small { font-size: 12px; color: var(--muted); }
.search { flex: 1 1 280px; max-width: 520px; margin: 0 auto; position: relative; }
.search input {
  width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text); font-size: 15px; padding: 0 48px 0 16px;
}
.search .icon { position: absolute; right: 16px; top: 14px; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 10px; }
.login { height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.cart-btn { height: 48px; padding: 0 18px; border-radius: 14px; background: var(--green); color: var(--on-green); display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.cart-btn:hover { color: var(--on-green); filter: brightness(1.08); }
.cart-count { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cart-count.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.35); } }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
.main-nav { display: flex; flex-wrap: wrap; gap: 6px 28px; padding-bottom: 12px; font-weight: 600; font-size: 15px; }
.main-nav a.active { color: var(--green); }

/* ===== Hero slider ===== */
.hero { padding-top: 20px; }
.hero-box {
  position: relative; overflow: hidden; background: var(--hero); border-radius: 32px;
  padding: 32px 56px 24px; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
}
.deco-ring { position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid var(--green-soft); left: -140px; bottom: -180px; }
.deco-dot { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: var(--orange-soft); right: 46%; top: -40px; }
.slides { position: relative; display: grid; }
.slide {
  grid-area: 1 / 1; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; align-items: center;
  opacity: 0; visibility: hidden; transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1), visibility .7s;
  --accent: var(--green); --accent-soft: var(--green-soft); --on-accent: var(--on-green);
}
.slide.is-active { opacity: 1; visibility: visible; transform: none; }
.slide--orange { --accent: var(--orange); --accent-soft: var(--orange-soft); --on-accent: var(--on-orange); }
.slide-text { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.pill { padding: 6px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.slide h1 { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: clamp(30px, 2.8vw, 40px); line-height: 1.35; }
.slide p { margin: 0; font-size: 18px; color: var(--muted); max-width: 520px; }
.slide .btns { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { color: var(--on-accent); }
.slide-media { position: relative; padding: 12px 12px 18px; }
.img-ph {
  aspect-ratio: 16 / 10; border-radius: 28px; background: var(--surface); border: 2px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); text-align: center; overflow: hidden;
}
.img-ph img { width: 100%; height: 100%; object-fit: cover; }
.img-ph .ph-icon { width: 72px; height: 72px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.img-ph strong { color: var(--text); }
.img-ph small { font-size: 13px; }
.float-badge {
  position: absolute; bottom: -6px; right: -8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
  animation: floaty 5s ease-in-out infinite;
}
.float-badge .ok { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.float-badge span { display: flex; flex-direction: column; line-height: 1.35; }
.float-badge b { font-size: 14px; }
.float-badge small { font-size: 12px; color: var(--muted); }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.slider-controls { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.dots { display: flex; gap: 8px; align-items: center; }
.dots button { height: 10px; width: 10px; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: var(--muted); transition: width .35s, background .35s; }
.dots button.is-active { width: 32px; background: var(--green); }
.arrows { display: flex; align-items: center; gap: 14px; }
.counter { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--muted); }
.counter b { color: var(--text); font-weight: 600; }
.round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s; }
.round:active { transform: scale(.94); }
.round.primary { background: var(--green); color: var(--on-green); border: 0; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: var(--orange); }
.progress i.run { animation: prog 6s linear forwards; }
@keyframes prog { to { width: 100%; } }

/* ===== Features ===== */
.features { padding-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature { display: flex; gap: 14px; align-items: center; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.feature .ic { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex: none; }
.ic.g { background: var(--green-soft); color: var(--green); }
.ic.o { background: var(--orange-soft); color: var(--orange); }
.feature span { display: flex; flex-direction: column; line-height: 1.4; }
.feature small { font-size: 14px; color: var(--muted); }

/* ===== Sections ===== */
.section { padding-top: 72px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.eyebrow { color: var(--orange); font-weight: 700; font-size: 14px; }
.section-head h2, .center-head h2 { margin: 4px 0 0; font-family: var(--font-head); font-weight: 700; font-size: 34px; }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--green); }
.center-head { text-align: center; margin-bottom: 36px; }

.card { transition: transform .25s, box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green); }

/* Categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.cat {
  color: var(--text); text-align: center; cursor: pointer; padding: 26px 16px 22px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.cat .circle { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cat .circle .icon { width: 36px; height: 36px; stroke-width: 1.6; }
.cat span { display: flex; flex-direction: column; line-height: 1.4; }
.cat small { font-size: 13px; color: var(--muted); }

/* Products */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.tab[aria-pressed="true"] { background: var(--green); color: var(--on-green); border-color: var(--green); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.product { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.product.is-hidden { display: none; }
.product.pop { animation: fadeUp .45s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.p-img { position: relative; aspect-ratio: 1 / 1; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 600; overflow: hidden; }
.p-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-img .icon { width: 44px; height: 44px; stroke-width: 1.5; }
.tone-g { background: var(--green-soft); color: var(--green); }
.tone-o { background: var(--orange-soft); color: var(--orange); }
.badge { position: absolute; top: 12px; right: 12px; padding: 4px 12px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font-size: 12px; font-weight: 700; }
.p-info { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.p-info small { font-size: 13px; color: var(--muted); }
.p-info h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.45; }
.p-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 4px; margin-top: auto; }
.price { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--green); }
.price small { font-size: 13px; font-weight: 500; }
.add-btn { height: 44px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--green); color: var(--on-green); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: background .2s, transform .15s; }
.add-btn:active { transform: scale(.96); }
.add-btn.done { background: var(--orange); color: var(--on-orange); }
.add-btn .i-check { display: none; }
.add-btn.done .i-check { display: block; }
.add-btn.done .i-plus { display: none; }
.center { display: flex; justify-content: center; padding-top: 32px; }

/* Wholesale */
.wholesale {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center;
  background: var(--orange-soft); border-radius: 32px; padding: 56px 64px; position: relative; overflow: hidden;
}
.wholesale::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 40px solid var(--orange); opacity: .12; left: -60px; top: -80px; }
.wholesale .txt { position: relative; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.wholesale .pill { background: var(--orange); color: var(--on-orange); }
.wholesale h2 { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 38px; line-height: 1.35; }
.wholesale p { margin: 0; color: var(--muted); font-size: 17px; max-width: 520px; }
.wholesale .btns { display: flex; flex-wrap: wrap; gap: 12px; }
.checks { position: relative; list-style: none; margin: 0; padding: 28px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; }
.checks li { display: flex; gap: 14px; align-items: flex-start; }
.checks .ck { width: 34px; height: 34px; border-radius: 10px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; flex: none; }
.checks small { color: var(--muted); font-size: 14px; display: block; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0 0 88px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.step { padding: 32px 28px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.step .num { font-family: var(--font-head); font-weight: 800; font-size: 44px; line-height: 1; color: var(--green); }
.step:nth-child(2) .num { color: var(--orange); }
.step b { font-size: 19px; }
.step span { color: var(--muted); }

/* Footer */
.site-footer { background: var(--footer); color: var(--footer-text); }
.site-footer a:hover { color: #F4A066; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 36px; padding-block: 56px 40px; }
.foot-col { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.foot-col h4 { margin: 0 0 4px; color: #fff; font-size: 16px; }
.foot-col .row { display: flex; gap: 10px; align-items: center; }
.foot-logo { width: 84px; height: 84px; padding: 6px; background: #fff; border-radius: 22px; }
.foot-logo img { width: 100%; height: 100%; object-fit: contain; }
.foot-about { margin: 6px 0 0; color: var(--footer-muted); font-size: 14px; }
.newsletter { display: flex; gap: 8px; margin-top: 6px; }
.newsletter input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font-size: 14px; padding: 0 14px; }
.newsletter input::placeholder { color: #A3B6A8; }
.newsletter button { height: 46px; padding: 0 18px; border-radius: 12px; border: 0; background: #F47F35; color: #1A0C03; font-weight: 700; cursor: pointer; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); }
.foot-bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 18px; font-size: 13px; color: var(--footer-muted); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); z-index: 100;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 14px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.toast.show { transform: translate(-50%, 0); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-box { padding: 28px 22px; min-height: 0; }
  .slide, .wholesale { grid-template-columns: 1fr; gap: 28px; }
  .wholesale { padding: 32px 22px; }
  .slide h1 { font-size: 28px; }
  .section-head h2, .center-head h2, .wholesale h2 { font-size: 26px; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================
   صفحة المنتجات + تفاصيل المنتج
   ===================================================== */
.p-info h3 a:hover { color: var(--green); }
.p-img-link { display: block; color: inherit; }
.p-img-link:hover { color: inherit; }

/* Breadcrumb + page head */
.page-head { padding-top: 28px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.breadcrumb li { display: flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "‹"; color: var(--muted); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }
.page-banner {
  margin-top: 16px; background: var(--hero); border-radius: 28px; padding: 36px 40px; position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px;
}
.page-banner::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 40px solid var(--green-soft); left: -80px; top: -120px; }
.page-banner > * { position: relative; }
.page-banner h1 { margin: 4px 0 0; font-family: var(--font-head); font-weight: 800; font-size: 38px; line-height: 1.3; }
.page-banner p { margin: 6px 0 0; color: var(--muted); }

/* Shop layout */
.shop { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 28px; padding-bottom: 88px; }
.filters { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 150px; }
.filter-box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; }
.filter-box h3 { margin: 0 0 14px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.filter-box h3 button { background: none; border: 0; color: var(--orange); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 15px; }
.check-row span { display: flex; align-items: center; gap: 10px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; cursor: pointer; }
.check-row small { color: var(--muted); font-size: 13px; }
.price-inputs { display: flex; gap: 10px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; font-size: 13px; color: var(--muted); }
.field input, .select {
  height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  padding: 0 12px; font-size: 15px; width: 100%;
}
.range { width: 100%; accent-color: var(--green); margin-top: 12px; }
.filter-apply { width: 100%; height: 48px; margin-top: 4px; font-size: 15px; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 10px 12px 10px 16px; margin-bottom: 20px;
}
.toolbar .count { color: var(--muted); font-size: 15px; }
.toolbar .count b { color: var(--text); }
.toolbar .end { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .select { width: auto; min-width: 190px; height: 44px; cursor: pointer; }
.view-toggle { display: flex; gap: 4px; background: var(--surface2); border-radius: 12px; padding: 4px; }
.view-toggle button { width: 38px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.view-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--green); box-shadow: 0 2px 8px -4px rgba(0,0,0,.3); }
.filter-toggle { display: none; }

.products.grid-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.products.list-view { grid-template-columns: 1fr; }
.products.list-view .product { flex-direction: row; align-items: stretch; }
.products.list-view .p-img-link { width: 200px; flex: none; }
.products.list-view .p-info { flex: 1; justify-content: center; }
.products.list-view .p-foot { flex-direction: column; justify-content: center; align-items: flex-end; margin: 0; }

.empty { display: none; text-align: center; padding: 48px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 24px; }
.empty.show { display: block; }

.pagination { display: flex; justify-content: center; gap: 8px; padding-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 46px; height: 46px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
}
.pagination [aria-current="page"] { background: var(--green); color: var(--on-green); border-color: var(--green); }
.pagination .dots-gap { border: 0; background: none; }

/* Product details */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; padding-top: 24px; }
.gallery { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 150px; }
.gallery-main {
  position: relative; aspect-ratio: 1 / 1; border-radius: 28px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-weight: 600;
}
.gallery-main .icon { width: 64px; height: 64px; stroke-width: 1.3; }
.gallery-main .badge { top: 18px; right: 18px; font-size: 13px; padding: 6px 14px; }
.gallery-main small { font-weight: 500; font-size: 13px; opacity: .85; }
.gallery-main .label { transition: opacity .25s; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.thumb {
  aspect-ratio: 1 / 1; border-radius: 16px; border: 2px solid transparent; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; transition: border-color .2s;
}
.thumb.is-active { border-color: var(--green); }

.pd-info { display: flex; flex-direction: column; gap: 20px; }
.pd-cat { display: inline-flex; padding: 5px 14px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 13px; align-self: flex-start; }
.pd-info h1 { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 36px; line-height: 1.35; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.meta b { color: var(--text); font-weight: 600; }
.stock { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }
.stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.price-box { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.price-big { font-family: var(--font-head); font-weight: 800; font-size: 34px; color: var(--green); line-height: 1.2; }
.price-big small { font-size: 16px; font-weight: 500; }
.price-big .per { font-size: 14px; font-weight: 500; color: var(--muted); font-family: var(--font-body); }
.tiers { width: 100%; border-collapse: collapse; font-size: 14px; }
.tiers th, .tiers td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tiers th { color: var(--muted); font-weight: 600; background: var(--surface2); }
.tiers tr:last-child td { border-bottom: 0; }
.tiers .save { color: var(--orange); font-weight: 700; }
.tiers-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }

.opt-label { font-weight: 700; font-size: 15px; margin-bottom: 10px; display: block; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  min-height: 48px; padding: 6px 18px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.35;
}
.seg button small { color: var(--muted); font-size: 12px; }
.seg button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }

.buy-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 16px; background: var(--surface); height: 54px; overflow: hidden; }
.qty button { width: 48px; height: 100%; border: 0; background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qty button:hover { background: var(--surface2); }
.qty input { width: 56px; height: 100%; border: 0; background: transparent; color: var(--text); text-align: center; font-weight: 700; font-size: 17px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-row .btn { flex: 1 1 180px; }
.fav { width: 54px; height: 54px; border-radius: 16px; }

.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.perk { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface2); font-size: 13px; color: var(--muted); }
.perk b { color: var(--text); font-size: 14px; }
.perk .icon { color: var(--green); }

.dtabs-wrap { padding-top: 64px; }
.dtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.dtabs button {
  height: 52px; padding: 0 20px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 16px; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.dtabs button[aria-selected="true"] { color: var(--green); border-bottom-color: var(--green); }
.dpanel { padding: 28px 0 0; max-width: 860px; color: var(--muted); font-size: 16px; }
.dpanel[hidden] { display: none; }
.dpanel p { margin: 0 0 14px; }
.dpanel ul { margin: 0; padding-right: 20px; display: flex; flex-direction: column; gap: 8px; }
.specs { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.specs th, .specs td { text-align: right; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 15px; }
.specs th { width: 34%; background: var(--surface2); color: var(--text); font-weight: 600; }
.specs td { color: var(--muted); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

.mobile-buy { display: none; }

@media (max-width: 1000px) {
  .shop { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: flex; }
  .filter-toggle { display: inline-flex; }
  .pd { grid-template-columns: 1fr; gap: 28px; }
  .gallery { position: static; }
}
@media (max-width: 640px) {
  .page-banner { padding: 26px 22px; }
  .page-banner h1, .pd-info h1 { font-size: 28px; }
  .toolbar .select { min-width: 0; flex: 1; }
  .products.list-view .product { flex-direction: column; }
  .products.list-view .p-img-link { width: 100%; }
  .products.list-view .p-foot { flex-direction: row; align-items: center; }
  .perks { grid-template-columns: 1fr; }
  .mobile-buy {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; gap: 12px; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border);
  }
  .mobile-buy .btn { height: 48px; flex: 1; }
  .has-mobile-buy { padding-bottom: 76px; }
}

/* ===== Category cards with real images ===== */
.cats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.cat { padding: 12px 12px 18px; gap: 14px; text-align: center; }
.cat:hover { color: var(--text); }
.cat-img {
  display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden;
  background: #FFFFFF; border: 1px solid var(--border);
}
.cat-img img { width: 100%; height: 100%; object-fit: contain; padding: 12%; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.cat-img.cover img { object-fit: cover; padding: 0; }
.cat:hover .cat-img img { transform: scale(1.07); }
.cat-txt { display: flex; flex-direction: column; line-height: 1.4; }
.cat-txt b { font-size: 16px; }
.cat-txt small { font-size: 12px; color: var(--muted); }

/* ===== Real images: slides, products, gallery ===== */
.img-ph.has-img { border: 0; padding: 0; background: var(--surface2); box-shadow: 0 30px 60px -36px rgba(0,0,0,.45); }
.img-ph.has-img img { width: 100%; height: 100%; object-fit: cover; }
.slide.is-active .img-ph.has-img img { animation: kenburns 7s ease-out both; }
@keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }

.p-img.cover { background: var(--surface2); }
.p-img.contain { background: #FFFFFF; border: 1px solid var(--border); }
.p-img img { transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.p-img.contain img { object-fit: contain; padding: 10%; }
.product:hover .p-img img { transform: scale(1.06); }
.p-img .badge { z-index: 1; }

.gallery-main { background: var(--surface2); }
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.gallery-main .badge { z-index: 1; }
.thumbs.flavors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.thumb { position: relative; overflow: hidden; background: var(--surface2); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb span {
  position: absolute; bottom: 8px; left: 8px; right: 8px; padding: 3px 0; border-radius: 8px;
  background: rgba(0,0,0,.6); color: #FFFFFF; font-size: 13px; font-weight: 700; text-align: center;
}

/* ===== Main → sub categories ===== */
.section-sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.cat { cursor: default; }
.cat-main { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; color: var(--text); }
.cat-main:hover { color: var(--text); }
.cat-subs { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--border); width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cat-subs a {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
}
.cat-subs a:hover { background: var(--green-soft); border-color: var(--green); color: var(--green); }

/* Shop: category tree */
.cat-tree { display: flex; flex-direction: column; }
.tree-group + .tree-group { border-top: 1px solid var(--border); }
.tree-head { display: flex; align-items: center; gap: 6px; }
.tree-head .check-row { flex: 1; font-weight: 600; }
.tree-toggle {
  flex: none; width: 32px; height: 32px; border-radius: 10px; border: 0; background: none; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s, color .2s;
}
.tree-toggle:hover { background: var(--surface2); color: var(--text); }
.tree-toggle .icon { width: 18px; height: 18px; transition: transform .25s; }
.tree-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.tree-subs { margin: 0 0 10px; padding-inline-start: 14px; border-inline-start: 2px solid var(--green-soft); }
.tree-subs[hidden] { display: none; }
.tree-subs .check-row { padding: 6px 0; font-size: 14px; }

/* Shop: sub-category pills above grid */
.sub-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.sub-bar[hidden] { display: none; }
.sub-bar .tab { height: 38px; padding: 0 16px; }

/* ===== Mobile header: compact row + search row + slide-down menu ===== */
.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.menu-btn[aria-expanded="true"] .i-open { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }

@media (max-width: 900px) {
  /* شريط التوصيل: سطر واحد بس */
  .topbar .wrap { flex-wrap: nowrap; padding-block: 6px; }
  .topbar .wrap > span:first-child { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
  .topbar .wrap > span:first-child .icon { display: none; }
  .topbar .end { display: none; }

  /* الصف الأول: لوجو + أزرار، والبحث في صف لوحده تحتهم */
  .header-row { flex-wrap: wrap; gap: 10px 12px; padding-block: 10px; }
  .brand { gap: 8px; min-width: 0; }
  .logo-chip { width: 44px; height: 44px; border-radius: 12px; padding: 3px; }
  .brand-name b { font-size: 19px; }
  .brand-name small { font-size: 11px; }
  .actions { margin-inline-start: auto; gap: 8px; }
  .icon-btn { width: 42px; height: 42px; border-radius: 12px; }
  .cart-btn { height: 42px; padding: 0 12px; border-radius: 12px; gap: 6px; }
  .menu-btn { display: inline-flex; }
  .search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; transition: max-height .25s, opacity .2s, margin .25s; max-height: 60px; }
  .search input { height: 42px; border-radius: 12px; font-size: 14px; }
  .search .icon { top: 11px; }
  /* لما ننزل لتحت: البحث يختفي والهيدر يبقى صف واحد */
  .site-header.compact:not(.menu-open) .search { max-height: 0; opacity: 0; overflow: hidden; margin-top: -10px; pointer-events: none; }

  /* المنيو: بتنزل تحت الهيدر */
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; max-width: none;
    flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 8px 16px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow-y: auto;
  }
  .main-nav.open { display: flex; animation: fadeUp .25s both; }
  .main-nav a { display: flex; align-items: center; min-height: 48px; padding: 0 6px; border-bottom: 1px solid var(--border); font-size: 16px; }
  .main-nav a:last-child { border-bottom: 0; }
}
@media (max-width: 380px) {
  .brand-name small { display: none; }
}

/* ===== Mobile hero: image first, text under it ===== */
@media (max-width: 900px) {
  .hero-box { padding: 16px 16px 20px; border-radius: 26px; }
  .slide { gap: 18px; align-items: start; }
  .slide-media { order: -1; padding: 0 0 10px; }
  .img-ph.has-img { border-radius: 20px; }
  .float-badge { bottom: 0; right: 10px; padding: 8px 12px; gap: 10px; border-radius: 14px; }
  .float-badge .ok { width: 32px; height: 32px; border-radius: 10px; }
  .float-badge b { font-size: 13px; }
  .slide-text { gap: 12px; }
  .slide p { font-size: 16px; }
}
