/* ═══════════════════════════════════════
   Mobile + Hero fixes — layout-v2
   ═══════════════════════════════════════ */

html {
  overflow-x: hidden;
}

.layout-v2 {
  --promo-h: 0px !important;
  --dock-offset: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Hero text always visible */
.split-hero-copy,
.split-stage,
.stage-info,
.catalog-head,
.catalog-card,
.bento-cell {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

/* ── Hero stage ── */
.stage-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stage-chair {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
}

.stage-info {
  background: #fff;
  border: 1px solid var(--border, #e5dfd6);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  text-align: center;
}

.stage-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: #0a0a0a;
}

.stage-info p {
  font-size: 0.9rem;
  color: #4a4a4a;
}

.stage-series {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8b7049;
}

/* Desktop: thumbnail picker */
.chair-picker {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.chair-picker-btn {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 2px solid rgba(197, 160, 115, 0.3);
  background: #fff;
  padding: 4px;
  overflow: hidden;
  cursor: pointer;
}

.chair-picker-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}

.chair-picker-btn.active {
  border-color: #c5a073;
  background: #f5ede3;
}

/* Mobile slider nav (arrows) — hidden on desktop */
.hero-slider-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 0.75rem 0;
}

.hero-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e5dfd6;
  background: #fff;
  color: #0a0a0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.hero-nav-btn:active {
  background: #f5ede3;
  border-color: #c5a073;
}

.hero-nav-counter {
  font-size: 0.9rem;
  font-weight: 700;
  color: #4a4a4a;
  min-width: 4rem;
  text-align: center;
}

/* ═══ MOBILE & TABLET ═══ */
@media (max-width: 991px) {
  .layout-v2 .main-nav {
    top: var(--header-h, 64px) !important;
    z-index: 999;
  }
}

@media (max-width: 768px) {
  html {
    scroll-padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.layout-v2 {
    overflow-x: hidden;
    padding-bottom: var(--dock-offset);
  }

  .layout-v2 .container {
    padding-inline: 1rem;
    width: 100%;
    max-width: 100%;
  }

  /* Fixed header + mobile menu position */
  .layout-v2 .site-header--dark {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  .layout-v2 .main-nav {
    top: var(--header-h, 64px) !important;
    z-index: 999;
  }

  .layout-v2 .main-nav:not(.open) {
    transform: translateY(-130%);
  }

  .layout-v2 .main-nav.open {
    transform: translateY(0);
  }

  .layout-v2 {
    --header-h: 64px;
  }

  .layout-v2 .brand img {
    height: 38px;
    max-width: 140px;
  }

  .layout-v2 .header-actions {
    gap: 0.35rem;
  }

  .layout-v2 .btn-header-wa {
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
  }

  .layout-v2 .cart-btn {
    width: 40px;
    height: 40px;
  }

  /* Hero */
  .split-hero {
    padding: calc(var(--header-h) + 1rem) 0 1.5rem;
    overflow: hidden;
  }

  .split-hero-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .split-stage {
    order: -1;
    width: 100%;
  }

  .split-hero-copy {
    text-align: center;
  }

  .split-hero-copy h1 {
    font-size: 1.85rem;
    line-height: 1.2;
  }

  .split-lead {
    font-size: 0.95rem;
    margin-inline: auto;
    max-width: 100%;
  }

  .split-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
  }

  .split-actions .btn-brand,
  .split-actions .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .split-stats {
    justify-content: center;
    gap: 1.5rem;
    padding-top: 1rem;
  }

  .split-stats div strong {
    font-size: 1.4rem;
  }

  .stage-frame {
    padding: 0.75rem;
    margin-bottom: 0;
    min-height: 0;
    max-height: none;
    height: clamp(220px, 52vw, 320px);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .stage-chair {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Hide tiny thumbnails on mobile — use arrows */
  .chair-picker {
    display: none !important;
  }

  .hero-slider-nav {
    display: flex;
  }

  .stage-info {
    margin-top: 0.25rem;
    padding: 0.75rem;
  }

  .stage-info h2 {
    font-size: 0.92rem;
  }

  /* Catalog */
  .catalog-sec {
    padding: 2.5rem 0 3rem;
  }

  .catalog-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .catalog-head h2 {
    font-size: 1.5rem;
  }

  .series-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.35rem;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  .series-tabs::-webkit-scrollbar {
    display: none;
  }

  .series-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .catalog-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .card-img-wrap {
    aspect-ratio: 1;
    padding: 1rem;
  }

  .catalog-banner {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
    gap: 1rem;
  }

  /* Bento + reviews + FAQ */
  .bento-sec,
  .scroll-reviews,
  .faq-sec,
  .order-panel {
    padding: 2.5rem 0;
  }

  .order-panel {
    padding-bottom: calc(2.5rem + var(--dock-offset));
    scroll-margin-bottom: var(--dock-offset);
  }

  .order-panel-form {
    padding-bottom: calc(1.25rem + var(--dock-offset));
  }

  .order-submit {
    margin-bottom: 0.25rem;
  }

  /* إخفاء شريط التواصل عند فتح السلة أو النوافذ */
  body.cart-open .contact-dock,
  body.modal-open .contact-dock {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(120%);
    transition: opacity 0.2s, transform 0.25s;
  }

  .cart-drawer {
    z-index: 10050;
  }

  .cart-foot {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .bento-grid {
    grid-template-columns: 1fr !important;
  }

  .bento-wide {
    grid-column: span 1 !important;
  }

  .faq-cols {
    grid-template-columns: 1fr !important;
  }

  .order-panel-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Contact dock */
  .contact-dock {
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    right: max(0.5rem, env(safe-area-inset-right));
    left: max(0.5rem, env(safe-area-inset-left));
    gap: 0.5rem;
  }

  .dock-btn {
    flex: 1;
    justify-content: center;
    padding: 0.7rem 0.5rem;
    font-size: 0.82rem;
  }

  /* Modals */
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .order-form-box input,
  .order-form-box textarea,
  #modalQty {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .split-hero-copy h1 {
    font-size: 1.65rem;
  }

  .stage-frame {
    height: clamp(200px, 48vw, 280px);
  }
}
