/* =========================================================================
   Windsor Factory — Responsive layer
   Tested widths: 320 · 375 · 430 · 768 · 1024 · 1440 · 1920
   ========================================================================= */

/* ≥ 1600 — generous desktop ------------------------------------------- */
@media (min-width: 1600px) {
  :root { --section-y: 170px; }
  .gallery-grid { grid-auto-rows: 290px; }
  .quote-shell { grid-template-columns: minmax(0, 1fr) 420px; }
}

/* ≤ 1399 --------------------------------------------------------------- */
@media (max-width: 1399.98px) {
  .main-nav a { padding: .75rem .6rem; font-size: .84rem; }
  .header-inner { gap: 1rem; }
}

/* ≤ 1199 — laptop / small desktop -------------------------------------- */
@media (max-width: 1199.98px) {
  .main-nav { display: none; }
  .nav-toggle { display: inline-grid; }
  .header-cta { margin-left: auto; }

  .hero-chip { min-width: 250px; }
  .showcase-grid { grid-template-columns: 240px minmax(0, 1fr); }
  .style-tab { grid-template-columns: 30px minmax(0, 1fr) 14px; }
  .style-tab-num { display: none; }

  .quote-shell { grid-template-columns: minmax(0, 1fr) 320px; }
  .choice-grid--styles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glass-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ≤ 991 — tablet ------------------------------------------------------- */
@media (max-width: 991.98px) {
  :root { --header-h: 72px; }
  .site-header.is-scrolled { --header-h: 66px; }

  .section-head--split { grid-template-columns: 1fr; gap: 1rem; }
  .section-head--split .section-title { margin-bottom: 0; }

  /* Hero */
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2rem; }
  .hero-chips { display: flex; flex-wrap: wrap; justify-items: start; gap: .6rem; }
  .hero-chip { min-width: 0; padding: .6rem .9rem .6rem .6rem; border-radius: 13px; }
  .hero-chip:nth-child(2) { margin-right: 0; }
  .hero-chip > i { width: 34px; height: 34px; font-size: 1rem; }
  .hero-chip > span:last-child { font-size: .74rem; }
  .hero-chip strong { font-size: .84rem; }
  .hero-chip-dot { display: none; }

  /* Intro */
  .intro-media { max-width: 620px; margin: 0 auto; }

  /* Showcase: horizontal, swipeable style selector */
  .showcase-grid { grid-template-columns: minmax(0, 1fr); }
  .showcase-nav { position: relative; top: 0; margin: 0 calc(var(--bs-gutter-x) * -.5); }
  .showcase-list {
    flex-direction: row; gap: .5rem; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 calc(var(--bs-gutter-x) * .5);
    padding: .25rem calc(var(--bs-gutter-x) * .5) .75rem; border: 0; border-radius: 0; background: transparent; box-shadow: none;
    scrollbar-width: none;
  }
  .showcase-list::-webkit-scrollbar { display: none; }
  .style-tab {
    flex: 0 0 auto; width: auto; scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: center; gap: .45rem;
    min-width: 104px; padding: .9rem .9rem .8rem; border-radius: 16px;
    background: #fff; border: 1px solid var(--line); text-align: center; font-size: .82rem;
  }
  .style-tab-arrow { display: none; }
  .style-tab-icon .wf-style-icon { width: 34px; height: 34px; }
  .showcase-stage { aspect-ratio: 4 / 3; }

  /* Two-column modules stack */
  .materials-grid, .glass-grid, .cfg-grid, .details-grid, .faq, .glass-compare { grid-template-columns: minmax(0, 1fr); }
  .material-visual, .glass-visual, .faq-intro { position: relative; top: 0; }
  .glass-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .details-stage { aspect-ratio: 4 / 3; }
  .cfg-stage { aspect-ratio: 4 / 3; }

  /* Gallery */
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; }

  /* Quote */
  .quote-shell { grid-template-columns: minmax(0, 1fr); }
  .quote-summary { position: relative; top: 0; order: -1; }
  .qs-toggle {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%;
    min-height: 58px; padding: 0 1.25rem; border: 0; background: transparent; color: #fff; cursor: pointer;
    font: 700 .9rem/1 var(--font-head);
  }
  .qs-toggle > span:first-child { display: inline-flex; align-items: center; gap: .55rem; }
  .qs-toggle i { color: var(--copper-light); }
  .qs-toggle-meta { display: inline-flex; align-items: center; gap: .6rem; font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .7); }
  .qs-toggle-meta i { transition: transform .4s var(--ease); }
  .quote-summary.is-open .qs-toggle-meta i { transform: rotate(180deg); }
  .qs-body { display: none; border-top: 1px solid rgba(255, 255, 255, .08); }
  .quote-summary.is-open .qs-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); }
  .qs-render { height: auto; min-height: 200px; }

  .why-grid { margin-bottom: 4rem; }

  /* Floating UI: mobile CTA bar replaces the dock */
  .quote-dock { display: none; }
  .mobile-cta {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1040;
    display: flex; gap: .5rem; padding: .5rem; border-radius: 18px;
    background: rgba(21, 25, 29, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .55);
    transition: transform .5s var(--ease), opacity .4s;
  }
  .mobile-cta.is-hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }
  .mobile-cta .btn-wf { flex: 1; min-height: 50px; gap: .6rem; }
  .mc-design { display: grid; place-items: center; flex: none; width: 50px; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 1.15rem; text-decoration: none; }
  .mc-design:hover { background: rgba(255, 255, 255, .16); color: var(--copper-light); }
  .wf-toast { bottom: 90px; }
  .site-footer { padding-bottom: 6.5rem; }
}

