/* ═══════════════════════════════════════════════════════════════
   [Phase 10 ✅] Product Detail — Split-Panel Shell
   Desktop (≥1024px): left ≈60% gallery with vertical thumb strip,
                       right ≈40% sticky info panel.
   Phone (<640px):    stacked; bottom-safe-area sticky CTA (price+button).
   IDs preserved so product.js keeps rendering unchanged. Adds .pd-cta-row
   via a tiny product.js patch for reliable targeting.
   ═══════════════════════════════════════════════════════════════ */

.product-detail-container {
  max-width: 1360px;
  margin: 24px auto 32px;
  padding: 0 clamp(20px, 3.5vw, 40px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

@media (min-width: 1024px) {
  .product-detail-container {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
}

/* ─── Gallery frame (left panel) ─── */
.product-gallery-frame {
  background: var(--theme-surface, var(--bg-secondary));
  border: 1px solid var(--theme-border, var(--card-border));
  border-radius: 22px;
  padding: 14px;
  box-shadow: var(--shadow-md, 0 4px 12px -4px rgba(2, 6, 23, 0.25));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  position: relative;
}

.product-gallery-frame .carousel-container {
  aspect-ratio: 1 / 1;
  border-radius: 16px !important;
  overflow: hidden;
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--card-border) !important;
}

.product-gallery-frame img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-gallery-frame:hover img { transform: scale(1.02); }

/* Thumbnails — horizontal strip on phone, vertical rail on desktop */
.product-gallery-frame .carousel-thumbnails {
  padding: 4px 2px !important;
  gap: 8px !important;
}
.product-gallery-frame .thumb-item {
  width: 56px !important;
  height: 56px !important;
  border-radius: 10px !important;
  transition: border-color 150ms ease, transform 150ms ease !important;
}
.product-gallery-frame .thumb-item:hover { transform: translateY(-1px); }

@media (min-width: 1024px) {
  .product-gallery-frame {
    display: grid;
    grid-template-columns: 76px 1fr;
    grid-template-rows: 1fr;
    gap: 14px;
    padding: 16px;
  }
  .product-gallery-frame .carousel-container {
    grid-column: 2;
    grid-row: 1;
    aspect-ratio: 1 / 1;
  }
  .product-gallery-frame .carousel-thumbnails {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column !important;
    justify-content: flex-start !important;
    overflow-y: auto;
    overflow-x: visible;
    max-height: 100%;
    padding: 2px 0 !important;
  }
  .product-gallery-frame .thumb-item {
    width: 64px !important;
    height: 64px !important;
  }
}

/* Carousel arrow buttons refined */
#carousel-prev, #carousel-next {
  background: rgba(2, 6, 23, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  width: 40px !important; height: 40px !important;
  transition: background 150ms ease, transform 150ms ease;
}
#carousel-prev:hover, #carousel-next:hover {
  background: rgba(2, 6, 23, 0.75) !important;
  transform: translateY(-50%) scale(1.05) !important;
}

/* ─── Info panel (right) ─── */
.product-meta-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (min-width: 1024px) {
  .product-meta-content {
    position: sticky;
    top: calc(var(--header-h, 60px) + 20px);
    max-height: calc(100dvh - var(--header-h, 60px) - 40px);
    overflow-y: auto;
    padding-inline-end: 4px;
    scrollbar-width: thin;
  }
}

.product-meta-header .prod-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.product-meta-header .tag-badge {
  background: color-mix(in srgb, var(--accent-color) 12%, transparent);
  color: var(--accent-color);
  border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
  padding: 4px 12px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-meta-content h1 {
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

.price-stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.product-meta-price {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.01em;
  line-height: 1;
}

.low-stock-pulse {
  background: color-mix(in srgb, #ef4444 12%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
  color: #ef4444;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: borderPulse 1.8s infinite;
}
@keyframes borderPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.stock-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stock-badge.available {
  background: color-mix(in srgb, #10b981 12%, transparent);
  border: 1px solid color-mix(in srgb, #10b981 30%, transparent);
  color: #10b981;
}
.stock-badge.available::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px 1px rgba(16, 185, 129, 0.6);
}
.stock-badge.out-of-stock {
  background: color-mix(in srgb, var(--text-muted) 15%, transparent);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}

.product-meta-desc {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* ─── Wholesale tiers ─── */
.wholesale-badge-table {
  background: color-mix(in srgb, var(--accent-color) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-color) 25%, transparent);
  border-radius: 14px;
  padding: 14px 16px;
}
.wholesale-badge-table h4 {
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wholesale-badge-table h4 svg { color: var(--accent-color); }
.wholesale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  text-align: center;
}
.wholesale-tier-card {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  padding: 10px 8px;
  border-radius: 10px;
  transition: border-color 150ms ease, transform 150ms ease;
}
.wholesale-tier-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-1px);
}
.wholesale-tier-card .tier-qty {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.wholesale-tier-card .tier-discount {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-color);
  margin-top: 2px;
}

/* ─── Add-on: gift wrap ─── */
.checkout-addons-box {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 16px;
}
.checkout-addons-box label > span:first-of-type {
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}
.gift-style-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  padding: 8px;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
  font-weight: 600;
}
.gift-style-btn.active {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 10%, transparent);
  color: var(--accent-color);
}

/* ═══════════════════════════════════════════════════════════════
   [Phase 10 v2] Deep polish — entrance stagger, toggle switch,
   refined stepper, wishlist heartbeat, add-to-cart success morph,
   active thumb indicator, image zoom, loading skeleton.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Entrance stagger ─── */
.pd-fade-in {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 420ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.pd-fade-in.is-in { opacity: 1; transform: translateY(0); }

/* ─── Active thumb (vertical rail + horizontal strip) ─── */
.product-gallery-frame .thumb-item {
  position: relative;
}
.product-gallery-frame .thumb-item::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
  pointer-events: none;
}
.product-gallery-frame .thumb-item.active::after,
.product-gallery-frame .thumb-item[style*="var(--accent-color)"]::after {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 20%, transparent);
}

