/**
 * Astro Arun Pandit - Premium Astrology Web Application
 * Production Responsive Stylesheet - Phase 8 Complete Pass
 * Breakpoints Covered:
 * - Ultra-Wide & Large Desktop: 1920px, 1440px, 1366px
 * - Tablet Landscape: 1024px
 * - Tablet Portrait: 768px
 * - Mobile: 414px, 390px, 375px, 360px
 * ----------------------------------------------------
 */

/* ==========================================================================
   0. GLOBAL OVERFLOW & BASE RESPONSIVE GUARDS
   ========================================================================== */
html, body {
  overflow-x: clip;
  max-width: 100%;
  width: 100%;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Accessible touch targets & tap highlighting */
button, a, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

/* Smooth Table Responsive Scroll */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  border-radius: var(--radius-sm, 8px);
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background-color: rgba(200, 90, 23, 0.25);
  border-radius: 4px;
}

/* ==========================================================================
   1. ULTRA-WIDE & LARGE DESKTOP (1920px, 1440px, 1366px)
   ========================================================================== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

@media (min-width: 1920px) {
  .container {
    max-width: 1480px;
  }
  .hero-heading {
    font-size: 52px;
  }
  .hero-subtitle {
    font-size: 18px;
  }
  .hero-main-visual {
    max-width: 500px;
  }
}

@media (min-width: 992px) {
  /* Ensure mega menu shows smoothly on hover for desktop */
  .astro-navbar .nav-item.mega-menu-parent {
    position: static;
  }
}

/* ==========================================================================
   2. TABLET LANDSCAPE & 1024px SCREENS (992px to 1199.98px)
   ========================================================================== */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .astro-navbar .nav-link {
    font-size: 12.5px;
    padding: 14px 7px !important;
    gap: 4px;
  }

  .astro-navbar .navbar-nav {
    gap: 0;
  }

  .badge-astro {
    padding: 1px 4px;
    font-size: 8.5px;
  }

  .btn-pitra-dosh {
    padding: 6px 10px;
    font-size: 12px;
  }

  .btn-pitra-dosh span.btn-text {
    font-size: 11.5px;
  }

  .hero-heading {
    font-size: 38px;
  }

  .hero-main-visual {
    max-width: 380px;
  }

  .mega-menu-dropdown {
    max-width: 960px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
}

/* ==========================================================================
   3. MEDIUM SCREENS / TABLET PORTRAIT (768px to 991.98px)
   ========================================================================== */
@media (max-width: 991.98px) {
  /* Announcement bar */
  .top-announcement-bar {
    font-size: 11.5px;
    padding: 6px 12px;
  }

  /* Main Header */
  .main-header {
    padding: 10px 0;
  }

  .header-social-links {
    display: none; /* Hide in center on tablet/mobile to keep header uncluttered */
  }

  .brand-title {
    font-size: 16px;
    line-height: 1.05;
  }

  .brand-emblem {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .btn-pitra-dosh span.btn-text {
    display: inline;
  }

  /* Offcanvas / Mobile Navbar */
  .astro-navbar .navbar-collapse {
    background-color: var(--white);
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 10px;
    max-height: 80vh;
    overflow-y: auto;
  }

  .astro-navbar .nav-link {
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--border-light);
  }

  .astro-navbar .nav-link::after {
    display: none;
  }

  /* Mobile Mega Menu Accordion */
  .mega-menu-dropdown {
    position: static;
    display: none;
    opacity: 1;
    transform: none;
    box-shadow: none;
    border-top: none;
    background-color: var(--cream);
    border-radius: var(--radius-sm);
    padding: 14px 12px;
    margin-top: 4px;
    pointer-events: auto;
  }

  .mega-menu-parent.show .mega-menu-dropdown,
  .mega-menu-parent.mobile-expanded .mega-menu-dropdown {
    display: block;
  }

  .mega-menu-col-title {
    font-size: 14px;
    margin-top: 12px;
    margin-bottom: 8px;
  }

  .mega-menu-link {
    padding: 8px 10px;
    font-size: 13px;
  }

  .mega-menu-card {
    margin-top: 16px;
  }

  /* Hero Section */
  .hero-carousel-section {
    min-height: auto;
  }

  .hero-carousel-item {
    min-height: auto;
    padding: 50px 0 70px;
  }

  .hero-heading {
    font-size: 34px;
  }

  .hero-subtitle {
    font-size: 15px;
    margin-bottom: 22px;
  }

  .hero-visual-wrap {
    margin-top: 30px;
  }

  .hero-main-visual {
    max-width: 360px;
  }

  .hero-floating-badge.badge-top-left {
    top: 5%;
    left: 0;
  }

  .hero-floating-badge.badge-bottom-right {
    bottom: 5%;
    right: 0;
  }

  /* Footer */
  .main-footer {
    padding-top: 50px;
  }

  .footer-bottom-links {
    justify-content: flex-start;
    margin-top: 10px;
  }
}