/* ≤ 767 — large phones ------------------------------------------------- */
@media (max-width: 767.98px) {
  .section-title { max-width: none; }

  .hero-stats { display: none; }
  .hero-bottom { padding-bottom: 1.5rem; }
  .hero-chip:nth-child(3) { display: none; }

  .intro-media { padding: 0 8% 14% 0; }
  .intro-badge { top: auto; bottom: 22%; left: -2%; max-width: 230px; padding: .85rem 1rem; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }

  .si-cols { grid-template-columns: minmax(0, 1fr); }
  .check-list--2 { grid-template-columns: minmax(0, 1fr); }
  .showcase-stage { aspect-ratio: 1 / 1; }
  .stage-controls { position: relative; left: auto; right: auto; bottom: auto; padding: .75rem; background: #fff; border-top: 1px solid var(--line); }
  .stage-controls .seg { box-shadow: none; background: var(--paper); }
  .stage-badge { top: .75rem; left: .75rem; padding: .4rem .65rem; font-size: .6rem; }

  .cfg-caption { left: .75rem; bottom: .75rem; padding: .6rem .8rem; }
  .cfg-caption strong { font-size: .92rem; }
  .cfg-pip { right: .75rem; bottom: .75rem; width: 34%; }
  .cfg-toolbar { top: .75rem; left: .75rem; right: .75rem; }
  .live-dot { display: none; }

  .glass-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #compareCanvas { height: 200px; }

  .choice-grid--4, .choice-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid--styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-grid { grid-template-columns: minmax(0, 1fr); }
  .upload-drop { flex-direction: row; justify-content: flex-start; text-align: left; padding: 1rem; gap: .9rem; }
  .upload-drop strong { display: block; }
  .qp-name { display: none; }
  .qp-num { width: 26px; height: 26px; font-size: .7rem; }
  .q-nav { flex-wrap: wrap; }
  .q-saved { order: 3; width: 100%; justify-content: center; margin: .25rem 0 0; }
  #qNext, #qSubmit { margin-left: auto; }
  .rv-list--grid { grid-template-columns: minmax(0, 1fr); }
  .rv-window { grid-template-columns: minmax(0, 1fr); }
  .rv-window-render { width: 100%; height: 170px; }
  .quote-summary.is-open .qs-body { grid-template-columns: minmax(0, 1fr); }
  .qs-render { min-height: 180px; }

  .why-grid { grid-template-columns: minmax(0, 1fr); }
  .faq-list .accordion-body { padding-right: 0; }
  .faq-list .accordion-button { font-size: 1rem; }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .lb-prev { left: 0; }
  .lb-next { right: 0; }
  .lb-close { right: 0; top: -12px; }
  .lb-btn { top: auto; bottom: 0; transform: none; width: 46px; height: 46px; }
  .lb-meta { top: -2px; }
}

/* ≤ 575 — phones ------------------------------------------------------- */
@media (max-width: 575.98px) {
  .header-cta { display: none; }
  .nav-toggle { margin-left: auto; }
  .brand-text strong { font-size: .98rem; }
  .brand-text span { font-size: .52rem; letter-spacing: .26em; }
  .brand-mark { width: 34px; height: 34px; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-wf { width: 100%; }
  .hero-lead { margin-bottom: 1.8rem; }
  .hero-chips { gap: .5rem; }
  .scroll-cue span:last-child { display: none; }

  .eyebrow { letter-spacing: .16em; }

  .gallery-filters { flex-wrap: nowrap; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .gallery-filters::-webkit-scrollbar { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 160px; gap: .6rem; }
  .g-item { border-radius: 12px; }
  .g-item--wide { grid-column: span 2; }
  .g-item--tall { grid-row: span 2; }
  .g-btn .g-caption { left: .8rem; right: .8rem; bottom: .7rem; }
  .g-title { font-size: .84rem; }
  .g-zoom { display: none; }

  .material-tabs { gap: .25rem; }
  .mat-tab { padding: 0 .7rem; font-size: .8rem; }
  .mi-thermal { margin-left: 0; }

  .cfg-stage { aspect-ratio: 1 / 1; }
  .cfg-toolbar .seg-btn { min-height: 34px; padding: 0 .8rem; font-size: .76rem; }
  .cfg-material { flex-wrap: wrap; row-gap: .35rem; }
  .cfg-material .cfg-label { flex: 1 0 100%; }
  .cfg-material strong { margin-left: 0; margin-right: auto; }
  .swatches { gap: .6rem; }
  .swatch-face { width: 44px; height: 44px; }
  .swatches--sm .swatch-face { width: 40px; height: 40px; }

  .glass-options { gap: .5rem; }
  .glass-tab { padding: .85rem; }
  .glass-tab-name { font-size: .82rem; }

  .quote-main { border-radius: var(--r-lg); }
  .choice-face { padding: .95rem .9rem .85rem; }
  .q-step-title { margin-bottom: 1.4rem; }
  .q-unit-row { flex-direction: column; align-items: flex-start; }
  .q-nav .btn-wf { padding: 0 1.1rem; }
  .q-windows { margin-left: -.25rem; margin-right: -.25rem; }

  .final-cta-actions .btn-wf { width: 100%; }
  .wf-toast-inner { font-size: .84rem; }
  .dock-panel { width: calc(100vw - 32px); }
}

/* ≤ 374 — small phones (320) ------------------------------------------ */
@media (max-width: 374.98px) {
  .hero-title { font-size: 2.2rem; }
  .hero-chip > span:last-child { display: none; }
  .section-title { font-size: 1.95rem; }
  .btn-wf { padding: 0 1.1rem; letter-spacing: .12em; }
  .choice-grid--4, .choice-grid--3, .choice-grid--styles { grid-template-columns: minmax(0, 1fr); }
  .glass-options { grid-template-columns: minmax(0, 1fr); }
  .swatch-face { width: 40px; height: 40px; }
  .stage-controls .seg-btn { padding: 0 .75rem; }
  .btn-chip { padding: 0 .85rem; font-size: .76rem; }
  .gallery-grid { grid-auto-rows: 140px; }
  .mobile-cta .btn-wf { font-size: .7rem; }
}
