:root {
  /* ألوان هوية GRADIA (حزمة الشعارات): عنابي ووردي، بلا ذهبي */
  --burgundy: #650d2c;
  --burgundy-deep: #4a0820;
  --pink: #e9a0b5;
  --blush: #f4d8e1;
  --blush-soft: #faecf0;
  --paper: #fbf6f6;
  --card: #ffffff;
  --ink: #34222a;
  --muted: #76636b;
  --line: #e8dde0;
  --danger: #b42318;
  --ok: #1f6f4a;
  --whatsapp: #167a49;
  /* أسماء قديمة تستعملها لوحة الإدارة */
  --satin: var(--burgundy);
  --satin-deep: var(--burgundy-deep);
  --satin-soft: var(--blush);
  --gold-wash: var(--blush-soft);
  --gold-ink: var(--burgundy);

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(52 34 42 / .05), 0 8px 24px -12px rgb(101 13 44 / .18);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  /* Thmanyah خط الهوية للعربية: يعمل تلقائيًا عند إضافة ملفاته في fonts.css */
  --font-display: 'Thmanyah', 'Readex Pro', sans-serif;
  --font-body: 'Thmanyah', 'Readex Pro', system-ui, sans-serif;
  --font-latin: 'Poppins', sans-serif;
  --gutter: 16px;
  --max: 1160px;
  --header: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* قواعد display في الأصناف لا تُظهر عنصرًا مخفيًا */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 12px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.75 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.3; margin: 0 0 .5em; color: var(--burgundy); font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 4.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
svg[viewBox="0 0 24 24"] { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-size: .9em; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.5em; border-radius: 999px; border: 1.5px solid var(--burgundy);
  background: var(--burgundy); color: #fff; font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn--ghost { background: transparent; color: var(--burgundy); }
.btn--light { background: #fff; color: var(--burgundy); border-color: #fff; }
.btn--whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); }
.btn--small { min-height: 40px; padding: .45em 1.1em; font-size: .95rem; }
.btn--lg { min-height: 56px; padding-inline: 1.8em; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--burgundy-deep); border-color: var(--burgundy-deep); }
  .btn--ghost:hover { background: var(--blush-soft); color: var(--burgundy); border-color: var(--burgundy); }
  .btn--light:hover { background: var(--blush); border-color: var(--blush); color: var(--burgundy); }
  .btn--whatsapp:hover { background: #10603a; border-color: #10603a; }
}
.link-btn {
  background: none; border: 0; padding: 4px 0; font: 600 .95rem var(--font-body); color: var(--burgundy);
  text-decoration: underline; text-decoration-color: var(--pink); text-underline-offset: 5px; cursor: pointer;
}
.link-btn--muted { color: var(--muted); text-decoration-color: var(--line); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--blush-soft); color: var(--burgundy); cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- الترويسة ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: var(--header); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { height: 46px; width: auto; }
.brand__label { font-weight: 600; color: var(--muted); }
.site-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.site-nav a { padding: 8px 10px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem; }
.site-nav a:active { background: var(--blush-soft); }
.site-nav__more { display: none; }
.cart-link { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--burgundy); text-decoration: none; flex: none; }
.cart-link svg { width: 26px; height: 26px; }
.cart-count {
  position: absolute; top: 2px; inset-inline-end: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--burgundy); color: #fff; font: 700 .72rem/20px var(--font-body); text-align: center; box-shadow: 0 0 0 2px #fff;
}
@media (hover: hover) and (pointer: fine) {
  .site-nav a:hover { background: var(--blush-soft); color: var(--burgundy); }
  .cart-link:hover { background: var(--blush-soft); }
}
@media (min-width: 768px) {
  :root { --header: 76px; }
  .brand img { height: 56px; }
  .site-nav { gap: 8px; }
  .site-nav__more { display: block; }
}
@media (max-width: 359px) { .site-nav a { padding-inline: 6px; font-size: .88rem; } }

