/* ==========================================================================
   ORGANIC DESIGN SYSTEM - RESPONSIVE
   Breakpoints, mobile horizontal scrolls, responsive typography & grids
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LAPTOPS & SMALL DESKTOPS (<= 1199px)
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  :root {
    --container-pad: 20px;
  }

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

  .category-nav-grid {
    gap: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   2. TABLETS (<= 991px)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  :root {
    --container-pad: 18px;
    --space-3xl: 48px;
    --space-2xl: 36px;
    --space-xl: 24px;
  }

  .grid-5,
  .grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-nav-grid {
    gap: 1.25rem;
  }

  .cat-item-card {
    min-width: 110px;
    padding: 8px 12px 14px;
  }
}

/* --------------------------------------------------------------------------
   3. MOBILE PHONES (<= 768px)
   - Category navigation: Smooth Horizontal Scrolling
   - Outlined icons & 4-5px active underline preserved
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --container-pad: 16px;
    --space-3xl: 36px;
    --space-2xl: 28px;
    --space-xl: 20px;
    --space-lg: 16px;
  }

  /* Responsive Typography */
  h1, .h1, .main-heading {
    font-size: 2.15rem;
    line-height: 1.2;
  }

  h2, .h2, .section-title {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  h3, .h3, .sub-heading {
    font-size: 1.2rem;
  }

  p, .body-text {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .section-tag {
    font-size: 0.72rem;
    padding: 0.25rem 0.7rem;
    margin-bottom: 0.5rem;
  }

  .section-desc {
    font-size: 0.875rem;
    padding: 0 0.5rem;
  }

  /* Horizontal Category Navigation Scroll */
  .categories-section {
    padding: 1.75rem 0 1rem;
  }

  .category-nav-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.25rem 1rem 0.75rem;
    margin-left: calc(-1 * var(--container-pad));
    margin-right: calc(-1 * var(--container-pad));
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-nav-grid::-webkit-scrollbar {
    display: none;
  }

  .cat-item-card {
    flex: 0 0 auto;
    min-width: 80px;
    max-width: 105px;
    padding: 4px 6px 10px;
  }

  .cat-item-card::after {
    height: 3px;
    width: 60%;
  }

  .cat-icon-box {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-bottom: 0.35rem;
  }

  .cat-icon-box svg.cat-svg-icon {
    width: 18px;
    height: 18px;
  }

  .cat-title {
    font-size: 0.75rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .cat-count-pill {
    font-size: 0.625rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .cat-count-pill {
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Mobile Grids */
  .grid-5,
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Product Card on Mobile */
  .product-card {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
  }

  .product-card .product-title {
    font-size: 0.95rem;
  }

  .product-card .current-price {
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------------------
   4. EXTRA SMALL PHONES (<= 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  :root {
    --container-pad: 14px;
  }

  .cat-item-card {
    min-width: 88px;
    max-width: 110px;
  }

  .cat-icon-box {
    width: 40px;
    height: 40px;
  }

  .cat-icon-box svg.cat-svg-icon {
    width: 20px;
    height: 20px;
  }

  .cat-title {
    font-size: 0.75rem;
  }
}
