/* ============================================================
   Brimo — product.css
   Product DETAIL page only (product.html). Loaded AFTER style.css.
   The view itself is rendered by initProductDetail() in js/main.js.
   ============================================================ */

.product-detail {
  position: relative;
  isolation: isolate;
  padding-block: clamp(1.25rem, 3vw, 2.25rem) clamp(3.5rem, 7vw, 5.5rem);
  background:
    radial-gradient(46rem 30rem at 100% 0%, color-mix(in srgb, var(--sp-indigo) 10%, transparent), transparent 62%),
    var(--paper);
}

/* ==================== BREADCRUMBS ==================== */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--mist);
}
.crumbs a { color: var(--mist); }
.crumbs a:hover { color: var(--brand); }
.crumbs svg { color: var(--line); flex: none; }
.crumbs [aria-current="page"] { color: var(--ink); }

/* ==================== MAIN LAYOUT ==================== */
.pd {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

/* ---- The stage: category-tinted glow + the logo's ring behind the bottle ---- */
.pd__stage {
  --cat: var(--brand);
  position: relative;
  isolation: isolate;
  aspect-ratio: 1 / 1.04;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  background:
    radial-gradient(70% 46% at 50% 100%, color-mix(in srgb, var(--cat) 34%, transparent), transparent 72%),
    radial-gradient(92% 82% at 50% 30%, color-mix(in srgb, var(--cat) 15%, #fff), color-mix(in srgb, var(--cat) 4%, #fff) 76%);
  perspective: 900px;
}
.pd__stage .bubbles { z-index: 0; }
.pd__stage > .bubble-field { z-index: 1; }
.pd__ring {
  position: absolute;
  left: 50%;
  top: 49%;
  z-index: 0;
  width: 80%;
  aspect-ratio: 1.12 / 1;
  translate: -50% -50%;
  rotate: -14deg;
  border-radius: 50%;
  background: var(--ring);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
          mask: radial-gradient(closest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
  opacity: 0.9;
  animation: spin 90s linear infinite;
}
.pd__halo {
  position: absolute;
  left: 50%;
  top: 49%;
  z-index: 0;
  width: 70%;
  aspect-ratio: 1.12 / 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0.85) 55%, rgba(255, 255, 255, 0));
}
.pd__floor {
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: 7%;
  height: 4.5%;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(20, 22, 63, 0.34), transparent 70%);
  filter: blur(6px);
}
.pd__img {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 8%;
  margin-inline: auto;
  height: 82%;
  width: auto;
  max-width: 72%;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(20, 22, 63, 0.25)) drop-shadow(0 28px 28px rgba(20, 22, 63, 0.25));
  transform: rotateY(calc(var(--tx, 0) * 9deg)) rotateX(calc(var(--ty, 0) * -6deg));
  transition: transform 0.25s ease-out;
  /* `backwards`, not `both`: a held `transform` would block the pointer tilt */
  animation: rise 0.9s var(--ease) backwards, pd-float 7s ease-in-out 1s infinite alternate;
}
@keyframes pd-float { from { translate: 0 0; } to { translate: 0 -12px; } }

.pd__chip { position: absolute; z-index: 3; left: 1.1rem; top: 1.1rem; }

/* ---- Info column ---- */
.pd__info { display: flex; flex-direction: column; gap: 1.75rem; min-width: 0; }
.pd__text-block .tag { margin-bottom: 1.1rem; }
.pd__text-block h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin-bottom: 1rem; }
.pd__lede {
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 0.9rem;
}
.pd__text {
  max-width: 36rem;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--mist);
}

.pd__facts { list-style: none; margin: 0; padding: 1.25rem 0 0; border-top: 1px solid var(--line); display: grid; gap: 0.8rem; }
.pd__facts li { display: flex; align-items: center; gap: 0.85rem; font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.pd__facts .icon-bubble { width: 2.5rem; height: 2.5rem; border-radius: 12px; }

/* Actions row stays LTR regardless of the product text direction. */
.pd__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
.wa-icon { flex: none; }
.lang-toggle { font-family: var(--font-body), var(--font-ar); }

/* ---- Arabic (RTL) mode — only the text block flips ---- */
.pd__text-block[dir="rtl"] { font-family: var(--font-ar); text-align: right; }
.pd__text-block[dir="rtl"] h1 { font-family: var(--font-ar); font-weight: 800; letter-spacing: 0; line-height: 1.35; }
.pd__text-block[dir="rtl"] .pd__lede,
.pd__text-block[dir="rtl"] .pd__text { line-height: 1.95; }
.pd__text-block[dir="rtl"] .tag { letter-spacing: 0; }

/* ---- Not-found / error states (never blank) ---- */
.detail-msg { grid-column: 1 / -1; text-align: center; max-width: 34rem; margin-inline: auto; padding-block: clamp(2rem, 6vw, 4rem); }
.detail-msg .eyebrow { justify-content: center; }
.detail-msg h1 { margin-bottom: 0.75rem; font-size: clamp(2rem, 5vw, 3rem); }
.detail-msg p:not(.eyebrow) { color: var(--mist); font-size: 1.1rem; margin-bottom: 1.75rem; }

/* ==================== RELATED ==================== */
.related { padding-top: clamp(1rem, 3vw, 2rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.related[hidden] { display: none; }

/* ==================== MOBILE ORDER BAR ==================== */
.order-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem var(--gutter) calc(0.7rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px rgba(20, 22, 63, 0.1);
  transform: translateY(110%);
  transition: transform 0.4s var(--ease);
}
.order-bar.is-on { transform: none; }
.order-bar__name { flex: 1; min-width: 0; line-height: 1.25; }
.order-bar__name small { display: block; font-weight: 700; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); }
.order-bar__name strong { display: block; font-size: 0.95rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 860px) {
  .pd { grid-template-columns: 1fr; }
  .pd__stage { max-width: 32rem; margin-inline: auto; width: 100%; }
}
@media (max-width: 780px) {
  .order-bar { display: flex; }
  body.has-order-bar { padding-bottom: 4.5rem; }
  body.has-order-bar .whatsapp-float { display: none; }
}
@media (max-width: 480px) {
  .pd__actions .btn { flex: 1 1 100%; }
  .pd__actions .btn--sm { flex: 1 1 calc(50% - 0.4rem); }
}