@media (min-width: 1024px) {
  /* Desktop vertical rail — animated left accent indicator on active thumb */
  .product-gallery-frame .carousel-thumbnails { position: relative; }
  .product-gallery-frame .thumb-item.active::before {
    content: '';
    position: absolute;
    inset-inline-start: -8px;
    top: 10%; bottom: 10%;
    width: 3px; border-radius: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 12px 2px color-mix(in srgb, var(--accent-color) 55%, transparent);
    animation: pd-thumb-mark 320ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}
@keyframes pd-thumb-mark {
  from { transform: scaleY(0.2); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}

/* ─── Main gallery — gentle zoom on hover (desktop only) ─── */
@media (min-width: 1024px) {
  .product-gallery-frame .carousel-container { position: relative; }
  .product-gallery-frame .carousel-container::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(120% 60% at 50% 100%,
                  rgba(2, 6, 23, 0.35) 0%, transparent 55%);
    pointer-events: none; opacity: 0;
    transition: opacity 220ms ease;
  }
  .product-gallery-frame .carousel-container:hover::after { opacity: 1; }
  .product-gallery-frame .carousel-container:hover img {
    transform: scale(1.05);
  }
}

/* ─── Gift wrap card v2 — head row + real toggle switch ─── */
.pd-gift-head {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  padding: 2px 0;
}
.pd-gift-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #f59e0b;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pd-gift-icon svg { width: 20px; height: 20px; }
.pd-gift-head:hover .pd-gift-icon { transform: rotate(-6deg) scale(1.06); }
.pd-gift-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-gift-title {
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-weight: 700; font-size: 14px;
  color: var(--text-primary); letter-spacing: -0.005em;
}
.pd-gift-sub {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.pd-switch {
  position: relative;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.pd-switch input {
  position: absolute; inset: 0;
  opacity: 0; width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.pd-switch-track {
  position: absolute; inset: 0;
  background: var(--card-border);
  border-radius: 999px;
  transition: background 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pd-switch-thumb {
  position: absolute;
  top: 3px; inset-inline-start: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(2, 6, 23, 0.35);
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pd-switch input:checked ~ .pd-switch-track {
  background: var(--accent-color);
}
.pd-switch input:checked ~ .pd-switch-track .pd-switch-thumb {
  transform: translateX(20px);
}
[dir="rtl"] .pd-switch input:checked ~ .pd-switch-track .pd-switch-thumb {
  transform: translateX(-20px);
}
.pd-switch input:focus-visible ~ .pd-switch-track {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 22%, transparent);
}

/* Gift wrap expanded options */
.pd-gift-options {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--card-border);
  animation: pd-gift-open 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pd-gift-open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pd-mini-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  display: block; margin-bottom: 8px;
}
.pd-gift-style-row {
  display: flex; gap: 6px;
}
.pd-gift-style-row .gift-style-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12.5px;
  border-radius: 10px;
  font-weight: 600;
}
.pd-gift-msg { margin-top: 14px; }
.pd-gift-msg textarea {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.pd-gift-msg textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 18%, transparent);
}

/* ─── CTA row (quantity + add-to-cart + wishlist) ─── */
.pd-cta-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 4px;
  flex-wrap: wrap;
}
.pd-cta-row input[type="number"] { -moz-appearance: textfield; }
.pd-cta-row input[type="number"]::-webkit-outer-spin-button,
.pd-cta-row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Quantity stepper */
.pd-qty {
  display: inline-flex;
  align-items: center;
  height: 52px;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 150ms ease;
}
.pd-qty:hover { border-color: color-mix(in srgb, var(--accent-color) 40%, var(--card-border)); }
.pd-qty-btn {
  width: 44px; height: 100%;
  background: transparent; border: none;
  color: var(--text-primary);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}
.pd-qty-btn:hover { background: var(--bg-secondary); }
.pd-qty-btn:active { transform: scale(0.92); }
.pd-qty-btn svg { width: 16px; height: 16px; }
.pd-cta-row #qty-val {
  width: 40px; height: 100%;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700; font-size: 15px;
}

