@charset "UTF-8";

/* ============================================================================
   حاسبة السعر — منطقة الرفع والعارض ثلاثي الأبعاد
   ========================================================================== */

/* ─── منطقة السحب والإفلات ───────────────────────────────────────────────── */

.dropzone {
  border: 2px dashed #c9bfae;
  border-radius: var(--r);
  background: var(--card);
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.dropzone:hover,
.dropzone:focus-visible { border-color: var(--ink); }
.dropzone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-bg);
  border-style: solid;
}

.dropzone { padding-block: clamp(2.5rem, 7vw, 4.5rem); }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: #fffaf5; }
.dropzone__badge {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1.1rem;
  display: grid; place-items: center; background: #fff1e6;
  box-shadow: 0 0 0 10px rgba(255,102,0,.06);
}
.dropzone__icon { width: 36px; height: 36px; color: var(--accent); }
.dropzone__title { font-family: var(--display); font-size: 1.3rem; }
.dropzone .link-btn {
  display: inline-block; margin-top: .4rem; padding: .6rem 1.2rem; border-radius: var(--r);
  background: var(--accent); color: var(--brand-ink); text-decoration: none; font-weight: 700;
}
.dropzone .link-btn:hover { background: #ff7a1f; color: var(--brand-ink); }
.dropzone.is-dragging .dropzone__icon { color: var(--accent); }

.dropzone__title { font-size: 1.05rem; font-weight: 600; margin-bottom: .3rem; }
.dropzone__or { font-size: .92rem; color: var(--muted); margin-bottom: .9rem; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent-ink); }

/* ─── شريط التقدّم ───────────────────────────────────────────────────────── */

.upload-state { margin-top: 1rem; }
.upload-state__bar {
  height: 4px;
  background: var(--sunken);
  border-radius: 999px;
  overflow: hidden;
}
.upload-state__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}
.upload-state__bar.is-indeterminate span {
  width: 35%;
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  0%   { margin-inline-start: -35%; }
  100% { margin-inline-start: 100%; }
}

/* ─── العارض ─────────────────────────────────────────────────────────────── */

.viewer {
  position: relative;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
@media (max-width: 640px) { .viewer { aspect-ratio: 1 / 1; } }

.viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;   /* نتولّى اللمس بأنفسنا للتدوير */
}

.viewer__tools {
  position: absolute;
  top: .6rem;
  inset-inline-end: .6rem;
  display: flex;
  gap: .4rem;
}
.viewer__tools .btn { background: var(--card); }

.viewer__hint {
  position: absolute;
  bottom: .5rem;
  inset-inline-start: .7rem;
  color: var(--muted);
  pointer-events: none;
}

.btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ─── السعر ──────────────────────────────────────────────────────────────── */

.price-total {
  border-top: 1px solid var(--line);
  margin-top: .6rem;
  padding-top: .3rem;
}
.price-total dd { color: var(--ink); }

#price-panel.is-loading { opacity: .55; }

.panel[aria-disabled="true"] { pointer-events: none; }
.panel[aria-disabled="true"] .panel__body { opacity: .4; filter: grayscale(1); }
.optlock { display: none; }
#options-panel[aria-disabled="true"] .optlock {
  display: flex; align-items: center; gap: .5rem; margin: 0; padding: .7rem 1.2rem;
  background: #fff1e6; color: var(--accent-ink); font-size: .88rem; font-weight: 600;
  border-bottom: 1px solid #ffd4b3;
}
#options-panel[aria-disabled="true"] .optlock::before { content: "↑"; font-weight: 700; }

/* summary داخل panel__head */
details > summary.panel__head {
  cursor: pointer;
  list-style: none;
}
details > summary.panel__head::-webkit-details-marker { display: none; }
details > summary.panel__head::after {
  content: '+';
  font-family: var(--mono);
  color: var(--muted);
}
details[open] > summary.panel__head::after { content: '−'; }

/* ─── عيّنات الألوان ─────────────────────────────────────────────────────── */

.swatches { gap: .45rem; }
.swatch span { width: 28px; height: 28px; }

/* تلميح العارض: فأرة على الحاسوب، لمس على الجوال */
.hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}
@media (max-width: 640px) {
  .viewer__hint { background: rgba(255,255,255,.8); padding: .15rem .4rem; border-radius: 4px; }
}
