/* ==========================================================================
   LIQUID RESPONSIVE & MOBILE-FIRST ARCHITECTURE
   Flawless Scaling from 320px Mobile to 4K Ultrawide Displays
   ========================================================================== */

/* Fluid Typography & Container Tokens */
:root {
  --fluid-gutter: clamp(1rem, 3vw, 2.5rem);
}

.container {
  padding-left: var(--fluid-gutter);
  padding-right: var(--fluid-gutter);
}

/* Large Displays (Above 1200px) */
@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
  }
}

/* Medium Desktop & Tablet Landscape (901px - 1199px) */
@media (max-width: 1199px) and (min-width: 901px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Portrait & Mobile Landscape (601px - 900px) */
@media (max-width: 900px) {
  :root {
    --header-height: 70px;
  }
  
  .nav-links {
    display: none;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .product-modal-container {
    grid-template-columns: 1fr;
    max-height: 92vh;
    overflow-y: auto;
  }
  
  .modal-gallery-col {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.5rem;
  }
  
  .modal-info-col {
    padding: 1.5rem;
    max-height: none;
  }
  
  .analytics-section {
    grid-template-columns: 1fr;
  }
  
  .admin-layout {
    flex-direction: column;
  }
  
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .admin-main {
    padding: 1.5rem;
  }
  
  .category-pills-wrap {
    justify-content: flex-start;
  }
}

/* Mobile Devices (Under 600px) */
@media (max-width: 600px) {
  :root {
    --header-height: 64px;
  }

  .marquee-container {
    display: none !important;
  }

  .site-header .header-inner {
    height: var(--header-height);
  }
  
  .brand-logo .logo-main {
    font-size: 1.32rem;
    letter-spacing: -0.04em;
  }

  .brand-logo .logo-sub {
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    white-space: nowrap;
  }

  .header-actions {
    gap: 0.45rem;
  }

  .search-trigger-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .search-trigger-btn span {
    display: none !important;
  }

  .action-icon-btn {
    width: 38px;
    height: 38px;
  }
  
  .announcement-bar {
    font-size: 0.68rem;
    padding: 0.4rem 0.75rem;
  }
  
  .announcement-right {
    display: none;
  }

  .section-header-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .section-title-box h2 {
    font-size: 1.7rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .product-card {
    border-radius: var(--radius-sm);
  }

  .card-info {
    padding: 0.6rem 0.55rem;
    gap: 0.28rem;
  }
  
  .card-title {
    font-size: 0.88rem;
    height: 2.3rem;
  }
  
  .price-current {
    font-size: 1.15rem;
  }
  
  .card-demand-meter {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
  }

  .card-actions-bottom {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .btn-card-whatsapp, .btn-card-preorder {
    padding: 0.55rem 0.4rem;
    font-size: 0.72rem;
  }

  .category-filter-bar {
    padding: 0.6rem 0;
  }

  .category-pills-list {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    padding: 0.15rem 0;
    box-shadow: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .filter-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    padding: 0.4rem 0.85rem;
    font-size: 0.76rem;
    gap: 0.35rem;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
  }

  .filter-pill.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
  }

  .filter-pill svg {
    width: 12px;
    height: 12px;
  }

  .filter-controls-right {
    display: none !important;
  }

  .story-avatar-circle {
    width: 52px;
    height: 52px;
  }

  .story-category-name {
    font-size: 0.72rem;
  }

  .product-modal-overlay {
    padding: 0.75rem;
  }

  .modal-info-col {
    padding: 1.25rem;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .modal-price-current {
    font-size: 1.75rem;
  }

  .size-btn {
    padding: 0.5rem 0.35rem;
    font-size: 0.78rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  
  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  
  .toast {
    min-width: unset;
    width: 100%;
  }

  footer {
    padding: 2.5rem 0 1.5rem;
  }

  footer .container > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* Extra Small Phones (Under 380px) */
@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
}

/* Prevent ALL pages from horizontal overflow on mobile */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .container {
    max-width: 100%;
  }
}