/* Add to cart button — with success morph */
.pd-add-btn {
  flex: 1 1 200px;
  min-height: 52px;
  position: relative;
  border-radius: 14px !important;
  overflow: hidden;
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif !important;
  font-weight: 700 !important;
  font-size: 14.5px !important;
  letter-spacing: -0.005em;
  display: flex; align-items: center; justify-content: center;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 200ms ease;
  padding: 0 20px !important;
}
.pd-add-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.pd-add-btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }

.pd-add-inner,
.pd-add-success {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pd-add-icon { width: 19px; height: 19px; }
.pd-add-success {
  transform: translateY(120%);
  opacity: 0;
  background: #10b981;
  color: #fff;
  font-weight: 700;
}
.pd-add-success svg { width: 18px; height: 18px; }

.pd-add-btn.is-success .pd-add-inner {
  transform: translateY(-120%);
  opacity: 0;
}
.pd-add-btn.is-success .pd-add-success {
  transform: translateY(0);
  opacity: 1;
}
.pd-add-btn.is-success {
  box-shadow: 0 12px 30px -12px rgba(16, 185, 129, 0.55);
}

/* Wishlist button + heart pop */
.pd-wishlist {
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.pd-wishlist:hover {
  transform: translateY(-1px);
  background: var(--bg-secondary);
  border-color: color-mix(in srgb, #ef4444 40%, var(--card-border));
  color: #ef4444;
}
.pd-wishlist.is-saved {
  color: #ef4444;
  border-color: color-mix(in srgb, #ef4444 50%, var(--card-border));
  background: color-mix(in srgb, #ef4444 8%, transparent);
}
.pd-heart {
  width: 20px; height: 20px;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pd-heart-pop .pd-heart { animation: pd-heartbeat 500ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pd-heartbeat {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.72); }
  60%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* Wholesale tier active-tier auto-highlight */
.wholesale-tier-card.is-active {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 8%, var(--bg-secondary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 15%, transparent);
  transform: translateY(-1px);
}
.wholesale-tier-card.is-active .tier-discount {
  color: var(--accent-color);
}

/* ─── Mobile: sticky bottom CTA bar ─── */
@media (max-width: 767.98px) {
  .product-detail-container { padding-bottom: 96px; }
  .pd-cta-row {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1200;
    background: color-mix(in srgb, var(--bg-secondary) 96%, transparent);
    backdrop-filter: blur(14px) saturate(1.1);
    border-top: 1px solid var(--card-border);
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px -12px rgba(2, 6, 23, 0.45);
    margin-top: 0;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }
  .pd-qty { height: 48px; }
  .pd-qty-btn { width: 40px; }
  .pd-cta-row #qty-val { width: 32px; font-size: 14px; }
  .pd-add-btn {
    min-height: 48px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 14px !important;
    font-size: 14px !important;
  }
  .pd-wishlist {
    height: 48px;
    padding: 0 !important;
    width: 48px; justify-content: center;
  }
  .pd-wishlist-label { display: none; }
}

/* ─── Loading skeleton for #product-detail-view ─── */
.pd-skeleton {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3vw, 40px);
}
@media (min-width: 1024px) {
  .pd-skeleton { grid-template-columns: 1.5fr 1fr; }
}
.pd-skel-block {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 22px;
}
.pd-skel-block::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg,
    transparent 20%,
    color-mix(in srgb, var(--accent-color) 8%, transparent) 45%,
    color-mix(in srgb, var(--text-primary) 4%, transparent) 50%,
    color-mix(in srgb, var(--accent-color) 8%, transparent) 55%,
    transparent 80%);
  animation: pd-shimmer 1.6s linear infinite;
}
.pd-skel-gallery { aspect-ratio: 1 / 1; }
.pd-skel-info { min-height: 480px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.pd-skel-line {
  position: relative; overflow: hidden;
  height: 14px; border-radius: 8px;
  background: var(--bg-tertiary);
}
.pd-skel-line.tall { height: 28px; }
.pd-skel-line.short { width: 40%; }
.pd-skel-line.mid { width: 65%; }
.pd-skel-line.pill { height: 44px; border-radius: 12px; margin-top: auto; }
.pd-skel-line::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg,
    transparent 20%,
    color-mix(in srgb, var(--text-primary) 8%, transparent) 50%,
    transparent 80%);
  animation: pd-shimmer 1.6s linear infinite;
}
@keyframes pd-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
[dir="rtl"] .pd-skel-block::after,
[dir="rtl"] .pd-skel-line::after {
  animation-direction: reverse;
}

/* ═══════════════════════════════════════════════════════════════
   [Phase 11 ✅] Product FAQ + Recommendations — REFINED
   Shared .pd-section-v2-* header (mirrors Phase 9 .section-v2-*).
   FAQ: pure-CSS question icon (::before) + chevron (::after) via
   mask, so no JS edit needed — product.js keeps writing the same
   <details>/<summary> structure. Recommendations: desktop grid, phone
   horizontal snap-scroll, masked arrow-up-right affordance on hover.
   All IDs preserved: #product-faq-section, #product-faq-list,
   #product-recommendations-section, #product-recommendations-list,
   .faq-detail-accordion, .faq-detail-summary, .faq-detail-content,
   .recommendations-grid, .rec-item-card, .rec-img-frame,
   .rec-title, .rec-price.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Shared section header (mirrors Phase 9 .section-v2-*) ─── */
.pd-section-v2 {
  margin: 48px 0 24px;
  padding: 0;
  max-width: 1360px;
  margin-inline: auto;
}
.pd-section-v2-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}
.pd-section-v2-head-copy { min-width: 0; }
.pd-section-v2-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-color);
}
.pd-section-v2-eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--accent-color) 45%, transparent);
}
.pd-section-v2-title {
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-size: clamp(20px, 2.2vw, 24px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
  color: var(--text-primary);
  margin: 8px 0 0;
}
.pd-section-v2-sub {
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary);
  margin: 6px 0 0; line-height: 1.5;
}

