/* ==========================================================================
   Mahalya Responsive Styles (Media Queries)
   ========================================================================== */

/* 1. Large Devices & Desktops (min-width: 992px) */
@media (min-width: 992px) {
  .navbar-inner-container {
    max-width: 960px;
    margin: 0 auto;
  }
}

@media (min-width: 1200px) {
  .navbar-inner-container {
    max-width: 1140px;
  }
}

/* 2. Tablets and Large Mobile (max-width: 991.98px) */
@media (max-width: 991.98px) {
  .navbar-custom { padding: 16px 0; }

  .navbar-custom .navbar-inner-container {
    padding: 8px 20px;
    border-radius: var(--border-radius-md);
    background: var(--glass-bg);
    border-color: var(--glass-border);
    backdrop-filter: var(--glass-backdrop-filter);
    -webkit-backdrop-filter: var(--glass-backdrop-filter);
    box-shadow: var(--shadow-sm);
  }

  .navbar-toggler-custom { display: flex; }

  .navbar-nav-custom {
    display: none;
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(108, 74, 182, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-md);
    padding: 24px 16px;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    z-index: 1040;
  }

  .navbar-nav-custom.active {
    display: flex;
    animation: slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .nav-link-custom { font-size: 1.05rem; padding: 8px 0; width: 100%; display: block; }
  .nav-link-custom::after { display: none; }

  .navbar-nav-custom .btn-nav-custom {
    margin-top: 10px;
    width: 80%;
    max-width: 250px;
    padding: 10px 24px;
    font-size: 0.95rem;
  }

  .hero-section { padding-top: 40px; padding-bottom: 60px; text-align: center; }
  .hero-cta-group { justify-content: center; }
  .hero-desc { margin-inline: auto; }
  .hero-image-wrapper { margin-top: 48px; }
  .hero-image-wrapper img { max-width: 85%; }

  .stats-bar { flex-wrap: wrap; gap: 16px; padding: 16px 20px; }
  .stat-bar-divider { display: none; }
  .stat-bar-item { flex: 0 0 calc(50% - 16px); justify-content: flex-start; }
}

/* 3. Small Mobile (max-width: 575.98px) */
@media (max-width: 575.98px) {
  .navbar-custom .navbar-inner-container { padding: 8px 16px; }
  .navbar-brand-custom { font-size: 1.3rem; }
  .hero-section { padding-top: 100px; padding-bottom: 40px; }
  .badge-launch { padding: 6px 12px; font-size: 0.8rem; }
  .hero-title { font-size: 2.15rem; line-height: 1.2; margin-bottom: 16px; }
  .hero-desc { font-size: 0.95rem; line-height: 1.6; margin-bottom: 28px; }
  .hero-cta-group { flex-direction: column; width: 100%; gap: 12px; }
  .hero-cta-group .btn-custom { width: 100%; }
  .hero-image-wrapper { margin-top: 36px; }
  .hero-image-wrapper img { max-width: 100%; }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   4. Universal Responsive Fixes
   ========================================================================== */
@media (max-width: 767.98px) {
  body { overflow-x: hidden; }
  .container, .container-fluid { padding-left: 14px !important; padding-right: 14px !important; }
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .form-control, .form-select { font-size: 0.9rem !important; }
  .modal-dialog { margin: 10px; max-width: calc(100vw - 20px) !important; }
  h1, .fs-1 { font-size: 1.6rem !important; }
  h2, .fs-2 { font-size: 1.35rem !important; }
  h3, .fs-3 { font-size: 1.15rem !important; }
}

/* ==========================================================================
   5. HOMEPAGE — Comprehensive Mobile Fixes
   ========================================================================== */

@media (max-width: 767px) {
  /* Hero */
  .hero-editorial__right-quote { display: none !important; }
  .hero-editorial__title { font-size: clamp(2.4rem, 10vw, 3.5rem) !important; line-height: 1.1 !important; margin-bottom: 16px !important; }
  .hero-editorial__desc { font-size: 1rem !important; max-width: 100%; }
  .hero-editorial__ctas { flex-direction: column; width: 100%; gap: 12px; }
  .hero-cta-primary, .hero-cta-secondary { width: 100%; justify-content: center; text-align: center; }
  .hero-trust-badges, .hero-editorial__trust { gap: 12px !important; flex-wrap: wrap; justify-content: flex-start; }
  .hero-editorial__inner { grid-template-columns: 1fr !important; padding: 0 20px !important; gap: 24px !important; }
  .hero-editorial__stats { display: none !important; }

  /* Stats Bar */
  .stats-bar { flex-wrap: wrap; padding: 16px; gap: 12px; margin: 16px auto 0; }
  .stat-bar-divider { display: none; }
  .stat-bar-item { flex: 0 0 calc(50% - 8px); gap: 8px; justify-content: flex-start; }
  .stat-bar-icon { width: 32px; height: 32px; }
  .stat-bar-text strong { font-size: 1.1rem; }

  /* Search */
  .search-section { margin-top: -24px; padding: 0 12px 48px; }
  .search-card__body { grid-template-columns: 1fr !important; gap: 0; padding: 12px 20px 16px; }
  .search-field { padding: 14px 0; border-bottom: 1px solid rgba(108, 74, 182, 0.08); }
  .search-field:last-of-type { border-bottom: none; }
  .search-cta { width: 100%; justify-content: center; margin-top: 12px; }
  .search-card__tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 0; }
  .search-tab { font-size: 0.75rem; padding: 8px 14px; white-space: nowrap; flex-shrink: 0; }

  /* Occasions */
  .occasions-section { padding: 60px 0 70px; }
  .occasions-section__inner { padding: 0 16px; }
  .occasions-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
  .occasion-card__title { font-size: 0.85rem; }

  /* Featured Mahals */
  .venue-cards-grid { grid-template-columns: 1fr !important; gap: 20px; }
  .venue-card--large .venue-card__img-wrap { height: 260px; }
  .venue-card--small .venue-card__img-wrap { height: 200px; }
  .featured-mahals-section__inner { padding: 0 16px; }

  /* Muhurtham Calendar */
  .muhurtham-section__inner { grid-template-columns: 1fr !important; gap: 32px; padding: 0 16px; }
  .muhurtham-calendar { padding: 0; }
  .muh-cal__day { font-size: 0.8rem; min-height: 36px; }
  .muh-date-card { padding: 20px 16px; }
  .muh-date-card__details { grid-template-columns: 1fr !important; gap: 12px; }

  /* Services */
  .hp-services-wrap { padding: 60px 0 50px; }
  .services-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 16px; }
  .svc-item { flex: 0 0 calc(50% - 8px) !important; }

  /* Testimonials */
  .hp-testimonials { padding: 60px 0 50px; }
  .testi-grid { grid-template-columns: 1fr !important; gap: 16px; }
  .testi-header { flex-direction: column; gap: 12px; }

  /* Celebration Grid */
  .celebration-section__inner { padding: 0 16px; }
  .celebration-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }

  /* Why Us */
  .why-section__inner { padding: 0 16px; }
  .why-grid { grid-template-columns: 1fr !important; gap: 16px; }

  /* Storytelling */
  .storytelling-section__inner { padding: 0 16px; }
  .storytelling-section__visual { height: 280px; }

  /* Final CTA */
  .final-cta-card { padding: 40px 20px !important; border-radius: 20px; grid-template-columns: 1fr !important; gap: 24px; text-align: center; }

  /* Footer */
  .footer-luxury__grid { grid-template-columns: 1fr !important; gap: 32px; }
  .footer-owner-band__inner { padding: 40px 20px; }
  .footer-owner-band__title { font-size: 1.5rem; }
}

