/* =================================================================
   builder.css: صفحة «أنشئ نموذجك» ومعاينة المتجر
   ألوان المتجر وخطه متغيرات (--s-*) يضعها builder.js حسب الاختيار،
   وتخطيطه يتبع عرضه هو (container queries) فيعمل «عرض الجوال» داخل الكمبيوتر.
   ================================================================= */
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-arabic.woff2") format("woff2");
  font-weight: 160 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  src: url("../fonts/readex-latin.woff2") format("woff2");
  font-weight: 160 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212;
}

/* ---------- البداية: بطاقات المجال ---------- */
.b-hero { padding-bottom: 20px; }
.b-hero .demo-note { max-width: 46rem; }
.b-domains { padding-bottom: var(--section-space); }
.b-domain-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.b-domain {
  display: grid;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s var(--ease-out);
}
.b-domain img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.b-domain-body { display: grid; gap: 6px; padding: 16px 18px 18px; }
.b-domain-body strong { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.b-domain-body small { color: var(--text-2); font-size: 0.92rem; line-height: 1.6; }
.b-domain-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.b-domain:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .b-domain:hover { border-color: var(--accent); transform: translateY(-2px); } }
.b-other { margin-top: 20px; color: var(--text-2); font-size: 0.95rem; }

/* ---------- شريط أدوات المعاينة (خاص بنواة، منفصل عن المتجر) ---------- */
.b-toolbar { position: sticky; top: var(--header-h); z-index: 20; background: rgba(14, 16, 19, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.b-toolbar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-block: 10px; }
.b-summary { flex: 1; min-width: 160px; color: var(--text-2); font-size: 0.88rem; line-height: 1.5; }
.b-badge { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; white-space: nowrap; }
.b-device { display: none; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); }
.b-device button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 2px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; font-size: 0.86rem; }
.b-device button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
@media (min-width: 900px) { .b-device { display: inline-flex; } }
.b-copy-status { color: var(--accent); font-size: 0.88rem; }
.b-copy-status:empty { display: none; }
.b-copy-status:not(:empty) { padding-bottom: 10px; }
.b-copy-field { margin-top: 6px; max-width: 36rem; direction: ltr; font-size: 0.85rem; }
@media (max-width: 599px) {
  .b-toolbar { position: static; }
  .b-toolbar-inner { gap: 8px; }
  .b-badge { display: none; }
  .b-summary { order: 5; flex-basis: 100%; font-size: 0.82rem; }
  #b-copy { width: 40px; padding: 0; justify-content: center; }
  .b-copy-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #b-discuss { flex: 1; }
}

/* ---------- الاستوديو: لوحة التخصيص + المعاينة ---------- */
.b-studio-grid { display: grid; gap: 24px; align-items: start; padding-top: 20px; }
.b-stage-wrap { min-width: 0; }
.b-status { color: var(--text-2); font-size: 0.92rem; }
.b-status:not(:empty) { margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.b-retry { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

.b-panel { display: grid; gap: 20px; padding: 20px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line-strong); }
.b-panel-head { display: flex; align-items: center; justify-content: space-between; }
.b-panel-head h2 { font-size: 1.1rem; }
.b-panel-close { display: none; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: var(--text); cursor: pointer; }
.b-field { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.b-field legend, .b-field label { font-weight: 600; font-size: 0.95rem; padding: 0; margin-bottom: 8px; }
.b-field .hint { color: var(--text-2); font-weight: 400; font-size: 0.85rem; }
.b-mini-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.b-chip { position: relative; }
.b-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.b-chip-body { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 0.92rem; transition: border-color 0.2s, color 0.2s, background-color 0.2s; }
.b-chip input:checked + .b-chip-body { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.b-chip input:focus-visible + .b-chip-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.b-dots { display: inline-flex; }
.b-dots span { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); }
.b-dots span + span { margin-inline-start: -5px; }
.b-font-sample { font-size: 1.05rem; color: var(--text); }
.b-panel-note { color: var(--text-2); font-size: 0.85rem; line-height: 1.6; }

.b-result-stage { outline: none; transition: max-width 0.4s var(--ease-out); }
.b-result-stage.is-phone { max-width: 400px; margin-inline: auto; padding: 10px; border-radius: 44px; background: #050607; border: 1px solid rgba(255, 255, 255, 0.16); }
.b-result-stage.is-phone .store { border-radius: 34px; max-height: 800px; overflow-y: auto; }
.b-after { color: var(--text-2); text-align: center; padding: 24px 0 var(--section-space); }

.b-mobilebar, .b-scrim { display: none; }

@media (min-width: 1000px) {
  .b-studio-grid { grid-template-columns: 280px minmax(0, 1fr); gap: 32px; }
  .b-panel { position: sticky; top: calc(var(--header-h) + 76px); }
}
/* الجوال: اللوحة تفتح من الأسفل، والمعاينة تأخذ الشاشة كاملة */
@media (max-width: 999px) {
  .b-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    max-height: 82vh;
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.35s var(--ease-out), visibility 0s 0.35s;
  }
  .b-panel.is-open { transform: none; visibility: visible; transition: transform 0.35s var(--ease-out); }
  .b-panel-close { display: grid; }
  .b-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.5); }
  .b-mobilebar {
    display: flex;
    justify-content: center;
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(14, 16, 19, 0.95) 40%);
  }
  .b-mobilebar .btn { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); }
  .b-after { padding-bottom: 24px; }
}