/* ─── FAQ section ───
   Text-content shell (§4.5.2 exception): max-width 800px centered on
   desktop so the accordion reads at a comfortable line length. */
#product-faq-section {
  max-width: 800px;
  margin: 56px auto 28px;
}
.faq-v2-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-detail-accordion {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  margin-bottom: 0;
  overflow: hidden;
  position: relative;
  transition: border-color 200ms ease, transform 200ms ease,
              box-shadow 200ms ease, background 200ms ease;
  animation: pd-faq-in 420ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.faq-detail-accordion::before {
  content: '';
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent-color);
  transform: scaleY(0); transform-origin: center;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-detail-accordion:nth-child(1) { animation-delay: 0ms; }
.faq-detail-accordion:nth-child(2) { animation-delay: 40ms; }
.faq-detail-accordion:nth-child(3) { animation-delay: 80ms; }
.faq-detail-accordion:nth-child(4) { animation-delay: 120ms; }
.faq-detail-accordion:nth-child(5) { animation-delay: 160ms; }
.faq-detail-accordion:nth-child(6) { animation-delay: 200ms; }
.faq-detail-accordion:nth-child(n+7) { animation-delay: 220ms; }
@keyframes pd-faq-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.faq-detail-accordion:hover {
  border-color: color-mix(in srgb, var(--accent-color) 35%, var(--card-border));
  transform: translateY(-1px);
}
.faq-detail-accordion[open] {
  border-color: color-mix(in srgb, var(--accent-color) 40%, var(--card-border));
  background: color-mix(in srgb, var(--accent-color) 4%, var(--bg-secondary));
  box-shadow: 0 12px 28px -16px rgba(2, 6, 23, 0.35);
}
.faq-detail-accordion[open]::before { transform: scaleY(1); }

.faq-detail-summary {
  padding: 16px 18px;
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  list-style: none;
}
.faq-detail-summary::-webkit-details-marker { display: none; }

/* Question icon (::before) — Lucide circle-question-mark via mask */
.faq-detail-summary::before {
  content: '';
  flex-shrink: 0;
  width: 22px; height: 22px;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/><path d='M12 17h.01'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/><path d='M12 17h.01'/></svg>") center/contain no-repeat;
  background: var(--accent-color);
  opacity: 0.8;
  transition: opacity 200ms ease, transform 200ms ease;
}
.faq-detail-accordion:hover .faq-detail-summary::before { opacity: 1; transform: scale(1.06); }
.faq-detail-accordion[open] .faq-detail-summary::before { opacity: 1; }

/* Chevron (::after) — replaces the old `+` symbol */
.faq-detail-summary::after {
  content: '';
  flex-shrink: 0;
  width: 20px; height: 20px;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") center/contain no-repeat;
  background: var(--text-muted);
  margin-inline-start: auto;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), background 200ms ease;
}
.faq-detail-accordion[open] .faq-detail-summary::after {
  transform: rotate(180deg);
  background: var(--accent-color);
}

