/* =====================================================
   FRONT PAGE — MOBILE OVERRIDES
   ===================================================== */

/* Cat count hidden on desktop, shown in mobile list */
.cat-count {
  display: none;
}

@media only screen and (max-width: 768px) {

  /* ===== SECTION ORDER — Browse by Category first on mobile ===== */
  body .popular-category-wrap {
    display: flex !important;
    flex-direction: column !important;
  }

  body .popular-category-wrap > .section-browse-cat {
    order: 1 !important;
    padding-top: 28px !important;
    padding-bottom: 8px !important;
  }

  body .popular-category-wrap > .section-most-popular {
    order: 2 !important;
    padding-top: 24px !important;
    padding-bottom: 0 !important;
  }

  body .section-browse-cat .section-header {
    margin-bottom: 16px !important;
  }

  body .section-most-popular .section-header {
    margin-bottom: 16px !important;
  }

  /* ===== SECTION TITLES ===== */
  body .section-title {
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
  }

  /* ===== HERO — compact ===== */
  body .hero {
    min-height: unset !important;
  }

  body .hero-content {
    padding: 28px 20px 24px !important;
  }

  body .hero h1 {
    font-size: 2rem !important;
  }

  /* ===== SEARCH BAR — reorder on mobile ===== */
  body .search-bar input[name="s"]     { order: 1 !important; }
  body .search-bar select              { order: 2 !important; }
  body .search-bar input[name="dates"] { order: 3 !important; }
  body .search-btn                     { order: 4 !important; }

  /* ===== OCCASIONS — hidden on mobile ===== */
  body .occasions-wrap {
    display: none !important;
  }

  /* ===== MOST POPULAR — 3-column grid ===== */
  body .popular-scroll-wrap {
    overflow-x: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body .popular-scroll-track {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 8px 0 4px !important;
  }

  body .popular-tile {
    width: 100% !important;
    height: 120px !important;
    flex-shrink: unset !important;
  }

  body .popular-tile-label {
    font-size: 0.9rem !important;
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
  }

  body .popular-tile::after {
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.18) 0%,
      rgba(0, 0, 0, 0.58) 100%
    ) !important;
  }

  body .popular-nav {
    display: none !important;
  }

  /* ===== BROWSE BY CATEGORY — list view ===== */
  body .cat-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  body .cat-card {
    display: grid !important;
    grid-template-columns: 123px 1fr auto !important;
    grid-template-rows: auto auto !important;
    align-items: center !important;
    aspect-ratio: unset !important;
    height: 108px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body .cat-card:last-child {
    border-bottom: none !important;
  }

  body .cat-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  body .cat-card::after {
    display: none !important;
  }

  body .cat-card::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 123px !important;
    height: 108px !important;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.08) 0%,
      rgba(0, 0, 0, 0.32) 100%
    ) !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }

  body .cat-card img {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    width: 123px !important;
    height: 108px !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    transform: none !important;
  }

  body .cat-card:hover img {
    transform: none !important;
  }

  body .cat-label-top {
    display: none !important;
  }

  body .cat-label-bottom {
    grid-column: 2 !important;
    grid-row: 1 !important;
    position: static !important;
    color: var(--dark) !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    text-shadow: none !important;
    padding: 0 16px !important;
    align-self: end !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
  }

  body .cat-count {
    display: block !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    font-size: 0.88rem !important;
    color: var(--gray) !important;
    font-weight: 600 !important;
    padding: 2px 16px 0 !important;
    align-self: start !important;
  }

  body .cat-arrow {
    grid-column: 3 !important;
    grid-row: 1 / 3 !important;
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    width: 30px !important;
    height: 30px !important;
    margin-right: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    align-self: center !important;
  }

  body .cat-arrow svg {
    stroke: var(--gray) !important;
    width: 14px !important;
    height: 14px !important;
  }

  body .cat-card:hover .cat-arrow {
    background: transparent !important;
  }

  body .cat-card:hover .cat-arrow svg {
    stroke: var(--pink) !important;
  }

  /* ===== FOOTER — hide categories on mobile ===== */
  .footer-categories {
    display: none !important;
  }

}