/* ---------- المتجر نفسه ---------- */
.store {
  container-type: inline-size;
  position: relative;
  background: var(--s-bg);
  color: var(--s-text);
  font-family: var(--s-font);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--s-line);
  line-height: 1.75;
  scrollbar-width: thin;
}
.store h1, .store h2, .store h3 { font-family: var(--s-font); color: var(--s-text); letter-spacing: 0; }
.store :focus-visible { outline: 2px solid var(--s-accent); outline-offset: 2px; }
.store button, .store input { font-family: inherit; }

.st-nav { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--s-line); }
.st-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.st-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--s-accent); color: var(--s-on-accent); font-size: 1rem; }
.st-links { display: none; gap: 18px; margin-inline-start: auto; }
.st-links a { color: var(--s-muted); text-decoration: none; font-size: 0.95rem; }
.st-links a:hover { color: var(--s-text); }
.st-cart-btn { position: relative; margin-inline-start: auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--s-line); background: transparent; color: var(--s-text); cursor: pointer; font-size: 1.15rem; }
.st-count { position: absolute; top: -4px; inset-inline-start: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--s-accent); color: var(--s-on-accent); font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
@container (min-width: 640px) { .st-links { display: flex; } .st-cart-btn { margin-inline-start: 0; } }

.st-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 26px; border-radius: 999px; border: 0; background: var(--s-accent); color: var(--s-on-accent); font-weight: 700; text-decoration: none; cursor: pointer; transition: transform 0.12s; }
.st-btn:active { transform: scale(0.97); }
.st-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.st-hero h1 { font-size: clamp(1.8rem, 1.2rem + 3cqi, 3rem); line-height: 1.35; font-weight: 700; }
.st-hero p { color: var(--s-muted); margin: 14px 0 24px; max-width: 30rem; }
.st-hero--split { display: grid; align-items: center; gap: 8px; padding: 32px 20px 12px; }
.st-hero-3d { position: relative; aspect-ratio: 1 / 1; max-width: 480px; width: 100%; margin-inline: auto; cursor: grab; touch-action: pan-y; }
.st-hero-3d canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; transition: opacity 0.8s; }
.st-hero-3d.is-live canvas { opacity: 1; }
@container (min-width: 760px) { .st-hero--split { grid-template-columns: 1fr 1fr; padding: 48px 40px 24px; } }
.st-hero--photo { min-height: 420px; display: flex; align-items: flex-end; padding: 28px 20px; background-size: cover; background-position: center; }
.st-hero--photo .st-hero-copy { max-width: 34rem; color: #fff; }
.st-hero--photo h1 { color: #fff; text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4); }
.st-hero--photo p { color: rgba(255, 255, 255, 0.9); }
@container (min-width: 760px) { .st-hero--photo { min-height: 520px; padding: 56px 48px; align-items: center; } }

.st-section { padding: 36px 20px; }
.st-section > h2 { font-size: 1.5rem; margin-bottom: 18px; }
@container (min-width: 760px) { .st-section { padding: 48px 40px; } }
.st-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@container (min-width: 760px) { .st-grid { grid-template-columns: repeat(4, 1fr); } .st-grid--5 { grid-template-columns: repeat(5, 1fr); } }
.st-card { display: grid; gap: 6px; padding: 0 0 12px; border-radius: 16px; border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-text); text-align: right; cursor: pointer; overflow: hidden; transition: border-color 0.2s, transform 0.2s; }
.st-card[aria-pressed="true"] { border-color: var(--s-accent); box-shadow: 0 0 0 1px var(--s-accent); }
@media (hover: hover) and (pointer: fine) { .st-card:hover { transform: translateY(-2px); } }
.st-card-media img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.st-card-name { padding: 0 12px; font-weight: 600; line-height: 1.5; }
.st-card-price { padding: 0 12px; color: var(--s-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

.st-detail { display: grid; gap: 24px; border-top: 1px solid var(--s-line); }
.st-detail-media img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.st-detail-body h2 { font-size: 1.7rem; }
.st-kind { color: var(--s-muted); font-size: 0.92rem; }
.st-price { font-size: 1.5rem; font-weight: 700; color: var(--s-accent); margin-top: 6px; font-variant-numeric: tabular-nums; }
.st-desc { color: var(--s-muted); margin: 10px 0 18px; }
.st-form { display: grid; gap: 16px; }
.st-opt { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-opt legend, .st-opt > label, .st-opt > span { font-weight: 600; font-size: 0.95rem; padding: 0; }
.st-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.st-pill { position: relative; }
.st-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.st-pill span { display: inline-flex; min-height: 42px; align-items: center; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--s-line); color: var(--s-muted); transition: all 0.2s; }
.st-pill input:checked + span { border-color: var(--s-accent); color: var(--s-text); background: color-mix(in srgb, var(--s-accent) 14%, transparent); }
.st-pill input:focus-visible + span { outline: 2px solid var(--s-accent); outline-offset: 2px; }
.st-input { min-height: 46px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-text); max-width: 20rem; }
.st-hint { font-weight: 400; color: var(--s-muted); font-size: 0.86rem; }
.st-stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--s-line); justify-self: start; }
.st-stepper button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--s-surface); color: var(--s-text); font-size: 1.2rem; cursor: pointer; }
.st-stepper output { min-width: 32px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-add { justify-self: start; }
.st-added { color: var(--s-accent); font-size: 0.92rem; min-height: 1.5em; }
@container (min-width: 760px) { .st-detail { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; } }

.st-about { border-top: 1px solid var(--s-line); }
.st-about p { color: var(--s-muted); max-width: 40rem; }
.st-foot { padding: 20px; border-top: 1px solid var(--s-line); color: var(--s-muted); font-size: 0.85rem; }

.st-cart { width: min(420px, calc(100% - 24px)); margin-inline-end: 0; margin-block: auto; padding: 20px; border: 1px solid var(--s-line); border-radius: 20px; background: var(--s-bg); color: var(--s-text); font-family: var(--s-font); }
.st-cart::backdrop { background: rgba(0, 0, 0, 0.45); }
.st-cart-head { display: flex; align-items: center; justify-content: space-between; }
.st-cart-head h2 { font-size: 1.3rem; }
.st-x { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--s-line); background: transparent; color: var(--s-text); cursor: pointer; }
.st-cart-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; max-height: 50vh; overflow-y: auto; }
.st-cart-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--s-line); }
.st-cart-list small { display: block; color: var(--s-muted); font-size: 0.82rem; }
.st-empty { display: block !important; color: var(--s-muted); }
.st-cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; margin-bottom: 14px; }
.st-checkout { width: 100%; }
.st-cart-note { margin-top: 10px; color: var(--s-muted); font-size: 0.85rem; }