/* ==========================================================================
   4. SMALL SCREENS / MOBILE (<= 767.98px)
      Includes: 414px, 390px, 375px, 360px
   ========================================================================== */
@media (max-width: 767.98px) {
  /* Prevent iOS zoom on form input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Announcement bar */
  .top-announcement-bar {
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
    padding: 6px 10px;
  }

  .top-announcement-bar .announcement-badge {
    display: inline-block;
    margin-bottom: 2px;
  }

  .top-announcement-bar .announcement-link {
    display: inline-block;
    margin-top: 2px;
  }

  /* Main Header */
  .main-header {
    padding: 8px 0;
  }

  .brand-title {
    font-size: 15px;
    line-height: 1.05;
  }

  .brand-tagline {
    font-size: 6.5px;
    letter-spacing: 0.8px;
    margin-top: 1px;
  }

  .brand-emblem {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  /* Pitra Dosh button compact on mobile */
  .btn-pitra-dosh {
    padding: 5px 10px;
    font-size: 11px;
    min-height: 36px;
  }

  .btn-pitra-dosh span.btn-text {
    display: none; /* Show icon + badge on mobile */
  }

  .header-icon-action {
    font-size: 16px;
  }

  /* Hero Section Mobile */
  .hero-carousel-item {
    padding: 35px 0 65px;
  }

  .hero-heading {
    font-size: 26px;
    line-height: 1.25;
    margin: 12px 0 14px;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-cta-group .btn-primary-astro,
  .hero-cta-group .btn-secondary-astro {
    width: 100%;
    text-align: center;
    min-height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .hero-visual-wrap {
    margin-top: 25px;
  }

  .hero-main-visual {
    max-width: 280px;
  }

  .hero-floating-badge {
    padding: 6px 12px;
  }

  .hero-floating-badge i {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .hero-floating-badge .title {
    font-size: 11px;
  }

  .hero-floating-badge .sub {
    font-size: 9.5px;
  }

  .hero-floating-badge.badge-top-left {
    top: -10px;
    left: 5px;
  }

  .hero-floating-badge.badge-bottom-right {
    bottom: -10px;
    right: 5px;
  }

  .hero-carousel-control {
    display: none; /* Use swipe / indicators on mobile */
  }

  /* Quick Actions (2 columns on mobile) */
  .quick-action-section {
    padding: 35px 0;
  }

  .section-title {
    font-size: 24px;
  }

  .quick-action-card {
    padding: 16px 10px;
  }

  .action-icon-circle {
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
  }

  .action-icon-circle i {
    font-size: 20px;
  }

  .quick-action-title {
    font-size: 13.5px;
  }

  .quick-action-arrow {
    font-size: 11px;
  }

  /* Cards in grid */
  .service-catalog-card,
  .report-catalog-card,
  .astrologer-profile-card {
    margin-bottom: 16px;
  }

  /* Floating WhatsApp */
  .floating-whatsapp-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 26px;
    z-index: 1040;
  }

  .whatsapp-tooltip {
    display: none;
  }

  /* Modal responsiveness */
  .modal-dialog {
    margin: 12px;
  }

  /* Form and Checkout controls */
  .checkout-card,
  .booking-wizard-card {
    padding: 18px 14px !important;
  }

  .btn-submit-order,
  .btn-book-slot {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
  }

  /* Footer */
  .footer-widget-title {
    font-size: 16px;
    margin-top: 20px;
  }

  .footer-bottom-bar {
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 8px 14px;
  }
}

/* ==========================================================================
   5. EXTRA COMPACT MOBILE (<= 390px and 360px)
   ========================================================================== */
@media (max-width: 390px) {
  .brand-title {
    font-size: 14px;
    line-height: 1.05;
  }

  .brand-emblem {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-icon-action {
    font-size: 15px;
  }

  .hero-heading {
    font-size: 23px;
  }

  .hero-main-visual {
    max-width: 240px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* 360px Ultra-Compact Device Optimization */
@media (max-width: 360px) {
  .brand-title {
    font-size: 13px;
    line-height: 1.05;
  }

  .btn-pitra-dosh .badge-new {
    display: none;
  }

  .hero-heading {
    font-size: 21px;
  }

  .card-body {
    padding: 14px 10px;
  }
}

/* ==========================================================================
   X. PREMIUM DIVIDER RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  #ourServicesSection .section-title {
    font-size: 36px;
  }
  .premium-divider-img {
    width: 320px;
  }
}

@media (max-width: 768px) {
  #ourServicesSection .section-title {
    font-size: 32px;
  }
  .premium-divider-img {
    width: 280px;
  }
}
