/* Beit 3D — الواجهة. الألوان قابلة للتغيير من هنا */
:root {
  --b3d-accent: #b8894f;
  --b3d-accent-ink: #ffffff;
  --b3d-ink: #1d221f;
  --b3d-muted: #5d655f;
  --b3d-line: #dcddd6;
  --b3d-surface: #ffffff;
  --b3d-stage: #f2f1ee;
  --b3d-chip: #eceee8;
}

.b3d-btn {
  display: inline-flex !important; width: auto !important; max-width: 100%;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--b3d-accent); color: var(--b3d-accent-ink);
  border: 0; border-radius: 10px; padding: 10px 16px;
  font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .16);
  transition: transform .15s ease, box-shadow .15s ease;
}
.b3d-btn, .b3d-btn span, .b3d-btn svg { color: var(--b3d-accent-ink) !important; fill: currentColor; }
.b3d-btn { background: var(--b3d-accent) !important; }
.b3d-btn:hover { background: #a3783f !important; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(60,35,20,.3); }
.b3d-btn:focus-visible { outline: 2px solid var(--b3d-accent); outline-offset: 3px; }
.b3d-btn-overlay { position: absolute !important; bottom: 16px; inset-inline-start: 16px; z-index: 20; }
@media (max-width: 767px) { .b3d-btn-overlay { bottom: 12px; inset-inline-start: 12px; padding: 9px 14px; font-size: 14px; } }
.b3d-btn-summary { margin-block: 12px; }
.b3d-btn-float { position: fixed !important; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); inset-inline-start: 18px; z-index: 9990; }

html.b3d-lock, html.b3d-lock body { overflow: hidden; }
.b3d-modal[hidden] { display: none !important; }
.b3d-modal {
  position: fixed; inset: 0; z-index: 999999;
  background: rgba(20, 22, 21, .55);
  display: flex; align-items: center; justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}
.b3d-modal-box {
  width: min(1200px, 100%); height: min(820px, 100%);
  background: var(--b3d-surface); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; color: var(--b3d-ink);
}
.b3d-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--b3d-line); }
.b3d-title { font-size: 17px; }
.b3d-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--b3d-line); background: var(--b3d-surface); color: var(--b3d-ink); font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.b3d-stage { position: relative; flex: 1; min-height: 0; background: var(--b3d-stage); touch-action: none; }
.b3d-canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.b3d-canvas.b3d-hot { cursor: pointer; }
.b3d-canvas:active { cursor: grabbing; }
.b3d-hint { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 2; background: rgba(255, 255, 255, .9); border: 1px solid var(--b3d-line); border-radius: 10px; padding: 6px 12px; font-size: 13px; color: var(--b3d-muted); }
.b3d-hint[hidden], .b3d-loading[hidden] { display: none; }
.b3d-loading, .b3d-inline-load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--b3d-muted); font-size: 14px; }
.b3d-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--b3d-line); }
.b3d-group { display: flex; gap: 4px; background: var(--b3d-chip); border-radius: 10px; padding: 4px; }
.b3d-group button { border: 0; background: transparent; color: var(--b3d-ink); border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.b3d-group button:hover { background: var(--b3d-surface); }
.b3d-group button[aria-pressed="true"] { background: var(--b3d-surface); box-shadow: inset 0 0 0 1px var(--b3d-accent); }
.b3d-group button.b3d-primary { background: var(--b3d-accent); color: var(--b3d-accent-ink); }
.b3d-group button[hidden] { display: none; }
.b3d-swatches { display: flex; align-items: center; gap: 8px; }
.b3d-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--b3d-surface); box-shadow: 0 0 0 1px var(--b3d-line); padding: 0; cursor: pointer; }
.b3d-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--b3d-accent); }
.b3d-fname { font-size: 13px; color: var(--b3d-muted); margin-inline-start: 4px; }

.b3d-inline { position: relative; width: 100%; border-radius: 16px; overflow: hidden; background: var(--b3d-stage); touch-action: pan-y; }

@media (max-width: 640px) {
  .b3d-inline { height: 380px !important; }
  .b3d-modal { padding: 0; }
  .b3d-modal-box { border-radius: 0; height: 100%; }
  .b3d-bar { justify-content: center; }
  .b3d-group button { padding: 7px 9px; }
}
