/* Cleopatra Candy Co. — design system
   Palette drawn from the packaging: header-card gold, Cleopatra red, cocoa black, catalog stripe colours.
   Logical properties (margin-inline, inset-inline…) keep Arabic RTL correct without duplicate rules. */
:root {
  --cream: #FFF8EC; --cream-2: #FCEFD6; --paper: #FFFFFF; --ink: #1E1712; --ink-2: #4A3F35; --muted: #776A5C; --line: #EADDC4;
  --gold: #FFC72C; --gold-2: #F2B705; --gold-ink: #7A5A00; --red: #C8102E; --red-2: #A50D26; --teal: #1F9E89; --berry: #B0306A; --orange: #E8762B;
  --ok: #1D7A4E; --warn: #9A6400; --err: #B3261E; --info: #1F5FA0;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(30,23,18,.06), 0 8px 24px rgba(30,23,18,.08); --shadow-lg: 0 18px 50px rgba(30,23,18,.16);
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif; --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1180px; --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
:lang(ar) { --font-display: 'Cairo', 'Inter', system-ui, sans-serif; --font-body: 'Cairo', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 16px/1.6 var(--font-body); color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red-2); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.2vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2rem); font-weight: 750; }
h3, .h3 { font-size: 1.2rem; font-weight: 700; } .h4 { font-size: 1.02rem; font-weight: 700; margin: 0 0 .3em; }
p { margin: 0 0 1em; }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { letter-spacing: 0; line-height: 1.35; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .86em; }
.pre { white-space: pre-wrap; } .error-text { color: var(--err); } .overdue { color: var(--err); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; color: #fff; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 720px; }
.flip-rtl { transition: transform .2s var(--ease); } [dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.hp { position: absolute !important; inset-inline-start: -9999px; height: 0; overflow: hidden; }
.ic { flex: none; vertical-align: -4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ───── Buttons ───── */
.btn { --b: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; padding: .62em 1.15em; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), background .15s, box-shadow .15s, color .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); } .btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(200,16,46,.25); } .btn-primary:hover { background: var(--red-2); color: #fff; }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 6px 18px rgba(255,199,44,.35); } .btn-gold:hover { background: #ffd65c; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: #d9c8a6; }
.btn-ghost.danger, .danger { color: var(--err); } .btn-ghost.danger:hover { border-color: #e7b4ae; color: var(--err); }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.04); } .btn-outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-sm { min-height: 36px; padding: .42em .9em; font-size: .86rem; } .btn-lg { min-height: 52px; padding: .8em 1.5em; font-size: 1.02rem; }
.btn-block { width: 100%; } .btn-icon { min-height: 40px; width: 40px; padding: 0; border-radius: 50%; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn-icon:hover { color: var(--err); }
.linklike { background: none; border: 0; padding: 0; color: var(--red); font: inherit; cursor: pointer; text-decoration: underline; }
.link-arrow { display: inline-flex; align-items: center; gap: .35em; font-weight: 600; text-decoration: none; }
.inline-form { display: inline-flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ───── Glass ───── */
.glass { background: rgba(255,255,255,.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid rgba(255,255,255,.6); box-shadow: var(--shadow); }
.glass-chip { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: var(--radius); padding: 12px 16px; }
.glass-dark { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ───── Header ───── */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,248,236,.86); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid rgba(234,221,196,.8); }
.header-row { display: flex; align-items: center; gap: 18px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 104px; height: auto; }
.main-nav { margin-inline-start: auto; }
.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 10px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .95rem; }
.main-nav a:hover { background: var(--cream-2); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; min-height: 44px; width: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; color: var(--ink); align-items: center; justify-content: center; }
.lang-menu, .user-menu { position: relative; }
.lang-menu summary, .user-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 600; font-size: .86rem; }
.lang-menu summary::-webkit-details-marker, .user-menu summary::-webkit-details-marker { display: none; }
.lang-menu ul, .menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 190px; list-style: none; margin: 0; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; }
.lang-menu a, .menu-pop a, .menu-pop button { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; width: 100%; text-align: start; }
.lang-menu a:hover, .menu-pop a:hover { background: var(--cream); }
.lang-menu a[aria-current] { font-weight: 700; background: var(--cream-2); }
.menu-pop p { padding: 6px 12px; margin: 0; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { position: fixed; inset: 72px 0 auto 0; background: var(--cream); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 10px 16px 18px; display: none; margin: 0; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; } .main-nav a { padding: 14px; font-size: 1.05rem; }
  .hide-sm { display: none !important; }
}

/* ───── Hero ───── */
.hero { position: relative; background: radial-gradient(1200px 500px at 85% 10%, rgba(255,199,44,.18), transparent 60%), radial-gradient(800px 400px at 0% 100%, rgba(200,16,46,.22), transparent 60%), var(--ink); color: #fff; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding-block: clamp(48px, 8vw, 96px); }
.hero h1 { color: #fff; } .hero .eyebrow { color: var(--gold); }
.hero .lead { font-size: 1.12rem; color: rgba(255,255,255,.82); max-width: 54ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--red); margin-bottom: .8em; }
:lang(ar) .eyebrow { letter-spacing: 0; text-transform: none; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 28px 0 0; }
.hero-facts strong { display: block; font: 800 1.6rem/1 var(--font-display); color: var(--gold); }
.hero-facts span { font-size: .82rem; color: rgba(255,255,255,.75); }
.hero-art { position: relative; min-height: 420px; }
.hero-logo { position: absolute; inset-inline-start: 50%; top: 0; width: min(380px, 80%); transform: translateX(-50%); filter: drop-shadow(0 18px 40px rgba(0,0,0,.4)); z-index: 3; }
[dir="rtl"] .hero-logo { transform: translateX(50%); }
.bag-fan { position: absolute; inset: 120px 0 0 0; display: flex; justify-content: center; align-items: flex-end; }
.bag { width: 128px; border-radius: 10px; box-shadow: 0 20px 40px rgba(0,0,0,.45); margin-inline: -18px; transition: transform .4s var(--ease); background: #fff; }
.bag-0 { transform: rotate(-14deg) translateY(28px); } .bag-1 { transform: rotate(-7deg) translateY(8px); z-index: 1; } .bag-2 { transform: translateY(-6px); z-index: 2; }
.bag-3 { transform: rotate(7deg) translateY(8px); z-index: 1; } .bag-4 { transform: rotate(14deg) translateY(28px); }
.hero-art:hover .bag-0 { transform: rotate(-18deg) translate(-10px, 22px); } .hero-art:hover .bag-4 { transform: rotate(18deg) translate(10px, 22px); }
.candy-stripe { height: 8px; background: linear-gradient(90deg, var(--red) 0 16%, var(--gold) 16% 33%, var(--teal) 33% 50%, var(--berry) 50% 66%, var(--orange) 66% 83%, var(--red) 83%); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { min-height: 340px; order: -1; } .bag { width: 92px; } .bag-fan { inset: 110px 0 0 0; } }

/* ───── Sections ───── */
.section { padding-block: clamp(48px, 7vw, 88px); } .section-sm { padding-block: clamp(28px, 4vw, 48px); }
.section-tint { background: var(--cream-2); } .section-dark { background: var(--ink); color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; } .section-head.light h2 { color: #fff; } .section-head.light p { color: rgba(255,255,255,.75); margin: 0; }
.page-hero { background: linear-gradient(180deg, var(--cream-2), var(--cream)); padding-block: clamp(36px, 6vw, 64px) 12px; border-bottom: 1px solid var(--line); }
.lead-dark { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; }
.intro-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.value-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.value-list li { display: flex; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.value-list .ic { width: 28px; height: 28px; color: var(--red); background: #FDE7EA; border-radius: 10px; padding: 4px; }
.value-list p { margin: 0; color: var(--ink-2); font-size: .93rem; }
@media (max-width: 860px) { .intro-grid, .value-list { grid-template-columns: 1fr; } }

/* Categories */
.cat-gum { --cat: #1F9E89; } .cat-hard-candy { --cat: #E0A21B; } .cat-assorted { --cat: #8C4A2F; } .cat-mint { --cat: #138A8A; } .cat-gummy { --cat: #D7263D; } .cat-lollipop { --cat: #B0306A; }
.cat-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 132px; padding: 18px; border-radius: var(--radius); background: var(--paper); text-decoration: none; color: var(--ink); border: 1px solid var(--line); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.cat-tile::before { content: ''; position: absolute; inset: auto -30px -30px auto; width: 110px; height: 110px; border-radius: 50%; background: var(--cat); opacity: .14; transition: transform .3s var(--ease); }
[dir="rtl"] .cat-tile::before { inset: auto auto -30px -30px; }
.cat-tile::after { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--cat); }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); } .cat-tile:hover::before { transform: scale(1.25); }
.cat-name { font: 750 1.1rem/1.2 var(--font-display); } .cat-count { font-size: .84rem; color: var(--muted); }
@media (max-width: 960px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } } @media (max-width: 520px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.product-card { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pc-media { display: block; background: linear-gradient(180deg, #fff, #faf5ea); padding: 16px 28px 0; border-bottom: 3px solid var(--cat, var(--gold)); }
.pc-media img { width: 100%; aspect-ratio: 9/16; object-fit: contain; transition: transform .35s var(--ease); }
.product-card:hover .pc-media img { transform: scale(1.04); }
.pc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pc-cat { font-size: .74rem; font-weight: 700; color: var(--cat, var(--muted)); text-transform: uppercase; letter-spacing: .08em; margin: 0; }
:lang(ar) .pc-cat { letter-spacing: 0; }
.pc-name { font-size: 1.06rem; margin: 0; } .pc-name a { color: var(--ink); text-decoration: none; } .pc-name a:hover { color: var(--red); }
.pc-notes { font-size: .86rem; color: var(--muted); margin: 0; }
.pc-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.price { margin: 0; font-size: .95rem; } .price strong { font-size: 1.1rem; } .per { font-size: .8rem; color: var(--muted); }
.price-pending { font-size: .86rem; color: var(--gold-ink); font-weight: 600; }
.deal { display: inline-block; margin-inline-start: 6px; font-size: .74rem; font-weight: 700; color: var(--red); background: #FDE7EA; padding: 2px 8px; border-radius: 999px; }
.deal-text { color: var(--red); }
.avail { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--cream-2); color: var(--ink-2); }
.avail::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.avail-in_stock, .avail-available { background: #E3F4EA; color: var(--ok); } .avail-low_stock { background: #FFF1D1; color: var(--warn); }
.avail-out_of_stock, .avail-unavailable { background: #FBE4E2; color: var(--err); } .avail-not_configured { background: var(--cream-2); color: var(--muted); }
.ph { aspect-ratio: 9/16; display: grid; place-items: center; color: var(--muted); font-size: .85rem; background: repeating-linear-gradient(45deg, #fff, #fff 10px, #faf3e4 10px, #faf3e4 20px); }

/* Order ways */
.ways-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.way { border-radius: var(--radius); padding: 26px; position: relative; } .way h3 { color: #fff; } .way p { color: rgba(255,255,255,.78); }
.way-n { position: absolute; inset-inline-end: 22px; top: 14px; font: 800 3rem/1 var(--font-display); color: rgba(255,199,44,.25); }
@media (max-width: 860px) { .ways-grid { grid-template-columns: 1fr; } }

.logo-strip { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.logo-strip li { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; height: 80px; display: grid; place-items: center; }
.logo-strip img { max-height: 52px; width: auto; object-fit: contain; }
.packaging { display: grid; grid-template-columns: 1.2fr .9fr .9fr; gap: 28px; align-items: center; }
.packaging figure { margin: 0; background: var(--paper); border-radius: var(--radius); padding: 16px; border: 1px solid var(--line); text-align: center; }
.packaging img { margin: 0 auto 8px; max-height: 300px; width: auto; } .packaging figcaption { font-size: .86rem; color: var(--muted); }
@media (max-width: 860px) { .packaging { grid-template-columns: 1fr 1fr; } .packaging > div { grid-column: 1 / -1; } }
.partner-cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.partner-cta h2 { margin-bottom: .3em; } .partner-cta p { margin: 0; color: var(--ink-2); }

/* Catalog filter */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .field { margin: 0; } .filter-bar .grow { flex: 1 1 260px; }
.input-icon { position: relative; } .input-icon .ic { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-inline-start: 40px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .92rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; }
.chip { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem; }
.chip:hover { border-color: var(--cat, var(--ink)); color: var(--ink); } .chip-on { background: var(--ink); color: var(--gold); border-color: var(--ink); } .chip-on:hover { color: var(--gold); }

/* Product detail */
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 18px; } .crumbs a { color: var(--ink-2); }
.product-detail { display: grid; grid-template-columns: .85fr 1.15fr; gap: 48px; align-items: start; }
.pd-media { background: linear-gradient(180deg, #fff, #faf3e4); border-radius: 22px; padding: 28px 56px; border: 1px solid var(--line); position: sticky; top: 96px; display: grid; gap: 16px; }
.pd-media img { max-height: 620px; width: auto; margin: 0 auto; }
.pd-notes { font-size: 1.1rem; color: var(--cat, var(--muted)); font-weight: 600; }
.pd-buy { border-radius: var(--radius); padding: 20px; margin: 18px 0 24px; display: grid; gap: 12px; }
.add-box { display: grid; gap: 10px; } .add-box label { font-weight: 600; font-size: .9rem; }
.mt-xl { margin-top: 56px; }
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; gap: 24px; } .pd-media { position: static; padding: 18px 48px; } .pd-media img { max-height: 420px; } }

/* Stepper */
.stepper { display: inline-flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); overflow: hidden; }
.stepper button { width: 40px; min-height: 40px; border: 0; background: transparent; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
.stepper button:hover { background: var(--cream); }
.stepper input { width: 56px; border: 0; text-align: center; font: 700 1rem var(--font-body); background: transparent; -moz-appearance: textfield; padding: 0; min-height: 40px; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Box builder */
.box-builder { display: grid; gap: 16px; }
.builder-bar { position: sticky; top: 84px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 14px 18px; border-radius: 16px; }
.builder-bar .hint { flex-basis: 100%; margin: 0; }
.meter { flex: 1 1 140px; height: 10px; background: var(--cream-2); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: inherit; transition: width .25s var(--ease); }
.box-builder.is-full .meter span { background: var(--ok); } .box-builder.is-over .meter span { background: var(--err); }
.boxes-mult { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; } .boxes-mult input { width: 76px; }
.builder-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.builder-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-inline-start: 4px solid var(--cat); border-radius: 12px; padding: 10px 12px; }
.builder-item img { width: 56px; height: 99px; object-fit: contain; } .bi-name { font-weight: 650; display: block; } .builder-item .price { font-size: .84rem; }
.builder-item.has-qty { box-shadow: 0 0 0 2px var(--gold) inset; } .is-off { opacity: .55; }
.ready-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ready-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ready-card img { width: 64px; height: 113px; object-fit: contain; }
.inline-add { display: flex; gap: 8px; align-items: center; } .inline-add input { width: 70px; min-height: 36px; }

/* Forms */
.stack { display: grid; gap: 14px; } .stack-sm { display: grid; gap: 8px; }
.field { display: grid; gap: 6px; margin: 0; } .field label { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.field-check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; } .field-check input { margin-top: 4px; }
.req { color: var(--red); } .hint { font-size: .8rem; color: var(--muted); margin: 0; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--red); flex: none; }
input[type="file"] { padding: 8px; } textarea { min-height: 84px; resize: vertical; } select[multiple] { min-height: 140px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(255,199,44,.35); }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--err); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0; display: grid; gap: 12px; }
legend { font-weight: 700; padding: 0 6px; font-family: var(--font-display); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .row-2, .grid-3 { grid-template-columns: 1fr; } }
.qty { width: 84px; min-height: 38px; padding: 6px 8px; text-align: center; }

/* Notices & flash */
.flash { margin: 16px auto; max-width: var(--wrap); padding: 12px 16px; border-radius: 12px; font-weight: 550; }
.portal-main .flash { margin: 0 0 16px; }
.flash-ok { background: #E3F4EA; color: #14532D; border: 1px solid #BFE3CD; } .flash-error { background: #FBE4E2; color: #7F1D1D; border: 1px solid #F1C0BA; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 0 14px; font-size: .93rem; }
.notice > div > *:last-child { margin-bottom: 0; }
.notice-info { background: #E8F0FA; color: #173B63; } .notice-warn { background: #FFF4D6; color: #5C3D00; } .notice-error { background: #FBE4E2; color: #7F1D1D; } .notice-ok { background: #E3F4EA; color: #14532D; }

/* Cards, tables, status */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.glass { background: rgba(255,255,255,.78); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; } .card-head h2 { font-size: 1.12rem; margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 11px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #FFFBF3; font-weight: 700; white-space: nowrap; }
:lang(ar) th { letter-spacing: 0; text-transform: none; font-size: .86rem; }
tbody tr:last-child td { border-bottom: 0; } tbody tr:hover td { background: #FFFCF6; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.prod-cell { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 600; } .prod-cell img { width: 28px; height: auto; }
@media (max-width: 720px) {
  .table-wrap { border: 0; background: transparent; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-wrap tr { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 4px; }
  .table-wrap td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: end; }
  .table-wrap td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .8rem; text-align: start; }
  .table-wrap td[data-label=""]::before { content: none; }
}
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--cream-2); color: var(--ink-2); white-space: nowrap; }
.status-active, .status-confirmed, .status-delivered, .status-approved, .status-resolved, .status-completed, .status-accepted, .status-converted, .status-done, .status-ok, .status-handled, .status-create { background: #E3F4EA; color: var(--ok); }
.status-pending, .status-awaiting_confirmation, .status-requested, .status-new, .status-open, .status-under_review, .status-responded, .status-warn, .status-update { background: #FFF1D1; color: var(--warn); }
.status-preparing, .status-scheduled, .status-in_progress { background: #E8F0FA; color: var(--info); }
.status-shipped { background: #EDE7FA; color: #5B3BA8; }
.status-cancelled, .status-rejected, .status-suspended, .status-deactivated, .status-declined, .status-expired, .status-error, .status-spam, .status-reject, .status-archived { background: #FBE4E2; color: var(--err); }
.pill { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: .74rem; font-weight: 800; text-align: center; }
.dl { display: grid; gap: 8px; margin: 0; } .dl > div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px dashed var(--line); padding-bottom: 7px; }
.dl dt { color: var(--muted); font-size: .9rem; } .dl dd { margin: 0; text-align: end; font-weight: 550; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); } .empty .ic { width: 34px; height: 34px; margin: 0 auto 8px; display: block; opacity: .5; } .empty p { margin: 0 0 12px; }
.ticks { padding-inline-start: 1.1em; } .ticks li { margin-bottom: 6px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 52px; } .steps li h3 { margin-bottom: .2em; } .steps li p { margin: 0; color: var(--ink-2); }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-weight: 800; }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: start; } @media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.contact-card { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; } .contact-card > .ic { width: 28px; height: 28px; color: var(--red); }
.big-link { font-size: 1.15rem; font-weight: 700; word-break: break-all; }
.retailer-grid { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.retailer-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.retailer-card img { max-height: 72px; width: auto; object-fit: contain; }
.error-page { padding-block: 80px; text-align: center; }

/* Footer */
.site-footer { background: var(--ink); color: rgba(255,255,255,.78); margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-block: 48px 28px; }
.site-footer img { width: 110px; margin-bottom: 12px; } .site-footer a { color: #fff; text-decoration: none; } .site-footer a:hover { color: var(--gold); }
.footer-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin-bottom: 12px; font-family: var(--font-body); }
:lang(ar) .footer-h { letter-spacing: 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid rgba(255,255,255,.12); padding-block: 16px 24px; font-size: .84rem; }
.site-footer .muted { color: rgba(255,255,255,.6); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } } @media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ───── Auth ───── */
body.auth { background: radial-gradient(900px 500px at 100% 0%, rgba(255,199,44,.28), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(200,16,46,.16), transparent 60%), var(--cream); min-height: 100vh; }
.auth-main { max-width: 620px; margin: 0 auto; padding: 24px 16px 48px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; } .auth-top img { width: 120px; }
.auth-card { border-radius: 22px; padding: clamp(20px, 4vw, 36px); } .auth-card h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* ───── Portals ───── */
body.portal { background: #FBF6EC; }
.portal-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; min-height: 64px; background: var(--ink); color: #fff; }
.portal-header .brand { color: #fff; } .portal-header .brand img { width: 74px; }
.area-name { font: 700 .95rem var(--font-display); color: var(--gold); padding-inline-start: 10px; border-inline-start: 1px solid rgba(255,255,255,.2); }
.portal-header .lang-menu summary, .portal-header .user-menu summary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.portal-header .menu-pop a, .portal-header .menu-pop button { color: var(--ink); }
.global-search input { min-height: 38px; width: 280px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; } .global-search input::placeholder { color: rgba(255,255,255,.6); }
.bell { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: rgba(255,255,255,.08); }
.bell:hover { color: var(--gold); } .badge-count { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.portal-body { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 64px); }
.side-nav { background: var(--paper); border-inline-end: 1px solid var(--line); padding: 16px 10px; }
.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; position: sticky; top: 80px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 580; font-size: .93rem; }
.side-nav a:hover { background: var(--cream); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--ink); color: #fff; } .side-nav a[aria-current="page"] .ic { color: var(--gold); }
.side-nav .pill { margin-inline-start: auto; }
.portal-main { padding: 24px clamp(16px, 3vw, 36px) 48px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); margin: 0; } .page-head > :last-child:not(h1) { display: flex; gap: 8px; }
@media (max-width: 900px) {
  .portal-body { grid-template-columns: 1fr; }
  .side-nav { position: sticky; top: 64px; z-index: 30; padding: 6px; border-inline-end: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side-nav ul { display: flex; gap: 4px; position: static; } .side-nav a { white-space: nowrap; padding: 9px 12px; font-size: .86rem; }
  .area-name { display: none; } .user-menu summary span { display: none; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; } .stats-2 { grid-template-columns: 1fr 1fr; margin: 0 0 6px; }
.stat { display: grid; gap: 6px; padding: 16px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: transform .15s var(--ease), box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; } .stat-value { font: 800 1.7rem/1 var(--font-display); }
.tone-red { border-color: #F1C0BA; background: #FFF6F5; } .tone-red .stat-value { color: var(--err); }
.tone-gold { border-color: #F5D98B; background: #FFFAEB; } .tone-gold .stat-value { color: var(--gold-ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; } @media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.tabs { margin-bottom: 16px; overflow-x: auto; } .tabs ul { list-style: none; margin: 0; padding: 4px; display: inline-flex; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; }
.tabs a { display: block; padding: 7px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap; }
.tabs a:hover { background: var(--cream); } .tabs a[aria-current="page"] { background: var(--ink); color: var(--gold); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 12px; background: var(--cream); color: var(--ink); text-decoration: none; font-weight: 650; }
.qa:hover { background: var(--cream-2); color: var(--ink); } .qa .ic { color: var(--red); }
.promo-list, .mini-list, .notif-list, .addr-list, .rep-cards, .inquiry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.promo-list li { display: flex; gap: 10px; } .promo-list div { display: grid; } .promo-list .ic { color: var(--red); }
.mini-list li { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.notif-list li { display: flex; gap: 12px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; } .notif-list li.unread { border-inline-start: 4px solid var(--red); } .notif-list p { margin: 0; }
.addr-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding-bottom: 10px; } .addr-list address { font-style: normal; }
.rep-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } .rep-cards .card { margin: 0; }
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; } @media (max-width: 960px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-lines { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cart-line p { margin: 0; } .cl-qty { display: flex; gap: 6px; align-items: center; } .cl-qty input { width: 76px; } .cl-total { font-weight: 800; min-width: 90px; text-align: end; }
@media (max-width: 640px) { .cart-line { grid-template-columns: 1fr auto; } .cl-main { grid-column: 1 / -1; } }
.summary { position: sticky; top: 80px; } .summary h2 { font-size: 1.15rem; }
.save-list input { width: 220px; }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, #FBF6EC 30%); display: flex; justify-content: flex-end; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.progress { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: p; }
.progress li { position: relative; padding-top: 14px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.progress li::before { content: ''; position: absolute; top: 0; inset-inline: 0; height: 6px; border-radius: 999px; background: var(--line); }
.progress li.done::before { background: var(--ok); } .progress li.current { color: var(--ink); } .progress li.current::before { background: linear-gradient(90deg, var(--ok), var(--gold)); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .timeline li { padding-inline-start: 16px; border-inline-start: 2px solid var(--line); }
.timeline li span:first-child { font-weight: 650; } .timeline p { margin: 2px 0 0; }
.thread { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.thread li { padding: 10px 14px; border-radius: 12px; background: var(--cream); max-width: 90%; } .thread li p { margin: 0; }
.thread li.from-staff { background: #EAF2FB; justify-self: start; } .thread li.from-me { background: #FFF4D6; justify-self: end; } .thread li.internal { background: #F3EDF7; border: 1px dashed #C9B5DA; max-width: 100%; }
.agenda { display: grid; gap: 14px; } .agenda-day { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; } .agenda-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.agenda time { font-weight: 700; font-variant-numeric: tabular-nums; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; } .perm-grid label { min-height: 32px; }
.img-admin { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; } .img-admin li { display: grid; gap: 6px; justify-items: center; }
.policy { background: var(--cream); padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; }
code.copy { display: block; padding: 12px; background: var(--ink); color: var(--gold); border-radius: 10px; word-break: break-all; user-select: all; }
.email-preview { white-space: pre-wrap; background: var(--cream); padding: 14px; border-radius: 10px; font-size: .88rem; }
.prose { max-width: 70ch; } .prose li { margin-bottom: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.inquiry-list .card { margin: 0; }

/* Print — hide chrome on any page */
@media print { .site-header, .site-footer, .portal-header, .side-nav, .no-print { display: none !important; } body { background: #fff; } }
.offline-card { text-align: center; } .offline-card img { margin: 0 auto 12px; }
.portal-header .brand img { background: var(--cream); border-radius: 8px; padding: 3px 6px; }
[dir="rtl"] .ltr-block { text-align: right; }
.mono, .num { unicode-bidi: isolate; }
