/* ==========================================================================
   FESTIVAL.DEALS — Mobile-First Responsive Improvements
   Applied on top of style.css. Targets ≤768px primarily.
   ========================================================================== */

/* ── ─────────────────────────────────────────────────────── ── */
/*   GLOBAL MOBILE RESETS                                        */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {

  /* Prevent horizontal scroll from overflowing elements */
  body { overflow-x: hidden; }

  /* Comfortable container padding on mobile */
  .container { padding: 0 1rem; }

  /* Tighter section spacing on mobile */
  .section { padding: 2.5rem 0; }

  /* Section titles smaller and centered */
  .section-title { margin-bottom: 1.75rem; }
  .section-title h2 { font-size: 1.4rem; }
  .section-title p  { font-size: 0.9rem; }

  /* Headings scale down cleanly */
  h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
  h2 { font-size: clamp(1.25rem, 4vw, 1.75rem); }
  h3 { font-size: clamp(1rem, 3.5vw, 1.4rem); }

  /* Buttons - always full touch target size (min 44px) */
  .btn {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.7rem 1.25rem;
    white-space: nowrap;
  }
  .btn-sm { min-height: 36px; font-size: 0.8rem; padding: 0.5rem 1rem; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   HEADER — Mobile                                            */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 0.6rem 0;
    position: relative;
  }

  .header-container {
    flex-wrap: nowrap;
    gap: 0.75rem;
  }

  .logo-wrapper {
    font-size: 1.2rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Mobile search bar — show as a full-width row below logo */
  .mobile-search-row {
    padding: 0 1rem 0.6rem;
    background: var(--glass-bg);
  }
  .mobile-search-row form {
    position: relative;
    width: 100%;
  }
  .mobile-search-row .search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.4rem;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
  }
  .mobile-search-row .search-input:focus { border-color: var(--primary); }
  .mobile-search-row .search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    pointer-events: none;
  }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   BOTTOM MOBILE NAV — Improved                               */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .mobile-nav {
    height: 62px;
    padding: 0 0.25rem;
    box-shadow: 0 -1px 12px rgba(0,0,0,0.08);
    border-top: 1px solid var(--border);
    background: #ffffff;
    backdrop-filter: none;
  }

  .mob-nav-item {
    flex: 1;
    gap: 3px;
    font-size: 0.68rem;
    padding: 0.4rem 0.25rem;
    border-radius: 10px;
    min-height: 44px;
    transition: background 0.2s, color 0.2s;
  }
  .mob-nav-item i { font-size: 1.15rem; }
  .mob-nav-item.active {
    color: var(--primary);
    background: rgba(255, 107, 0, 0.08);
  }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   HERO SECTION — Mobile                                      */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .hero-section { padding: 2rem 0 1.5rem; }

  .hero-content h1 {
    font-size: clamp(1.7rem, 5.5vw, 2.4rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
  }
  .hero-content p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
  }

  /* Hero search full-width on mobile */
  .hero-search-form { max-width: 100%; }
  .hero-search-input {
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    font-size: 0.9rem;
  }
  .hero-search-btn {
    position: static;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
  }

  /* Slider fixed height */
  .slider-container {
    aspect-ratio: auto;
    height: 220px;
    border-width: 3px;
    border-radius: var(--border-radius-md);
  }
  .slide-content {
    padding: 0.85rem 1rem;
  }
  .slide-content h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }
  .slide-content p {
    font-size: 0.78rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   DEAL CARDS — Mobile 2-column grid                          */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .deals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .deal-card-body { padding: 0.85rem; }

  .deal-store { font-size: 0.72rem; }
  .deal-title {
    font-size: 0.85rem;
    height: 2.4rem;
    margin-bottom: 0.5rem;
  }
  .deal-new-price { font-size: 1rem; }
  .deal-old-price { font-size: 0.8rem; }
  .deal-discount  { font-size: 0.78rem; }

  .deal-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-top: 0.75rem;
  }

  .deal-footer .btn {
    width: 100%;
    font-size: 0.8rem;
    padding: 0.55rem 0.75rem;
    min-height: 38px;
    justify-content: center;
  }

  .deal-expiry { font-size: 0.7rem; }
}