/* ==========================================================================
   6. MAHALS LIST PAGE — Mobile Fixes
   ========================================================================== */
@media (max-width: 767px) {
  .hero-discovery { padding: 32px 0 20px; }
  .hero-discovery-title { font-size: 1.4rem !important; }
  .hero-discovery-subtitle { font-size: 0.88rem; padding: 0 8px; }
  .mahal-card-img-wrapper { height: 200px; }
  .mahal-card-title { font-size: 1.05rem; }
  .mahal-card-specs { gap: 10px; font-size: 0.8rem; flex-wrap: wrap; }
}

/* ==========================================================================
   7. Very Small Screens (max-width: 400px)
   ========================================================================== */
@media (max-width: 400px) {
  .stats-bar { flex-direction: column; align-items: flex-start; }
  .stat-bar-item { flex: 0 0 100%; }
  .hero-editorial__title { font-size: 2rem !important; }
  .occasions-grid { grid-template-columns: 1fr 1fr !important; }
  .search-tab { font-size: 0.7rem; padding: 7px 10px; }
}

/* ==========================================================================
   8. OCCASIONS SECTION — Horizontal Scroll on Mobile
   ========================================================================== */
@media (max-width: 767px) {
  /* Wrapper needs to allow overflow */
  .occasions-section {
    overflow: hidden;
  }

  .occasions-section__inner {
    padding: 0 !important;
  }

  /* Header still has side padding */
  .occasions-section__header {
    padding: 0 20px;
    margin-bottom: 20px;
  }

  /* Grid becomes a horizontal scroll row */
  .occasions-grid {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    gap: 14px !important;
    padding: 8px 20px 20px !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar but keep scrolling */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .occasions-grid::-webkit-scrollbar {
    display: none;
  }

  /* Each card is a fixed-width item */
  .occ-card {
    flex: 0 0 140px !important;
    min-width: 140px !important;
    scroll-snap-align: start;
  }

  /* Image: taller portrait cards look premium */
  .occ-card__img {
    width: 140px !important;
    height: 180px !important;
    aspect-ratio: unset !important;
    border-radius: 16px;
  }

  .occ-card__label {
    font-size: 0.78rem;
    width: 100%;
    text-align: center;
  }
}
