/* ============================================================
   Sandberry Foamtech — Responsive Overrides
   ============================================================
   Companion to style.css (modern design system).

   style.css handles most responsive behavior via:
     - clamp() for fluid typography, padding, gaps
     - auto-fit / minmax() for card grids
     - CSS custom properties

   This file covers ONLY genuine layout-shift breakpoints.

   Spacing tokens (from :root):
     --space-xs (0.25rem), --space-sm (0.5rem), --space-md (1rem),
     --space-lg (1.5rem), --space-xl (2rem), --space-2xl (3rem),
     --space-3xl (4rem)

   Breakpoints:
     Mobile:  < 768px
     Small:   < 576px
     Tablet:  768px – 1024px
     Desktop: > 1024px
     Large:   > 1440px
   ============================================================ */


/* ============================================================
   MOBILE  (< 768px)
   ============================================================ */
@media (max-width: 767px) {

  /* --- Navigation --- */
  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav,
  .main-nav__cta {
    display: none;
  }

  /* --- Header --- */
  .site-header .container {
    height: 64px;
  }

  .site-header__logo img {
    height: 36px;
  }

  /* --- Hero --- */
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero__content {
    padding: calc(64px + var(--space-2xl)) var(--container-padding) var(--space-2xl);
    text-align: center;
    align-items: center;
  }

  .hero__title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero__subtitle {
    max-width: 100%;
  }

  .hero__buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .hero__buttons .btn {
    width: 100%;
  }

  .hero__image {
    height: 300px;
  }

  .hero__image::after {
    background: linear-gradient(to bottom, var(--color-surface-dark) 0%, transparent 40%);
  }

  /* --- Page Banner --- */
  .page-banner {
    padding: calc(64px + var(--space-xl)) var(--container-padding) var(--space-xl);
  }

  .page-banner__title {
    font-size: var(--text-xl);
  }

  /* --- Stats: 2×2 grid --- */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }

  .stat-item {
    padding: var(--space-md) var(--space-sm);
  }

  .stat-item + .stat-item {
    border-left: none;
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
  }

  .stat-item:nth-child(n+3) {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .stat-number {
    font-size: var(--text-2xl);
  }

  /* --- About Snapshot: single column --- */
  .about-snapshot {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .about-snapshot__content {
    padding-right: 0;
    order: 2;
  }

  .about-snapshot__image {
    order: 1;
  }

  /* --- Grids --- */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  /* --- Contact --- */
  .contact-section {
    grid-template-columns: 1fr;
  }

  .contact-form-wrapper {
    padding: var(--space-lg);
  }

  /* --- Forms --- */
  .quote-form__row {
    grid-template-columns: 1fr;
  }

  /* --- Product Detail: single column --- */
  .product-detail {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .product-gallery {
    position: static;
  }

  .product-info__actions {
    flex-direction: column;
  }

  .product-info__actions .btn {
    min-width: unset;
    width: 100%;
  }

  /* --- Category Tabs: horizontal scroll --- */
  .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .category-tab,
  .tab-btn {
    flex-shrink: 0;
  }

  /* --- Footer: single column --- */
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    padding-right: 0;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* --- CTA Banner --- */
  .cta-banner__buttons {
    flex-direction: column;
    width: 100%;
  }

  .cta-banner__buttons .btn {
    width: 100%;
  }

  /* --- Buttons --- */
  .btn {
    padding: 12px 24px;
  }

  .btn-lg {
    padding: 14px 32px;
  }

  /* --- Trust Badges: 2-column grid --- */
  .trust-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  /* --- Floating Buttons --- */
  .whatsapp-float {
    width: 48px;
    height: 48px;
    font-size: 24px;
    bottom: 16px;
    right: 16px;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 76px;
    right: 16px;
  }

  /* --- Touch Targets --- */
  button:not(.back-to-top),
  a,
  input[type="submit"],
  .btn {
    min-height: 44px;
  }

  /* --- Prevent iOS zoom on input focus --- */
  .form-control,
  input,
  textarea,
  select {
    font-size: 16px;
  }
}


/* ============================================================
   SMALL MOBILE  (< 576px)
   ============================================================ */
@media (max-width: 575px) {

  .stats-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stat-item {
    padding: var(--space-md) var(--space-sm);
  }

  .stat-item:nth-child(odd) {
    border-right: none;
  }

  .stat-item:nth-child(n+2) {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .grid-4 {
    grid-template-columns: 1fr;
  }

  .product-gallery__thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  .product-info__actions .btn {
    width: 100%;
  }
}


/* ============================================================
   TABLET  (768px – 1024px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {

  /* --- Navigation: keep visible, compact --- */
  .main-nav {
    display: flex;
  }

  .main-nav__link {
    font-size: var(--text-xs);
  }

  .main-nav__list {
    gap: var(--space-md);
  }

  .mobile-menu-toggle {
    display: none;
  }

  /* --- Stats: 4 columns compact --- */
  .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }

  .stat-item {
    padding: var(--space-md);
  }

  /* --- About: adjust ratio --- */
  .about-snapshot {
    grid-template-columns: 2fr 3fr;
    gap: var(--space-xl);
  }

  .about-snapshot__content {
    padding-right: 0;
    order: unset;
  }

  .about-snapshot__image {
    order: unset;
  }

  /* --- Features: 2 columns --- */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --- Product Detail: two columns --- */
  .product-detail {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .product-gallery {
    position: static;
  }

  /* --- Footer: 2×2 grid --- */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
    padding-right: 0;
  }
}


/* ============================================================
   DESKTOP  (> 1024px)
   ============================================================ */
@media (min-width: 1025px) {

  .main-nav {
    display: flex;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .mobile-nav,
  .mobile-nav-overlay {
    display: none;
  }
}


/* ============================================================
   LARGE DESKTOP  (> 1440px)
   ============================================================ */
@media (min-width: 1441px) {

  .footer-grid {
    gap: var(--space-3xl);
  }
}


/* ============================================================
   PRINT
   ============================================================ */
@media print {

  .site-header,
  .mobile-nav,
  .mobile-nav-overlay,
  .mobile-menu-toggle,
  .whatsapp-float,
  .back-to-top,
  .cta-banner {
    display: none !important;
  }

  body {
    color: #000 !important;
    background: #fff !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  section,
  .section {
    padding: 20px 0;
  }

  .site-footer {
    background: #fff !important;
    color: #000 !important;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  img {
    max-width: 100% !important;
    break-inside: avoid;
  }
}