.faq-detail-content {
  padding: 0 18px 18px 54px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.65;
  animation: pd-faq-open 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-detail-content p { margin: 0; }
.faq-detail-content p + p { margin-top: 8px; }
@keyframes pd-faq-open {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
[dir="rtl"] .faq-detail-content {
  padding: 0 54px 18px 18px;
}

/* Empty FAQ state — centered dashed card */
#product-faq-list > p:only-child {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted) !important;
  font-size: 13.5px !important;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px dashed var(--card-border);
  border-radius: 14px;
}

/* ─── Recommendations section ─── */
#product-recommendations-section {
  margin-bottom: 80px;
}

.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
@media (min-width: 1024px) {
  .recommendations-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }
}

.rec-item-card {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 240ms ease,
              box-shadow 240ms ease;
  animation: pd-rec-in 460ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.rec-item-card:nth-child(1) { animation-delay: 60ms; }
.rec-item-card:nth-child(2) { animation-delay: 120ms; }
.rec-item-card:nth-child(3) { animation-delay: 180ms; }
.rec-item-card:nth-child(4) { animation-delay: 240ms; }
.rec-item-card:nth-child(5) { animation-delay: 300ms; }
.rec-item-card:nth-child(6) { animation-delay: 360ms; }
.rec-item-card:nth-child(n+7) { animation-delay: 380ms; }
@keyframes pd-rec-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rec-item-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent-color) 50%, var(--card-border));
  box-shadow: 0 22px 36px -22px rgba(2, 6, 23, 0.5);
}

.rec-img-frame {
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-tertiary);
  position: relative;
}
.rec-img-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 480ms cubic-bezier(0.16, 1, 0.3, 1);
}
.rec-item-card:hover .rec-img-frame img {
  transform: scale(1.06);
}

/* Arrow-up-right affordance (::before) — Lucide via mask */
.rec-img-frame::before {
  content: '';
  position: absolute;
  top: 10px; inset-inline-end: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-color);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M7 17L17 7'/><path d='M8 7h9v9'/></svg>") center/14px 14px no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M7 17L17 7'/><path d='M8 7h9v9'/></svg>") center/14px 14px no-repeat;
  z-index: 2;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.rec-item-card:hover .rec-img-frame::before {
  opacity: 1;
  transform: translateY(0);
}

/* Bottom scrim (::after) */
.rec-img-frame::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(2, 6, 23, 0.5));
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}
.rec-item-card:hover .rec-img-frame::after { opacity: 1; }

.rec-title {
  font-family: 'Rubik', 'Noto Naskh Arabic', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.rec-price {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.01em;
  padding: 0 4px 4px;
}

/* Phone: horizontal snap-scroll for recs */
@media (max-width: 639.98px) {
  .recommendations-grid {
    grid-auto-flow: column;
    grid-auto-columns: 62vw;
    grid-template-columns: unset;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 14px;
    scrollbar-width: none;
    gap: 12px;
  }
  .recommendations-grid::-webkit-scrollbar { display: none; }
  .rec-item-card {
    scroll-snap-align: start;
    animation: none;
  }
  .rec-img-frame { aspect-ratio: 1 / 1; }
  .rec-img-frame::before {
    opacity: 1;
    transform: translateY(0);
    width: 28px; height: 28px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .product-gallery-frame img,
  .rec-item-card,
  .faq-detail-accordion,
  .bundle-card { transition-duration: 0ms !important; animation: none !important; }
  .low-stock-pulse { animation: none !important; }
  .faq-detail-summary::after,
  .faq-detail-summary::before,
  .rec-img-frame img,
  .rec-img-frame::before,
  .rec-img-frame::after { transition: none !important; }
}
