:root {
  --wine: #6B1030;
  --wine-dark: #4A0A20;
  --wine-soft: #8C2A4A;
  --cream: #F4EAD9;
  --cream-soft: #FBF6EE;
  --ink: #2A0A14;
  --muted: #7A6066;
  --line: #EEE3D6;
  --bg: #FFFFFF;
  --ok: #2E7D4F;
  --err: #B3261E;
  --radius: 14px;
  --shadow: 0 10px 30px -12px rgba(74, 10, 32, .25);
  --font: 'Tajawal', system-ui, sans-serif;
  --display: 'Cinzel', 'Tajawal', serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; height: 64px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.brand { font-family: var(--display); font-weight: 700; letter-spacing: .14em; color: var(--wine); font-size: 1.15rem; white-space: nowrap; }
.nav { display: flex; gap: 4px; margin-inline-start: 18px; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: .2s; }
.nav a:hover { color: var(--wine); }
.nav a.active { color: var(--wine); background: var(--cream-soft); font-weight: 700; }
.actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--wine-dark); transition: .2s; }
.icon-btn:hover { background: var(--cream-soft); color: var(--wine); }
.badge { position: absolute; top: 3px; inset-inline-end: 1px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--wine); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.menu-btn { display: none; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; margin-inline-end: 4px; }
.lang-btn { border: 0; background: none; padding: 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.lang-btn.on { background: var(--wine); color: #fff; }

@media (max-width: 820px) {
  .menu-btn { display: inline-grid; }
  .brand { font-size: 1rem; letter-spacing: .1em; }
  .nav { position: fixed; top: 64px; inset-inline: 0; margin: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; box-shadow: var(--shadow); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .2s; }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
  .lang-btn { padding: 4px 7px; }
}
@media (max-width: 400px) { .brand { font-size: .88rem; letter-spacing: .06em; } .topbar-inner { gap: 4px; padding: 0 10px; } .icon-btn { width: 38px; } }

/* ---------- layout ---------- */
.app { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; min-height: calc(100vh - 64px); }
.page-title { font-family: var(--display); color: var(--wine); font-weight: 600; font-size: clamp(1.6rem, 4vw, 2.3rem); letter-spacing: .06em; text-align: center; margin: 8px 0 22px; }
:lang(ar) .page-title { font-family: var(--font); letter-spacing: 0; font-weight: 800; }
.loader { width: 34px; height: 34px; margin: 80px auto; border: 3px solid var(--cream); border-top-color: var(--wine); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- home ---------- */
.hero { min-height: calc(100vh - 64px - 88px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 26px; }
.hero-logo { width: min(62vw, 330px); aspect-ratio: 1; border-radius: 50%; box-shadow: 0 30px 60px -30px rgba(74,10,32,.45); animation: rise .9s ease both; }
.hero-name { font-family: var(--display); font-weight: 700; color: var(--wine); font-size: clamp(2.4rem, 9vw, 5.6rem); letter-spacing: .12em; line-height: 1.05; margin: 0; animation: rise .9s .15s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- categories ---------- */
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.chip { border: 1px solid var(--line); background: #fff; padding: 9px 18px; border-radius: 999px; font-weight: 700; color: var(--wine-dark); letter-spacing: .02em; transition: .2s; }
.chip:hover { border-color: var(--wine-soft); }
.chip.on { background: var(--wine); border-color: var(--wine); color: #fff; }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 18px; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 10px; } }
.card { display: flex; flex-direction: column; }
.card-media { position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; background: var(--cream-soft); }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.04); }
.tag { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--wine); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.soldout { position: absolute; inset: 0; background: rgba(255,255,255,.62); display: grid; place-items: center; }
.soldout span { background: #fff; border: 1px solid var(--line); color: var(--wine-dark); font-weight: 800; padding: 6px 14px; border-radius: 999px; font-size: 14px; }
.card-body { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-weight: 700; font-size: 15px; line-height: 1.35; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price .now { color: var(--wine); font-weight: 800; font-size: 16px; }
.price .old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.dots { display: flex; gap: 5px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.card-actions { display: grid; gap: 6px; margin-top: auto; padding-top: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 11px 16px; font-weight: 700; font-size: 15px; border: 1.5px solid var(--wine); background: var(--wine); color: #fff; transition: .2s; text-align: center; }
.btn:hover { background: var(--wine-dark); border-color: var(--wine-dark); }
.btn.ghost { background: #fff; color: var(--wine); }
.btn.ghost:hover { background: var(--cream-soft); }
.btn.sm { padding: 8px 10px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { padding: 15px 18px; font-size: 17px; }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 34px; align-items: start; }
@media (max-width: 860px) { .product { grid-template-columns: minmax(0,1fr); gap: 20px; } }
.product > *, .cart-wrap > * { min-width: 0; }
.gallery-main { position: relative; width: 100%; aspect-ratio: 3/4; border-radius: 18px; overflow: hidden; background: var(--cream-soft); }
.gallery-main img, .gallery-main video { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumb { flex: 0 0 64px; height: 80px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--cream-soft); position: relative; }
.thumb.on { border-color: var(--wine); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.25); }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--wine); display: grid; place-items: center; }
.gal-nav.prev { inset-inline-start: 10px; } .gal-nav.next { inset-inline-end: 10px; }
[dir=rtl] .gal-nav svg { transform: scaleX(-1); }
.p-name { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 800; margin: 0 0 6px; line-height: 1.25; }
.p-cat { color: var(--wine-soft); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.product .price .now { font-size: 1.5rem; }
.product .price .old { font-size: 1rem; }
.p-desc { white-space: pre-line; color: #4b3940; margin: 14px 0 0; }

/* ---------- form ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); margin-top: 20px; }
.form-card h3 { margin: 0 0 14px; font-size: 1.15rem; color: var(--wine); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.field { margin-bottom: 14px; }
.field > label, .opt-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--wine-dark); }
.opt-label small { color: var(--muted); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .row2 { grid-template-columns: 1fr; } }
.input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--cream-soft); outline: none; transition: .2s; font-size: 16px; }
.input:focus { border-color: var(--wine-soft); background: #fff; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B1030' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 18px; background-position: left 12px center; padding-left: 38px; }
[dir=ltr] select.input { background-position: right 12px center; padding-left: 14px; padding-right: 38px; }
.input.invalid { border-color: var(--err); background: #fff6f6; }
.err-msg { color: var(--err); font-size: 13px; margin-top: 4px; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
form { position: relative; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 6px; background: #fff; font-weight: 600; font-size: 14px; }
[dir=rtl] .swatch { padding: 5px 6px 5px 12px; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.swatch.on { border-color: var(--wine); box-shadow: 0 0 0 2px var(--cream); }
.swatch.off { opacity: .45; text-decoration: line-through; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn { min-width: 50px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; position: relative; }
.size-btn.on { background: var(--wine); color: #fff; border-color: var(--wine); }
.size-btn:disabled { color: #bba9ae; background: #faf7f4; cursor: not-allowed; text-decoration: line-through; }
.size-btn small { display: block; font-size: 10px; font-weight: 600; text-decoration: none; }
.stock-note { color: var(--err); font-weight: 700; font-size: 14px; margin-top: 6px; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--cream-soft); font-size: 20px; color: var(--wine); }
.qty span { min-width: 40px; text-align: center; font-weight: 800; }

.delivery-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .delivery-opts { grid-template-columns: 1fr; } }
.d-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; text-align: start; display: flex; flex-direction: column; gap: 2px; }
.d-opt b { font-size: 14.5px; }
.d-opt span { color: var(--muted); font-size: 13px; }
.d-opt.on { border-color: var(--wine); background: var(--cream-soft); }
.d-opt.on span { color: var(--wine); font-weight: 700; }
.d-opt:disabled { opacity: .45; cursor: not-allowed; }

.summary { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; display: grid; gap: 6px; }
.summary div { display: flex; justify-content: space-between; color: #4b3940; }
.summary .tot { font-size: 1.15rem; font-weight: 800; color: var(--wine); }
.cod-note { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.cod-note b { color: var(--wine-dark); }
.form-error { background: #fff3f2; color: var(--err); border-radius: 10px; padding: 10px 12px; font-weight: 600; margin-bottom: 12px; font-size: 14px; }

/* ---------- cart ---------- */
.cart-wrap { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .cart-wrap { grid-template-columns: minmax(0,1fr); } }
.cart-item { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item .ci-img { width: 84px; height: 108px; border-radius: 10px; overflow: hidden; background: var(--cream-soft); }
.cart-item .ci-img img, .cart-item .ci-img video { width: 100%; height: 100%; object-fit: cover; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-name { font-weight: 700; }
.ci-opts { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.ci-opts select { padding: 6px 30px 6px 10px; font-size: 14px; border-radius: 9px; }
[dir=rtl] .ci-opts select { padding: 6px 10px 6px 30px; }
.ci-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-bottom .qty button { width: 32px; height: 32px; font-size: 17px; }
.ci-bottom .qty span { min-width: 30px; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 4px; }
.ci-warn { color: var(--err); font-size: 13px; font-weight: 700; }

/* ---------- contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 760px; margin: 0 auto; }
.contact-card { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fff; transition: .2s; }
.contact-card:hover { border-color: var(--wine-soft); box-shadow: var(--shadow); transform: translateY(-2px); }
.contact-card .ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--cream); color: var(--wine); flex: 0 0 auto; }
.contact-card .ic svg { width: 24px; height: 24px; }
.contact-card b { display: block; }
.contact-card span { color: var(--muted); direction: ltr; unicode-bidi: plaintext; font-size: 14px; word-break: break-all; }

/* ---------- success ---------- */
.success { max-width: 520px; margin: 40px auto; text-align: center; }
.success .check { width: 72px; height: 72px; border-radius: 50%; background: var(--cream); color: var(--wine); display: grid; place-items: center; margin: 0 auto 16px; }
.success .check svg { width: 36px; height: 36px; stroke-width: 2.4; }
.success h2 { color: var(--wine); margin: 0 0 8px; }
.success .num { font-size: 1.6rem; font-weight: 800; color: var(--wine-dark); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(42,10,20,.45); display: flex; align-items: flex-start; justify-content: center; padding: 70px 14px 14px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.search-panel { width: 100%; max-width: 640px; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.search-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); color: var(--wine); }
[dir=rtl] .search-row { padding: 8px 16px 8px 8px; }
.search-row input { flex: 1; border: 0; outline: 0; font-size: 17px; padding: 10px 0; background: none; }
.search-results { max-height: 60vh; overflow-y: auto; }
.s-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.s-item:hover { background: var(--cream-soft); }
.s-item img, .s-item video { width: 46px; height: 58px; border-radius: 8px; object-fit: cover; background: var(--cream-soft); }
.s-item .ph { width: 46px; height: 58px; border-radius: 8px; background: var(--cream-soft); }
.s-item b { display: block; font-size: 15px; }
.s-none { padding: 22px; text-align: center; color: var(--muted); }

.overlay#modal { align-items: flex-end; padding: 0; }
@media (min-width: 640px) { .overlay#modal { align-items: center; padding: 14px; } }
.sheet { width: 100%; max-width: 460px; background: #fff; border-radius: 22px 22px 0 0; padding: 20px; max-height: 88vh; overflow-y: auto; animation: up .2s ease; }
@media (min-width: 640px) { .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sheet-head img, .sheet-head video { width: 64px; height: 80px; border-radius: 10px; object-fit: cover; }
.sheet-head .x { margin-inline-start: auto; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--wine-dark); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); animation: up .2s; max-width: calc(100% - 32px); text-align: center; }
.toast a { color: var(--cream); text-decoration: underline; margin-inline-start: 8px; }

/* ---------- customer reviews ---------- */
.reviews { columns: 4 220px; column-gap: 14px; }
.review { break-inside: avoid; margin: 0 0 14px; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--cream-soft); cursor: zoom-in; transition: .2s; }
.review:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.review img { width: 100%; height: auto; }
@media (max-width: 520px) { .reviews { columns: 2; column-gap: 10px; } .review { margin-bottom: 10px; } }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(20,4,10,.94); display: flex; align-items: center; justify-content: center; animation: fade .15s; }
.lightbox img { max-width: calc(100% - 24px); max-height: calc(100vh - 90px); object-fit: contain; border-radius: 10px; }
.lb-btn { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-close { top: 14px; inset-inline-end: 14px; }
.lb-prev { inset-inline-start: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { inset-inline-end: 12px; top: 50%; transform: translateY(-50%); }
[dir=rtl] .lb-prev svg, [dir=rtl] .lb-next svg { transform: scaleX(-1); }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; font-size: 14px; direction: ltr; }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; } }

.hero-btn { display: inline-block; font-family: var(--display); font-weight: 600; letter-spacing: .3em; padding: 15px 46px 15px calc(46px + .3em); border: 1.5px solid var(--wine); border-radius: 999px; color: #fff; background: var(--wine); font-size: clamp(.95rem, 2.4vw, 1.1rem); transition: .25s; animation: rise .9s .3s ease both; box-shadow: 0 14px 30px -16px rgba(74,10,32,.6); }
.hero-btn:hover { background: #fff; color: var(--wine); }