/* Very small screens — single column */
@media (max-width: 360px) {
  .deals-grid { grid-template-columns: 1fr; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   COUPON CARDS — Mobile                                      */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .coupon-card {
    padding: 1rem;
    gap: 0.85rem;
    flex-direction: row; /* Keep horizontal on mobile — cleaner */
    text-align: left;
    align-items: center;
  }
  .coupon-store-logo {
    width: 52px;
    height: 52px;
    margin: 0;
    flex-shrink: 0;
  }
  .coupon-meta { justify-content: flex-start; }
  .coupon-title { font-size: 0.92rem; }
  .coupon-action-area {
    align-items: flex-end;
    flex-shrink: 0;
  }
  .coupon-btn-reveal {
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   CATEGORIES GRID — Mobile                                   */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
  .category-card {
    padding: 0.9rem 0.5rem;
    gap: 0.5rem;
    border-radius: var(--border-radius-sm);
  }
  .category-icon {
    width: 38px; height: 38px;
    font-size: 1.1rem;
  }
  .category-name { font-size: 0.72rem; }
}
@media (max-width: 360px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   STORES CAROUSEL — Mobile                                   */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .stores-carousel {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  .store-card {
    aspect-ratio: 3/2;
    padding: 0.85rem;
    border-radius: var(--border-radius-sm);
  }
}
@media (max-width: 360px) {
  .stores-carousel { grid-template-columns: repeat(2, 1fr); }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   BLOG GRID — Mobile                                         */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .blog-card-body { padding: 1rem; }
  .blog-card-title { font-size: 1rem; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   NEWSLETTER — Mobile                                        */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .newsletter-wrapper {
    padding: 2rem 1.25rem;
    border-radius: var(--border-radius-md);
  }
  .newsletter-wrapper h2 { font-size: 1.3rem; }
  .newsletter-form { flex-direction: column; gap: 0.6rem; }
  .newsletter-input { padding: 0.75rem 1rem; font-size: 0.9rem; }
  .newsletter-form .btn { padding: 0.75rem; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   PAGE TITLE BANNER — Mobile                                 */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .page-title-banner { padding: 1.75rem 0; }
  .breadcrumbs { font-size: 0.78rem; gap: 0.3rem; flex-wrap: wrap; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   ARCHIVE (DEALS / COUPONS PAGE) — Mobile                    */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .archive-layout { padding: 1.5rem 0; gap: 1.25rem; }

  /* Filters collapse to a horizontal pill scroll on mobile */
  .sidebar-filters {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
  }
  .filter-group { margin-bottom: 1rem; padding-bottom: 1rem; }
  .filter-options {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .checkbox-label {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   STORE DETAIL BANNER — Mobile                               */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .store-banner-wrapper { padding: 1.75rem 0; }
  .store-banner-grid { gap: 1rem; text-align: center; flex-direction: column; align-items: center; }
  .store-banner-logo { width: 80px; height: 80px; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   DEAL DETAIL PAGE — Mobile                                  */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .detail-grid { padding: 1.5rem 0; gap: 1.25rem; }
  .detail-main { padding: 1.25rem; border-radius: var(--border-radius-md); }
  .detail-gallery { padding: 1rem; margin-bottom: 1.25rem; }
  .countdown-box { width: 46px; height: 46px; }
  .countdown-val { font-size: 0.95rem; }
  .countdown-lbl { font-size: 0.58rem; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   MODAL — Mobile                                             */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    padding: 1.5rem 1.25rem;
    border-radius: var(--border-radius-md);
  }
  .reveal-modal-code { font-size: 1.2rem; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   FOOTER — Mobile                                            */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .site-footer { padding: 2.5rem 0 1.5rem; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 1.25rem;
  }
  .footer-title { font-size: 0.95rem; margin-bottom: 1rem; }
  .footer-links { gap: 0.6rem; }
  .footer-links a { font-size: 0.85rem; }
  .footer-bottom-links {
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    justify-content: center;
    font-size: 0.75rem;
  }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   TOAST NOTIFICATION — Mobile position above bottom nav      */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .toast-container {
    bottom: calc(var(--mobile-nav-height) + 1rem);
    right: 1rem;
    left: 1rem;
  }
  .toast {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
  }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   FAQ ACCORDION — Mobile                                     */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  .faq-header { padding: 0.9rem 1rem; font-size: 0.9rem; }
  .faq-item.active .faq-answer { padding: 1rem; }
}

/* ── ─────────────────────────────────────────────────────── ── */
/*   UTILITY — Touch tap highlights, safe spacing               */
/* ── ─────────────────────────────────────────────────────── ── */
@media (max-width: 768px) {
  a, button { -webkit-tap-highlight-color: rgba(255, 107, 0, 0.12); }
  
  /* Avoid bottom nav overlap with page content */
  .page-content-wrap { padding-bottom: calc(var(--mobile-nav-height) + 1rem); }
}
