/* ==========================================================================
   MasterFix — Responsive Layouts & Breakpoints
   Mobile First: Mobile (<640px) | Tablet (640-1023px) | Desktop (>=1024px)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Desktop & Large Screens (>= 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: center;
  }

  .about-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Tablets & Intermediate Screens (max-width: 1023px)
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  :root {
    --header-height: 70px;
  }

  .section {
    padding: 3.5rem 0;
  }

  /* Header adjustments */
  .desktop-nav {
    display: none; /* Collapsed into mobile drawer */
  }

  .mobile-toggle {
    display: flex;
  }

  /* Footer adjustments */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .footer-col-brand {
    max-width: 100%;
    grid-column: span 2;
  }

  /* Product Grid: 2 columns on Tablet */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Category Grid: 3 columns */
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  /* Trust Grid: 2 columns */
  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Product Detail Layout: Stack vertically */
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.75rem;
  }

  /* Hero Section: Stack */
  .hero-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 2.5rem;
  }

  .hero-content {
    text-align: center;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-trust-badges {
    justify-content: center;
  }

  /* About Grid: Stack */
  .about-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   Mobile Phones (max-width: 639px)
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  :root {
    --header-height: 64px;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section {
    padding: 2.75rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .brand-logo-img {
    height: 38px;
  }

  /* Nav WhatsApp CTA text can be simplified or icon-focused on very small screens */
  .nav-actions .btn-whatsapp span {
    display: none;
  }

  .nav-actions .btn-whatsapp {
    padding: 0.6rem;
    border-radius: var(--radius-full);
  }

  /* Product Grid: 1 column for clean big cards on mobile */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Category Grid: 2 columns or horizontal scroll */
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .category-card {
    min-height: 160px;
    padding: 1rem;
  }

  .category-card-title {
    font-size: 0.9375rem;
  }

  .category-card-arrow {
    width: 26px;
    height: 26px;
  }

  /* Trust Cards: 1 column */
  .trust-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* CTA Banner padding */
  .cta-banner {
    padding: 2.5rem 1.5rem;
    text-align: center;
  }

  .cta-banner-actions {
    justify-content: center;
  }

  /* Footer: 1 column stack */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-col-brand {
    grid-column: span 1;
  }

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

  /* Floating WhatsApp button: compact badge on mobile */
  .floating-whatsapp {
    bottom: 20px;
    right: 20px;
  }

  .floating-whatsapp-badge {
    display: none; /* Hide label on mobile to save screen real estate */
  }

  .floating-whatsapp-btn {
    width: 54px;
    height: 54px;
  }

  /* Catalog Controls */
  .catalog-controls {
    padding: 1rem;
  }

  .catalog-status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Product Detail Layout */
  .product-detail-layout {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .gallery-thumb-btn {
    width: 60px;
    height: 60px;
  }

  .product-detail-price {
    font-size: 1.625rem;
  }

  .specs-table {
    font-size: 0.8125rem;
  }

  .specs-label {
    width: 45%;
  }
}

/* --------------------------------------------------------------------------
   Touch Target & Safe Area Support
   -------------------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .site-footer {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
  }

  .floating-whatsapp {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
  }
}