/* الصور قيد الرسم */
.st-skel { display: block; width: 100%; aspect-ratio: 1; background: linear-gradient(100deg, var(--s-surface) 30%, color-mix(in srgb, var(--s-text) 7%, var(--s-surface)) 50%, var(--s-surface) 70%); background-size: 300% 100%; animation: st-shimmer 1.4s linear infinite; }
.st-skel--round { position: absolute; inset: 12%; width: auto; border-radius: 50%; opacity: 0.6; }
@keyframes st-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.store.is-updating .st-card-media img, .st-main.is-updating img { opacity: 0.55; transition: opacity 0.2s; }
.st-card-media, .st-main { display: block; }
.st-main img, .st-main .st-skel { border-radius: 18px; border: 1px solid var(--s-line); }

/* أزرار التحكم بالمجسم */
.st-hero-view { display: grid; gap: 10px; }
.st-hero-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.st-hero-tools[hidden] { display: none; }
.st-hero-tools button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--s-line); background: transparent; color: var(--s-text); cursor: pointer; font-size: 0.85rem; }
.st-hero-tools button:disabled { opacity: 0.4; cursor: default; }
.st-hero-tools button[aria-pressed="true"] { border-color: var(--s-accent); }
@container (max-width: 459px) {
  .st-hero-tools span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .st-hero-tools button { width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 1.1rem; }
}
.st-hero-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.st-hero-msg { position: absolute; inset-inline: 12px; bottom: 12px; padding: 6px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.85rem; text-align: center; }