/* ---------- الواجهة ---------- */
.hero { background: linear-gradient(180deg, #fff 0%, var(--paper) 100%); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero__inner { display: grid; gap: 28px; padding-block: 32px 40px; }
.eyebrow { display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px; background: var(--blush); color: var(--burgundy); font-size: .85rem; font-weight: 600; }
.hero h1 { font-size: clamp(2.1rem, 9vw, 4rem); line-height: 1.2; margin: 0 0 16px; color: var(--ink); }
.hero h1 span { color: var(--burgundy); display: block; }
.hero__lead { font-size: 1.08rem; color: var(--muted); max-width: 38ch; margin: 0 0 24px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero__actions .btn { flex: 1 1 180px; }
.hero__prices { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .95rem; }
.hero__prices b { color: var(--burgundy); font-weight: 700; }
/* قبعة ثلاثية الأبعاد (js/cap3d.js)، والشعار الثابت مكانها حتى تجهز أو إن تعذّر WebGL */
.hero__3d {
  position: relative; border-radius: 28px; overflow: hidden; aspect-ratio: 5 / 4;
  background: radial-gradient(circle at 50% 38%, #fff 0%, var(--blush-soft) 42%, var(--blush) 100%);
}
.hero__3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; opacity: 0; transition: opacity 600ms ease; }
.hero__3d canvas:active { cursor: grabbing; }
.hero__3d-fallback { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity 400ms ease; }
.hero__3d-fallback img { width: 46%; }
.hero__3d.is-ready canvas { opacity: 1; }
.hero__3d.is-ready .hero__3d-fallback { opacity: 0; }
.hero__3d-hint {
  position: absolute; bottom: 14px; inset-inline: 0; width: max-content; margin-inline: auto; padding: 4px 12px; border-radius: 999px;
  background: rgb(255 255 255 / .85); color: var(--muted); font-size: .82rem; pointer-events: none; opacity: 0; transition: opacity 300ms ease;
}
.hero__3d.is-ready .hero__3d-hint { opacity: 1; }
.hero__3d.was-dragged .hero__3d-hint { opacity: 0; }
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 56px; padding-block: 64px 72px; }
  .hero__3d { aspect-ratio: 1 / 1; }
  .hero__actions .btn { flex: 0 0 auto; }
}

.assure { list-style: none; padding: 0; margin-block: 24px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.assure li { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.assure svg { width: 38px; height: 38px; padding: 8px; flex: none; border-radius: 50%; background: var(--blush-soft); color: var(--burgundy); }
.assure strong { display: block; font-size: .95rem; line-height: 1.4; color: var(--ink); }
.assure span { display: block; font-size: .82rem; line-height: 1.5; color: var(--muted); margin-top: 2px; }
@media (min-width: 900px) { .assure { grid-template-columns: repeat(4, 1fr); gap: 14px; } .assure li { flex-direction: row; gap: 12px; padding: 18px; } }
@media (max-width: 359px) { .assure { grid-template-columns: 1fr; } }

/* ---------- الأقسام ---------- */
.section { padding-block: 48px; }
.section--top { padding-top: 24px; }
.section--tint { background: var(--card); border-block: 1px solid var(--line); }
.section__head { max-width: 62ch; margin-bottom: 24px; }
.section__head p { color: var(--muted); margin: 0; }
@media (min-width: 900px) { .section { padding-block: 72px; } .section--top { padding-top: 32px; } }

.categories { display: grid; gap: 16px; }
@media (min-width: 720px) { .categories { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.category {
  display: grid; grid-template-rows: auto 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden; text-decoration: none; color: inherit; transition: transform 200ms var(--ease-out), box-shadow 200ms ease;
}
.category:active { transform: scale(.99); }
.category__img { aspect-ratio: 1 / 1; background: var(--blush); overflow: hidden; }
.category__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms var(--ease-out); }
.category__body { padding: 18px 20px 20px; display: grid; gap: 6px; align-content: start; }
.category__body h3 { margin: 0; font-size: 1.35rem; }
.category__body p { margin: 0; color: var(--muted); font-size: .95rem; }
.category__price { font-weight: 700; color: var(--burgundy); margin-bottom: 10px; }
.category__body .btn { align-self: end; margin-top: 6px; }
.category--soon .btn { cursor: default; opacity: .6; }
/* على الهاتف: بطاقة أفقية قصيرة حتى تظهر الأقسام الثلاثة دون تمرير طويل */
@media (max-width: 719px) {
  .category { grid-template-rows: none; grid-template-columns: 40% 1fr; border-radius: var(--radius); }
  .category__img { aspect-ratio: auto; min-height: 196px; }
  .category__body { padding: 14px; gap: 4px; }
  .category__body h3 { font-size: 1.15rem; }
  .category__body p { font-size: .86rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .category__price { margin-bottom: 4px; font-size: .92rem; }
  .category__body .btn { min-height: 40px; padding: .4em .9em; font-size: .92rem; }
}
@media (hover: hover) and (pointer: fine) {
  .category:hover { box-shadow: var(--shadow); }
  .category:hover .category__img img { transform: scale(1.03); }
  .category:hover .btn:not(.btn--ghost) { background: var(--burgundy-deep); }
}

.feature { display: grid; gap: 28px; align-items: center; }
.feature__media { margin: 0; border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--line); max-width: 420px; justify-self: center; width: 100%; }
.feature__media img { width: 100%; aspect-ratio: 2 / 3; object-fit: contain; }
@media (min-width: 900px) { .feature { grid-template-columns: 1.2fr .8fr; gap: 56px; } }
.tools { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.tools li { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--blush-soft); color: var(--burgundy); font-weight: 500; font-size: .95rem; }
.tools svg { width: 22px; height: 22px; flex: none; }

.prices { display: grid; gap: 14px; }
@media (min-width: 900px) { .prices { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.price-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.price-table th, .price-table td { padding: 13px 16px; text-align: start; border-bottom: 1px solid var(--line); }
.price-table thead th { background: var(--burgundy); color: #fff; font-weight: 600; }
.price-table tbody th { font-weight: 500; }
.price-table tbody th a { color: var(--burgundy); text-decoration-color: var(--pink); text-underline-offset: 4px; }
.price-table td.num, .price-table th.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table tbody td.num { font-weight: 600; }
.price-table tr:last-child > * { border-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; display: grid; gap: 4px; align-content: start; padding: 18px; background: var(--paper); border-radius: var(--radius); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 50%;
  background: var(--burgundy); color: #fff; font: 700 1rem var(--font-display);
}
.steps strong { color: var(--ink); }
.steps span { color: var(--muted); font-size: .92rem; }

.faq { display: grid; gap: 8px; }
@media (min-width: 900px) { .faq { grid-template-columns: .8fr 1.2fr; gap: 48px; align-items: start; } }
.faq__list { display: grid; gap: 10px; }
.faq__item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.faq__item summary {
  list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ''; flex: none; width: 12px; height: 12px; border: solid var(--burgundy); border-width: 0 2px 2px 0;
  transform: translateY(-3px) rotate(45deg); transition: transform 200ms var(--ease-out);
}
.faq__item[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq__item p { margin: 0; padding: 0 18px 18px; color: var(--muted); }

.cta-band { background: var(--burgundy); color: #fff; text-align: center; padding-block: 56px; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--blush); margin-bottom: 24px; }

.reassure { margin-top: 28px; text-align: center; color: var(--muted); font-size: .92rem; }
.reassure-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.reassure-list li { display: flex; gap: 8px; align-items: flex-start; }
.reassure-list li::before {
  content: ''; flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--blush)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23650d2c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- التذييل ---------- */
.site-footer { background: var(--card); border-top: 1px solid var(--line); padding-block: 40px 110px; color: var(--muted); font-size: .92rem; }
.site-footer__grid { display: grid; gap: 28px; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } .site-footer { padding-bottom: 32px; } }
.site-footer__brand img { height: 64px; width: auto; margin-bottom: 10px; }
.site-footer__brand p { max-width: 42ch; }
.site-footer nav { display: grid; gap: 8px; align-content: start; }
.site-footer h2 { font-size: 1rem; margin: 0 0 4px; color: var(--ink); }
.site-footer nav a { text-decoration: none; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .site-footer nav a:hover { color: var(--burgundy); text-decoration: underline; text-decoration-color: var(--pink); } }

/* ---------- تنبيهات ---------- */
.notice { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--blush-soft); border-inline-start: 4px solid var(--pink); color: var(--ink); }
.notice strong { color: var(--burgundy); }

/* ---------- بطاقات المنتجات ---------- */
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-underline-offset: 3px; }
.products { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .products { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.products:has(> :only-child) { grid-template-columns: minmax(0, 420px); }
.product { display: grid; grid-template-rows: auto 1fr; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform 200ms var(--ease-out), box-shadow 200ms ease; }
.product:active { transform: scale(.99); }
.product__img { aspect-ratio: 3 / 4; background: #fff; }
.product__img img { width: 100%; height: 100%; object-fit: contain; }
.product__body { padding: 12px 14px 16px; display: grid; gap: 4px; align-content: start; border-top: 1px solid var(--line); }
.product__body h2 { margin: 0; font-size: 1.05rem; }
.product__price { color: var(--burgundy); font-weight: 700; font-size: .95rem; }
.product__body .muted { font-size: .85rem; }
.product__swatches { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.product__swatches .swatch-dot { width: 14px; height: 14px; margin: 0; }
@media (hover: hover) and (pointer: fine) { .product:hover { box-shadow: var(--shadow); } }

/* ---------- صفحة المنتج ---------- */
.product-page { display: grid; gap: 22px; padding-block: 16px 120px; }
.product-page > * { min-width: 0; }
@media (min-width: 900px) {
  .product-page { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; padding-block: 32px 64px; }
  .product-page__media { position: sticky; top: calc(var(--header) + 20px); }
}
.product-page__media { position: relative; margin: 0; border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--line); aspect-ratio: 4 / 5; }
@media (min-width: 900px) { .product-page__media { aspect-ratio: 3 / 4; } }
.product-page__media img { width: 100%; height: 100%; object-fit: contain; }
.product-page__media figcaption { position: absolute; inset-inline: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgb(255 255 255 / .94); color: var(--muted); font-size: .85rem; text-align: center; }
.product-page__media figcaption[hidden] { display: none; }
.product-page h1 { margin-bottom: 4px; }
.product-page__price { font: 700 1.5rem var(--font-display); color: var(--burgundy); margin-bottom: 8px; }
.product-page__price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
#options > p.muted { font-size: .95rem; }

.option { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.option legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.option legend span { font-weight: 500; color: var(--muted); }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choices--media { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; }
.choice input, .size-choice input, .swatch-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; } /* النقر على label */
.choice label {
  display: grid; gap: 2px; min-height: 56px; height: 100%; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform 160ms var(--ease-out);
}
.choice label:active, .size-choice label:active { transform: scale(.98); }
.choice label span { font-weight: 600; }
.choice label small { color: var(--muted); font-size: .85rem; }
.choice label small.extra { color: var(--burgundy); font-weight: 600; }
.choices--media .choice label { justify-items: center; text-align: center; padding: 10px 8px; }
.choices--media .choice label span { font-size: .88rem; line-height: 1.4; }
.choice label img { width: 56px; height: 75px; object-fit: contain; background: #fff; border-radius: 8px; margin-bottom: 4px; }
.choice input:checked + label { border-color: var(--burgundy); background: var(--blush-soft); box-shadow: inset 0 0 0 1px var(--burgundy); }
.choice input:focus-visible + label, .size-choice input:focus-visible + label, .swatch-choice input:focus-visible + label, .segmented input:focus-visible + label { outline: 3px solid var(--pink); outline-offset: 2px; }

.swatch-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch-choice { position: relative; }
.swatch-choice label { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color .15s ease, transform 160ms var(--ease-out); }
.swatch-choice label:active { transform: scale(.94); }
.swatch-choice label > span:first-child { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14); }
.swatch-choice input:checked + label { border-color: var(--burgundy); }
.swatch-dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; margin-inline-end: 8px; vertical-align: -4px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }

.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.toggle input { width: 22px; height: 22px; accent-color: var(--burgundy); flex: none; }
.toggle img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.toggle span { flex: 1; }
.toggle b { color: var(--burgundy); white-space: nowrap; }
.toggle:has(input:checked) { border-color: var(--burgundy); background: var(--blush-soft); }
.stack { display: grid; gap: 10px; }

.design-status { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px dashed var(--pink); border-radius: var(--radius-sm); background: var(--blush-soft); margin-bottom: 18px; }
.design-status img { width: 56px; height: 84px; object-fit: cover; border-radius: 8px; background: #fff; }
.design-status div { flex: 1; line-height: 1.5; }

.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.summary dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; padding-inline-start: 12px; text-align: end; font-variant-numeric: tabular-nums; }
.summary .total { font-weight: 700; color: var(--burgundy); font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.summary dl > .total:first-child, .summary dl > .total:first-child + dd { border-top: 0; padding-top: 0; margin-top: 0; }
.summary .deposit { color: var(--burgundy); font-weight: 600; }
.summary .note { grid-column: 1 / -1; font-size: .86rem; color: var(--muted); margin-top: 4px; text-align: start; padding: 0; }

/* شريط الشراء: ثابت أسفل الشاشة على الهاتف، وفي مكانه على الشاشات الكبيرة */
.buybar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: rgb(255 255 255 / .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px;
}
.buybar__price { flex: 1; line-height: 1.3; }
.buybar__price b { display: block; color: var(--burgundy); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.buybar__price small { color: var(--muted); }
.buybar .btn { flex: 1.4; min-height: 52px; }
@media (min-width: 900px) {
  .buybar:not(.buybar--fixed) { position: static; border: 0; padding: 0; background: none; backdrop-filter: none; }
  .buybar--fixed { padding-inline: max(var(--gutter), (100% - var(--max)) / 2); }
  .buybar--fixed .btn { flex: 0 0 280px; }
}

/* ---------- المقاس ---------- */
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 12px; border-radius: 999px; background: var(--blush-soft); border: 1px solid var(--line); position: relative; }
.segmented label { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 999px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
.segmented input:checked + label { background: var(--card); color: var(--burgundy); box-shadow: 0 1px 3px rgb(52 34 42 / .12); }
.size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 480px) { .size-grid { grid-template-columns: repeat(6, 1fr); } }
.size-choice { position: relative; }
.size-choice label {
  display: grid; place-items: center; gap: 0; min-height: 58px; padding: 6px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer; line-height: 1.3; transition: border-color .15s ease, background-color .15s ease, transform 160ms var(--ease-out);
}
.size-choice b { font: 700 1.05rem var(--font-latin); color: var(--ink); }
.size-choice small { color: var(--muted); font-size: .82rem; }
.size-choice input:checked + label { border-color: var(--burgundy); background: var(--burgundy); }
.size-choice input:checked + label b, .size-choice input:checked + label small { color: #fff; }
.size-number { margin-top: 14px; }
.sizing .hint { display: block; margin: 8px 0 0; font-size: .88rem; color: var(--muted); }
.sizing > .error { display: block; margin-top: 8px; color: var(--danger); font-weight: 500; font-size: .92rem; }
.sizing.invalid .size-number input { border-color: var(--danger); }
.measures { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.measures summary { cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--burgundy); }
.measures summary small { color: var(--muted); font-weight: 400; }
.measures[open] summary { border-bottom: 1px solid var(--line); }
.measures__grid { display: grid; gap: 12px; padding: 14px 16px 4px; }
@media (min-width: 480px) { .measures__grid { grid-template-columns: repeat(3, 1fr); } }
.measures .link-btn { margin: 4px 16px 14px; text-align: start; }
.unit-input { position: relative; }
.unit-input span { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.unit-input input { padding-inline-start: 44px; }

.size-table { grid-column: 1 / -1; max-width: 640px; }
.size-table h2 { font-size: 1.3rem; }

/* نافذة دليل القياس: لوحة سفلية على الهاتف ونافذة في الوسط على الشاشات الكبيرة */
.sheet {
  width: min(100%, 560px); max-height: 90dvh; margin: auto auto 0; padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  border: 0; border-radius: 24px 24px 0 0; background: var(--card); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  opacity: 1; transform: translateY(0);
  transition: opacity 250ms ease, transform 350ms var(--ease-drawer), overlay 350ms allow-discrete, display 350ms allow-discrete;
}
.sheet:not([open]) { opacity: 0; transform: translateY(100%); transition-duration: 150ms; }
@starting-style { .sheet[open] { opacity: 0; transform: translateY(100%); } }
.sheet::backdrop { background: rgb(52 34 42 / .45); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sheet__head h2 { margin: 0; font-size: 1.3rem; }
.sheet img { border-radius: var(--radius-sm); margin-bottom: 14px; }
.guide { margin: 0 0 12px; display: grid; gap: 4px 0; }
.guide dt { font-weight: 700; color: var(--burgundy); margin-top: 8px; }
.guide dd { margin: 0; }
@media (min-width: 640px) {
  .sheet { margin: auto; border-radius: 24px; padding: 24px; }
  .sheet:not([open]) { transform: translateY(12px) scale(.98); }
  @starting-style { .sheet[open] { transform: translateY(12px) scale(.98); } }
}

/* ---------- أداة التصميم ---------- */
.studio { display: grid; gap: 16px; padding-block: 16px 120px; }
.studio > * { min-width: 0; }
@media (min-width: 900px) { .studio { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; } }
.stage { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; place-items: center; }
.stage__frame { width: 100%; max-width: 520px; overflow: hidden; }
.stage__frame canvas { border-radius: 10px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 16px; }
.back-link { display: inline-block; margin-bottom: 6px; color: var(--muted); font-size: .9rem; text-underline-offset: 3px; }
.add-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.add-row .btn { flex-direction: column; gap: 4px; border-radius: var(--radius-sm); min-height: 68px; padding: 8px; font-size: .9rem; }
.add-row input[type=file] { display: none; }
.editor { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.editor[hidden] { display: none; }
.editor__empty { color: var(--muted); margin: 0; font-size: .95rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; transition: transform 160ms var(--ease-out); }
.swatch:active { transform: scale(.92); }
.swatch[aria-pressed=true] { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--burgundy); }
.swatches input[type=color] { width: 44px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }
.range { display: grid; gap: 4px; }
.range input { width: 100%; accent-color: var(--burgundy); }
.font-warning { font-size: .88rem; }

/* ---------- السلة والطلب ---------- */
.checkout { display: grid; gap: 24px; padding-block: 20px 64px; }
.checkout > * { min-width: 0; }
@media (min-width: 900px) {
  .checkout { grid-template-columns: minmax(0, 1fr) 420px; gap: 40px; align-items: start; padding-block: 32px 72px; }
  .cart { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header) + 20px); }
  .form { grid-column: 1; grid-row: 1; }
  .cart-empty .cart { grid-column: 1 / -1; position: static; }
}
.cart h1 { font-size: 1.6rem; }
.cart__items { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.cart-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.cart-item img { width: 64px; height: 86px; flex: none; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.cart-item__body { flex: 1; display: grid; gap: 2px; min-width: 0; line-height: 1.55; }
.cart-item__body .muted { font-size: .88rem; }
.cart-item__design { font-size: .85rem; color: var(--burgundy); }
.cart-item__actions { display: flex; gap: 16px; margin-top: 2px; }
.cart-item__price { white-space: nowrap; color: var(--burgundy); font-variant-numeric: tabular-nums; }
.cart-item--plain { align-items: center; }
.cart__empty { display: grid; gap: 6px; justify-items: start; padding: 24px; background: var(--card); border: 1px dashed var(--pink); border-radius: var(--radius); }
.cart__empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.upsell {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 14px; border: 1.5px dashed var(--pink); border-radius: var(--radius);
  background: var(--blush-soft); text-decoration: none; color: inherit; transition: transform 160ms var(--ease-out);
}
.upsell:active { transform: scale(.98); }
.upsell img { width: 48px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; }
.upsell span:not(.upsell__go) { flex: 1; display: grid; line-height: 1.5; }
.upsell small { color: var(--muted); }
.upsell__go { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--burgundy); color: #fff; font-size: 1.4rem; line-height: 1; flex: none; }
#cross-sell > .link-btn { display: inline-block; margin-bottom: 14px; }

.form { display: grid; gap: 18px; align-content: start; }
.form > h2 { margin: 0; font-size: 1.4rem; }
.form[hidden] { display: none; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; gap: 18px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field > label, .field > .label { font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); font: inherit; font-size: 16px; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--burgundy); box-shadow: 0 0 0 3px var(--blush); outline: none; }
.field .hint { font-size: .86rem; color: var(--muted); }
.field .error { font-size: .9rem; color: var(--danger); font-weight: 500; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.form-error { padding: 12px 14px; border-radius: var(--radius-sm); background: #fdecea; color: var(--danger); font-weight: 500; margin: 0; }

.cal { display: grid; gap: 18px; }
.cal__month h3 { font-size: 1rem; margin-bottom: 8px; color: var(--ink); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__dow { text-align: center; font-size: .75rem; color: var(--muted); }
.cal__day {
  min-height: 46px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font: 600 .95rem var(--font-body);
  color: var(--ink); cursor: pointer; display: grid; place-items: center; line-height: 1.1; padding: 2px; transition: transform 160ms var(--ease-out);
}
.cal__day:active { transform: scale(.94); }
.cal__day small { display: block; font-size: .6rem; font-weight: 500; color: var(--danger); }
.cal__day[disabled] { background: transparent; color: #b9aab0; cursor: not-allowed; border-style: dashed; transform: none; }
.cal__day[aria-pressed=true] { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.cal__legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--muted); }

.done { padding-block: 32px 72px; display: grid; gap: 18px; max-width: 640px; }
.done__head { text-align: center; display: grid; justify-items: center; }
.done__check { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--burgundy); color: #fff; margin-bottom: 14px; }
.done__check svg { width: 34px; height: 34px; stroke-width: 2.6; stroke-dasharray: 24; stroke-dashoffset: 0; }
.done__badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--blush); color: var(--burgundy); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.done__head p { margin: 0; }
.order-number { font: 700 1.6rem var(--font-latin); color: var(--burgundy); direction: ltr; letter-spacing: .02em; }
@media (prefers-reduced-motion: no-preference) {
  .done__check { animation: pop 450ms var(--ease-out) both; }
  .done__check svg { animation: draw 400ms 200ms var(--ease-out) both; }
  @keyframes pop { from { transform: scale(.6); opacity: 0; } }
  @keyframes draw { from { stroke-dashoffset: 24; } }
}

/* ---------- صفحات النصوص ---------- */
.prose { max-width: 760px; padding-bottom: 64px; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose ul { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--burgundy); text-decoration-color: var(--pink); text-underline-offset: 4px; }
.prose .price-table { margin-bottom: 1em; }

/* ---------- إشعارات ونافذة الموافقة ---------- */
.toast {
  position: fixed; inset-inline: var(--gutter); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 50; margin-inline: auto; max-width: 420px;
  padding: 12px 16px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; font-weight: 500; text-align: center;
  transition: opacity 200ms ease, transform 300ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(12px); } }
.toast--error { background: var(--danger); }
.toast[hidden] { display: none; }

.consent {
  position: fixed; inset-inline: var(--gutter); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; max-width: 520px; margin-inline: auto;
  display: grid; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px -12px rgb(52 34 42 / .35);
  font-size: .92rem; transition: opacity 250ms ease, transform 350ms var(--ease-out);
}
@starting-style { .consent { opacity: 0; transform: translateY(16px); } }
.consent p { margin: 0; }
.consent a { color: var(--burgundy); }
.consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
  .toast, .consent, .sheet { transition: opacity 150ms ease !important; transform: none !important; }
}