/* تفاصيل إضافية للمنتج */
.st-facts { margin: 0 0 18px; border-top: 1px solid var(--s-line); }
.st-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--s-line); font-size: 0.92rem; }
.st-facts dt { color: var(--s-muted); }
.st-facts dd { margin: 0; font-weight: 600; text-align: left; }
.st-gallery { display: flex; gap: 8px; margin-top: 10px; }
.st-gallery button { min-height: 40px; padding: 4px 16px; border-radius: 999px; border: 1px solid var(--s-line); background: transparent; color: var(--s-muted); cursor: pointer; }
.st-gallery button[aria-pressed="true"] { border-color: var(--s-accent); color: var(--s-text); }
.st-engrave-note { margin-top: 8px; min-height: 1.4em; }
.st-sample { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--s-line); }
.st-sub { font-size: 1.05rem; margin-bottom: 10px; }
.st-contents { margin: 0 0 22px; padding-inline-start: 1.4em; color: var(--s-muted); display: grid; gap: 2px; font-size: 0.93rem; }
.st-page { position: relative; display: grid; align-content: start; gap: 8px; min-height: 170px; padding: 34px 22px 22px; border-radius: 10px; background: #FBF8F2; color: #2A2520; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); overflow: hidden; }
.st-page-band { position: absolute; inset: 0 0 auto 0; height: 12px; background: var(--cover); }
.st-page strong { font-size: 1.1rem; }
.st-page p { color: #4A433B; font-size: 0.95rem; }
.st-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; color: var(--s-muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.st-pager button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--s-line); background: transparent; color: var(--s-text); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .st-skel { animation: none; }
  .b-panel, .b-panel.is-open { transition: none; }
}

/* Refinements for the expanded catalog and touch interaction. */
.st-grid--10{grid-template-columns:repeat(2,minmax(0,1fr))}.st-category{grid-column:1/-1}.st-card-media img{object-fit:contain}.st-hero-copy h1{font-size:clamp(30px,3.7vw,48px);line-height:1.5}.st-nav{min-width:0}.st-brand{min-width:0;overflow-wrap:anywhere}.st-hero-3d{touch-action:pan-y}
@container(min-width:760px){.st-grid--10{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:640px){.store-preview-active .b-toolbar-inner{padding:8px 14px}.store-preview-active .b-summary{display:none}.store-preview-active .b-toolbar .btn{padding:9px 11px;font-size:12px;min-height:42px}.store-preview-active .b-stage-wrap{min-width:0}.store-preview-active .st-back-nawah{padding:8px 16px}.store-preview-active .st-hero-copy h1{font-size:30px;line-height:1.55}.store-preview-active .st-nav{gap:10px;padding:14px 16px}.store-preview-active .st-links{font-size:12px;gap:10px}.store-preview-active .st-card-name{font-size:14px;line-height:1.7}.store-preview-active .b-mobilebar{padding-bottom:calc(12px + env(safe-area-inset-bottom))}.b-panel.is-open{max-height:85dvh;overflow-y:auto}}

@container (min-width: 760px) { .st-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Product studio: one focused surface, with native dialog focus handling. */
.product-open{overflow:hidden;scrollbar-gutter:stable}
.st-product-dialog{border:1px solid var(--s-line);border-radius:24px;padding:0;margin:auto;width:min(1100px,94vw);max-width:1100px;max-height:92dvh;background:var(--s-bg);color:var(--s-text);font:inherit;overscroll-behavior:contain}
.st-product-dialog::backdrop{background:rgba(7,10,14,.72);backdrop-filter:blur(12px)}
.st-product-top{position:sticky;top:0;z-index:3;display:flex;justify-content:space-between;align-items:center;padding:16px 24px;background:var(--s-bg);border-bottom:1px solid var(--s-line)}
.st-product-top button{font:inherit;color:inherit;background:transparent;border:1px solid var(--s-line);padding:10px 18px;border-radius:12px;cursor:pointer}
.st-product-dialog .st-detail{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:36px;padding:28px;margin:0}
.st-product-dialog .st-main{height:460px;aspect-ratio:auto;touch-action:pan-y;background:var(--s-bg)}
.st-main canvas{display:block;width:100%;height:100%}
.st-product-dialog .st-detail-body h2{font-size:clamp(24px,3vw,36px);line-height:1.5}
.st-product-dialog .st-form{margin-top:24px}
.st-hero-copy h1{font-size:clamp(30px,4vw,54px);line-height:1.35;text-wrap:balance}
.st-hero-copy p{font-size:17px;max-width:34ch;line-height:1.9}
.st-hero-tools{gap:6px}
.st-hero-tools button{font-size:12px;padding:8px 12px}
.st-card{border-radius:14px;overflow:hidden}
.st-card-name{font-size:16px;line-height:1.6}
.st-card-media{aspect-ratio:1/1.08}
@media(max-width:699px){
 .store-preview-active #site-header,.store-preview-active #site-footer{display:none}
 .store-preview-active .b-toolbar{position:static;border:0;background:transparent}
 .store-preview-active .b-toolbar-inner{padding:10px 16px;gap:8px}
 .store-preview-active #b-discuss,.store-preview-active .b-badge,.store-preview-active .b-summary{display:none}
 .store-preview-active #b-copy{margin-inline-start:auto}
 .store-preview-active .b-studio-grid{padding:0;gap:0;width:100%;max-width:none}
 .store-preview-active .store{border:0;border-radius:0}
 .st-back-nawah{display:none!important}
 .st-nav{padding:14px 20px;position:sticky;top:0;z-index:10}
 .st-hero--split{display:flex;flex-direction:column;padding:28px 20px 24px;gap:8px}
 .st-hero-copy{text-align:center;order:1}
 .st-hero-copy h1{font-size:32px;max-width:15ch;margin-inline:auto}
 .st-hero-copy p{font-size:15px;line-height:1.85;margin:12px auto 20px}
 .st-hero-view{order:2;width:100%}
 .st-hero-3d{height:310px;min-height:0;aspect-ratio:auto}
 .st-hero-tools{margin-top:0}
 .st-hero-tools button{min-height:40px}
 .st-section{padding:28px 18px}
 .st-section>h2{font-size:24px;margin-bottom:20px}
 .st-grid{gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
 .st-card-name{font-size:14px;padding-inline:10px}
 .st-card-price{font-size:14px;padding-inline:10px}
 .b-mobilebar{padding:10px 18px calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--line)}
 .b-mobilebar .btn{min-height:44px;width:100%;box-shadow:none;border-radius:12px}
 .st-product-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;border:0;border-radius:0}
 .st-product-top{padding:12px 16px}
 .st-product-top>span{font-size:13px}
 .st-product-dialog .st-detail{display:flex;flex-direction:column;gap:20px;padding:16px 20px 32px}
 .st-product-dialog .st-main{height:340px;max-height:43dvh}
 .st-product-dialog .st-detail-body h2{font-size:25px}
 .st-product-dialog .st-facts{font-size:14px}
 .st-product-dialog .st-desc{font-size:15px}
 .st-product-dialog .st-add{width:100%;min-height:52px}
}

/* ---------- زر الحياة: اسكب الحبوب، اقلب البطاقة، رشّ العطر ---------- */
.st-act { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 18px; border-radius: 999px; border: 1px solid var(--s-accent); background: var(--s-accent); color: var(--s-on-accent); cursor: pointer; font-weight: 600; font-size: 0.92rem; transition: transform 0.18s var(--ease-out), filter 0.18s; touch-action: manipulation; }
.st-act[hidden] { display: none; }
.st-act:active { transform: translateY(1px) scale(0.98); }
@media (hover: hover) { .st-act:hover { filter: brightness(1.08); } }
.st-act:focus-visible { outline: 2px solid var(--s-text); outline-offset: 3px; }
.st-hero-tools button.st-act { background: var(--s-accent); color: var(--s-on-accent); font-size: 0.92rem; padding: 6px 18px; }
.st-hero-tools button.st-act:disabled { opacity: 0.4; }
@media (max-width: 599px) {
  .st-hero-tools button.st-act { width: auto; height: 44px; padding: 6px 16px; }
  .st-hero-tools button.st-act span { position: static; width: auto; height: auto; clip: auto; overflow: visible; }
}
.st-detail-media .st-act { margin-top: 12px; }

/* =================================================================
   صفحة البداية: معاينة حية + طابع + بطاقات المجال
   ================================================================= */
.bs-hero { padding-block: clamp(28px, 5vw, 64px) clamp(16px, 3vw, 32px); overflow-x: clip; }
.bs-hero-grid { display: grid; gap: clamp(24px, 4vw, 56px); align-items: center; }
.bs-copy { display: grid; gap: 18px; justify-items: start; }
.bs-copy h1 { font-size: clamp(2.2rem, 5.2vw, 4rem); line-height: 1.15; text-wrap: balance; }
.bs-copy .lead { max-width: 30rem; }
.bs-go { display: inline-flex; align-items: center; gap: 8px; }

.bs-stage { --rx: 0deg; --ry: 0deg; position: relative; padding: 18px 8px 26px; perspective: 1400px; }
.bs-stage::before { content: ""; position: absolute; inset: 6% 4% 2%; border-radius: 40px; background: radial-gradient(60% 60% at 50% 40%, var(--accent-soft), transparent 70%); filter: blur(24px); opacity: 0.9; pointer-events: none; }
.bs-mock { position: relative; border-radius: 20px; overflow: hidden; background: var(--s-bg, #121314); color: var(--s-text, #f3efe7); font-family: var(--s-font, inherit); border: 1px solid var(--line-strong); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04); transform: rotateY(var(--ry)) rotateX(var(--rx)); transition: transform 0.35s var(--ease-out), background-color 0.35s, color 0.35s; }
.bs-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--s-surface, #1b1c20); border-bottom: 1px solid var(--s-line, rgba(255, 255, 255, 0.12)); }
.bs-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--s-line, rgba(255, 255, 255, 0.2)); }
.bs-url { margin-inline-start: 10px; flex: 1; max-width: 16rem; padding: 3px 12px; border-radius: 999px; background: var(--s-bg, #121314); color: var(--s-muted, #b6aea1); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-body { padding: 16px 20px 20px; display: grid; gap: 18px; }
.bs-nav { display: flex; align-items: center; justify-content: space-between; }
.bs-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; }
.bs-brand b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--s-accent, #d9c08a); color: var(--s-on-accent, #17130c); font-size: 0.8rem; }
.bs-links { display: inline-flex; gap: 10px; }
.bs-links u { display: block; width: 34px; height: 6px; border-radius: 3px; background: var(--s-line, rgba(255, 255, 255, 0.2)); text-decoration: none; }
.bs-m-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: center; }
.bs-m-copy { display: grid; gap: 8px; justify-items: start; }
.bs-m-copy h3 { font-size: clamp(1.05rem, 2.2vw, 1.5rem); line-height: 1.3; text-wrap: balance; }
.bs-m-copy p { color: var(--s-muted, #b6aea1); font-size: 0.82rem; }
.bs-m-btn { margin-top: 4px; padding: 7px 16px; border-radius: 999px; background: var(--s-accent, #d9c08a); color: var(--s-on-accent, #17130c); font-size: 0.8rem; font-weight: 600; }
.bs-m-art { aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--s-surface, #1b1c20); border: 1px solid var(--s-line, rgba(255, 255, 255, 0.12)); }
.bs-m-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bs-m-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bs-m-row span { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--s-surface, #1b1c20); border: 1px solid var(--s-line, rgba(255, 255, 255, 0.12)); min-width: 0; }
.bs-m-row em { font-style: normal; font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-m-row b { font-size: 0.74rem; color: var(--s-accent, #d9c08a); }
.bs-mock.is-swap .bs-body { animation: bs-swap 0.5s var(--ease-out); }
@keyframes bs-swap { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

.bs-float { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); font-size: 0.82rem; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.6); animation: bs-bob 6s ease-in-out infinite; }
.bs-float i { color: var(--accent); display: inline-flex; }
.bs-float--a { top: 0; inset-inline-start: -4px; }
.bs-float--b { bottom: 2px; inset-inline-end: -4px; animation-delay: -3s; }
@keyframes bs-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.bs-wizard { display: grid; gap: 22px; padding-bottom: var(--section-space); }
.bs-controls { display: grid; gap: 18px 28px; padding: 20px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--line-strong); }
.bs-name .input { max-width: 22rem; }
.bs-pick { font-size: clamp(1.3rem, 2.4vw, 1.8rem); margin-top: 8px; }

/* بطاقات المجال: صورة كبيرة، ميل خفيف، وبروز عند معاينتها */
.b-domain { position: relative; animation: bs-rise 0.6s var(--ease-out) both; animation-delay: calc(var(--n, 0) * 90ms); transition: border-color 0.2s, transform 0.25s var(--ease-out), box-shadow 0.25s; }
@keyframes bs-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.b-domain-media { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.b-domain-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out); }
.b-domain-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.b-domain-meta span { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.76rem; }
.b-domain.is-previewing { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .b-domain:hover { box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7); }
  .b-domain:hover .b-domain-media img { transform: scale(1.06); }
}

@media (min-width: 900px) {
  .bs-hero-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .bs-controls { grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 599px) {
  .bs-m-hero { grid-template-columns: 1fr; }
  .bs-m-art { max-height: 150px; aspect-ratio: 16 / 9; }
  .bs-m-row span:nth-child(3) { display: none; }
  .bs-m-row { grid-template-columns: repeat(2, 1fr); }
  .bs-float--a { top: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  .bs-float, .b-domain, .bs-mock.is-swap .bs-body { animation: none; }
  .bs-mock, .b-domain-media img { transition: none; }
}

.bs-wizard { scroll-margin-top: calc(var(--header-h, 72px) + 12px); }

.st-hero-3d, .st-main { touch-action: pan-y; }

/* صورة جاهزة تملأ مكان المجسم لحين اكتمال المشهد الحي، فلا تظهر شاشة تحميل */
.st-hero-3d, .st-main { position: relative; }
.st-hero-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.st-hero-3d canvas, .st-main canvas { position: relative; z-index: 1; }

/* ساعة الوقت الحقيقي بجانب الساعات */
.st-clock { margin-top: 14px; font-variant-numeric: tabular-nums; color: var(--s-muted); font-size: 0.95rem; }
.st-clock::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 8px; border-radius: 50%; background: var(--s-accent); animation: st-pulse 2s ease-in-out infinite; }
@keyframes st-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .st-clock::before { animation: none; } }

/* شريط المنتج المختار تحت العارض */
.st-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--s-line); background: var(--s-surface); }
.st-pick-info { display: grid; gap: 2px; min-width: 0; }
.st-pick-info strong { font-size: 1rem; overflow-wrap: anywhere; }
.st-pick-info span { color: var(--s-accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-pick-open { min-height: 44px; }
.st-card { cursor: pointer; }

/* بطاقات المجال: شبكة 2×2 دائمًا (أريح للعين) على الكمبيوتر والجوال */
.b-domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .b-domain-grid { gap: 10px; }
  .b-domain-body { padding: 10px 12px 12px; gap: 4px; }
  .b-domain-body strong { font-size: 0.98rem; }
  .b-domain-body small { font-size: 0.78rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .b-domain-meta { display: none; }
  .b-domain-go { font-size: 0.82rem; }
}

/* خمس باقات: البطاقة الأخيرة تمتد على عرض الصف في العرض الضيق */
@container (max-width: 759px) { .st-grid--5 > .st-card:nth-child(5):last-child { grid-column: 1 / -1; } }


/* ---------- وضع التضمين: المنشئ داخل إطار في الرئيسية ---------- */
.is-embed .site-header, .is-embed #site-footer, .is-embed .st-back-nawah, .is-embed .nawah-dock { display: none !important; }
.is-embed body { padding-bottom: 0 !important; }
.embed-preview, .embed-preview body { overflow: hidden; }
.embed-preview #b-start, .embed-preview .b-toolbar, .embed-preview .b-panel, .embed-preview .b-mobilebar, .embed-preview .b-status, .embed-preview .b-after, .embed-preview .b-scrim { display: none !important; }
.embed-preview .b-studio-grid { display: block; max-width: none; padding: 0; margin: 0; }
.embed-preview .b-stage-wrap, .embed-preview .b-result-stage { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; max-width: none; width: 100%; }
