/* ==========================================================================
   Beyond Tours Ltd - Modern Mobile-Friendly & Responsive Design System
   Breakpoints: 320px, 360px, 375px, 425px, 576px, 768px, 992px, 1200px, 1400px+
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL MOBILE SAFETY & OVERFLOW PREVENTION
   -------------------------------------------------------------------------- */
html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Base button and interactive touch target size */
.btn, .nav-link, .form-control, .form-select {
  touch-action: manipulation;
}

/* --------------------------------------------------------------------------
   2. EXTRA LARGE DESKTOPS (>= 1400px)
   -------------------------------------------------------------------------- */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* --------------------------------------------------------------------------
   3. LARGE SCREENS & COMPACT DESKTOPS (< 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .planner-field {
    padding: 0.4rem 0.6rem;
  }
  .tour-card {
    height: 380px;
  }
  .tilted-photo-card.card-primary {
    width: 72%;
  }
  .tilted-photo-card.card-secondary {
    width: 68%;
  }
}

/* --------------------------------------------------------------------------
   4. TABLETS & MEDIUM SCREENS (< 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  /* Navbar & Brand */
  .site-navbar {
    padding: 0.65rem 0;
  }
  .site-header-logo {
    width: 88px !important;
    max-width: 88px !important;
  }
  
  /* Hero Carousel */
  .hero-wrapper {
    min-height: 580px;
    padding: 4.5rem 0 6rem;
  }
  .hero-title {
    font-size: clamp(2.2rem, 5.2vw, 3.2rem);
  }
  .hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 1.75rem;
  }

  /* Trip Planner Bar - Responsive Vertical Stack */
  .trip-planner-bar {
    margin-top: -2.5rem;
    padding: 1.25rem 1.15rem;
    border-radius: var(--radius-md);
  }
  .planner-field {
    border-right: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    padding: 0.75rem 0.5rem;
  }
  .planner-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Discover Section - Photo Stack */
  .story-photo-stack {
    min-height: 420px;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .tilted-photo-card.card-primary {
    width: 76%;
    left: 2%;
  }
  .tilted-photo-card.card-secondary {
    width: 72%;
    right: 2%;
  }
  .story-floating-badge {
    left: 6%;
    bottom: -10px;
  }

  /* Plan Trip & Weather Section */
  .plan-trip-text-col {
    margin-bottom: 2rem;
    text-align: center;
  }
  .plan-trip-text-col .d-flex {
    justify-content: center;
  }
  
  /* Tools (Climate & Currency) */
  .tool-widget-card {
    margin-bottom: 1.5rem;
  }

  /* Contact Section */
  .contact-info-col {
    text-align: center;
    margin-bottom: 2rem;
  }
}

/* --------------------------------------------------------------------------
   5. MOBILE PHONES & PHABLETS (< 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  /* Prevent iOS Safari auto-zoom on form inputs */
  input, select, textarea, .form-control, .form-select {
    font-size: 16px !important;
  }

  /* Section Spacers */
  .py-5 {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }
  .my-lg-4, .my-lg-5 {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
  }

  /* Container padding */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Mobile Navbar & Controls */
  .site-navbar {
    padding: 0.5rem 0;
  }
  .navbar-toggler {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hero Section */
  .hero-wrapper {
    min-height: 520px;
    padding: 4.2rem 0 5.2rem;
  }
  .hero-nav-btn {
    display: none !important; /* Mobile touch swipe replaces arrow clicks */
  }
  .hero-wireframe-tagline {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
  }
  .hero-title {
    font-size: clamp(1.85rem, 6.8vw, 2.5rem);
    line-height: 1.18;
    margin-bottom: 0.85rem;
  }
  .hero-subtitle {
    font-size: 0.92rem;
    line-height: 1.52;
    margin-bottom: 1.4rem;
    padding: 0 0.25rem;
  }
  .hero-content .d-flex {
    flex-direction: column;
    gap: 0.65rem !important;
  }
  .hero-content .d-flex .btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 0.92rem;
  }
  .hero-swiper-pagination {
    bottom: 3.5rem !important;
  }
  .hero-swiper-pagination .swiper-pagination-bullet {
    width: 22px;
    height: 4px;
  }
  .hero-swiper-pagination .swiper-pagination-bullet-active {
    width: 36px;
  }
  .hero-bottom-shade {
    height: 200px;
  }

  /* Floating Trip Planner Bar */
  .trip-planner-bar {
    margin-top: -1.75rem;
    padding: 1.15rem 1rem;
    box-shadow: 0 10px 30px rgba(12, 43, 77, 0.12);
    border-radius: var(--radius-sm);
  }
  .planner-field {
    padding: 0.6rem 0.25rem;
  }
  .planner-label {
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
  }
  .planner-select, .planner-input {
    font-size: 0.92rem;
  }
  .trip-planner-bar .btn-serendib {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.8rem;
    font-size: 0.95rem;
  }

  /* Discover Sri Lanka Section */
  #discoverSection {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }
  .story-content-col h2 {
    font-size: 1.65rem;
    line-height: 1.25;
    margin-bottom: 1rem;
  }
  .story-content-col p {
    font-size: 0.92rem;
    line-height: 1.65;
    margin-bottom: 0.85rem;
  }
  .story-content-col .d-flex {
    flex-direction: column;
    gap: 0.65rem !important;
  }
  .story-content-col .btn {
    width: 100%;
  }
  .story-photo-stack {
    min-height: 320px;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
  }
  .tilted-photo-card.card-primary {
    width: 80%;
    left: 2%;
    transform: rotate(-3deg);
  }
  .tilted-photo-card.card-secondary {
    width: 76%;
    right: 2%;
    transform: rotate(2.5deg);
  }
  .tilted-photo-card img {
    height: 190px;
  }
  .story-floating-badge {
    position: relative;
    left: auto;
    bottom: auto;
    margin-top: 1.25rem;
    width: 100%;
    justify-content: center;
    border-left: none;
    border-bottom: 4px solid var(--secondary);
    padding: 0.75rem 1rem;
  }

  /* Trust Pillars Section */
  #trustSection {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }
  #trustSection h2 {
    font-size: 1.65rem;
  }
  .trust-wireframe-card {
    padding: 1.5rem 1.15rem;
    margin-bottom: 0.25rem;
  }

  /* Plan Your Trip & Free Weather Widget */
  #planTripWeatherSection h2 {
    font-size: 1.75rem;
  }
  .plan-trip-text-col .d-flex {
    flex-direction: column;
    gap: 0.65rem !important;
  }
  .plan-trip-text-col .btn {
    width: 100%;
  }

  /* Free Weather Widget Card - Modern Mobile Touch Tabs */
  .free-weather-widget-card {
    margin: 0 auto;
    max-width: 100%;
    border-radius: var(--radius-md) !important;
  }
  .weather-city-bar {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.35rem;
    padding: 0.5rem 0.65rem !important;
  }
  .weather-city-bar::-webkit-scrollbar {
    display: none;
  }
  .weather-city-bar .btn-weather-city {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 0.35rem 0.8rem !important;
  }
  .weather-widget-body {
    padding: 1.25rem 1rem !important;
  }
  .weather-widget-body .display-4 {
    font-size: 2.4rem;
  }

  /* Popular Tour Packages Catalog */
  .tour-card {
    height: 350px;
  }
  .tour-card-title {
    font-size: 1.25rem;
  }
  .tour-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* What We Offer Section - Smooth Horizontal Scroll Pill Bar */
  #whatWeOfferSection {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }
  #whatWeOfferSection h2 {
    font-size: 1.75rem;
  }
  .offer-filter-bar,
  #whatWeOfferSection .d-flex.flex-wrap.justify-content-center.gap-2 {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start !important;
    padding: 0.4rem 0.5rem 0.85rem !important;
    margin-bottom: 1.75rem !important;
  }
  .offer-filter-bar::-webkit-scrollbar,
  #whatWeOfferSection .d-flex.flex-wrap.justify-content-center.gap-2::-webkit-scrollbar {
    display: none;
  }
  .btn-offer-filter {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 0.45rem 1rem !important;
  }
  .offer-master-card {
    border-radius: var(--radius-md) !important;
  }
  .offer-master-card img {
    height: 200px;
  }
  .offer-master-card .card-body {
    padding: 1.25rem 1.1rem;
  }
  .offer-master-card .card-title {
    font-size: 1.25rem;
  }

  /* Interactive Tools Section */
  .tool-widget-card {
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius-md);
  }
  .tool-widget-card h3 {
    font-size: 1.35rem;
  }

  /* Testimonials Section */
  .testimonial-card {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-md);
  }
  .testimonial-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Promo Stats Section - Responsive 2x2 Grid */
  .promo-stats-section h2 {
    font-size: 1.65rem;
  }
  .stats-card-framed {
    border-radius: var(--radius-md);
    padding: 0.5rem;
  }
  .stat-col {
    padding: 1rem 0.5rem;
  }
  .stat-col:nth-child(1),
  .stat-col:nth-child(2) {
    border-bottom: 1px solid rgba(12, 43, 77, 0.12);
  }
  .stat-col:nth-child(odd) {
    border-right: 1px solid rgba(12, 43, 77, 0.12);
  }
  .stat-col:nth-child(even) {
    border-right: none;
  }
  .stat-inner .counter-number {
    font-size: clamp(1.8rem, 6.5vw, 2.5rem);
  }
  .stat-inner .counter-label {
    font-size: 0.72rem;
  }

  /* Inspirational Quote Photo Banner */
  .quote-photo-banner {
    padding: 3.5rem 1rem;
  }
  .quote-lead-p {
    font-size: clamp(1rem, 3.8vw, 1.2rem);
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  .quote-content-wrap .d-flex {
    flex-direction: column;
    gap: 0.75rem !important;
  }
  .quote-content-wrap .btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
  }

  /* Direct Inquiry & Contact Section */
  #contactSection {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }
  #contactSection h2 {
    font-size: 1.65rem;
  }
  .contact-info-col .btn {
    width: 100%;
  }
  .contact-form-col .p-4,
  .contact-form-col .p-md-5 {
    padding: 1.4rem 1.15rem !important;
    border-radius: var(--radius-md) !important;
  }

  /* Blog Travel Stories Section */
  .blog-card {
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .blog-card-img-wrap img {
    height: 190px;
  }
  .blog-card-body {
    padding: 1.25rem 1.1rem;
  }
  .blog-card-title {
    font-size: 1.2rem;
  }

  /* Global Footer */
  .site-footer {
    padding-top: 3.25rem;
    padding-bottom: 1.5rem;
  }
  .footer-heading {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
  }
  .footer-links {
    margin-bottom: 1.5rem;
  }
  .footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
  }
  .footer-bottom .text-md-end {
    text-align: center !important;
    margin-top: 0.75rem;
  }
  .currency-converter-card {
    padding: 1.25rem 1rem !important;
    border-radius: var(--radius-md) !important;
    margin-top: 1rem;
  }

  /* Modals on Mobile */
  .modal-dialog {
    margin: 0.75rem;
  }
  .modal-content {
    border-radius: var(--radius-md) !important;
  }
  .modal-body {
    padding: 1.25rem 1rem !important;
  }

  /* Floating Back To Top Button */
  .back-to-top-btn {
    width: 44px;
    height: 44px;
    bottom: 1.15rem;
    right: 1.15rem;
    font-size: 1.1rem;
  }
}

/* --------------------------------------------------------------------------
   6. COMPACT PHONES (< 425px: iPhone SE, Galaxy S, Small Androids)
   -------------------------------------------------------------------------- */
@media (max-width: 424.98px) {
  .site-header-logo {
    width: 80px !important;
    max-width: 80px !important;
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .hero-subtitle {
    font-size: 0.88rem;
  }
  .story-photo-stack {
    min-height: 270px;
  }
  .tilted-photo-card img {
    height: 160px;
  }
  .tilted-photo-card.card-primary {
    width: 84%;
    transform: rotate(-2deg);
  }
  .tilted-photo-card.card-secondary {
    width: 80%;
    transform: rotate(2deg);
  }
  .btn-serendib,
  .btn-serendib-outline {
    font-size: 0.88rem;
    padding: 0.68rem 1.15rem;
  }
  .weather-widget-body .display-4 {
    font-size: 2.15rem;
  }
  .weather-dynamic-icon {
    font-size: 2.2rem !important;
  }
  .stat-inner .counter-number {
    font-size: 1.65rem;
  }
  .stat-inner .counter-label {
    font-size: 0.68rem;
  }
  .quote-lead-p {
    font-size: 0.95rem;
  }
  .offcanvas {
    width: 88vw !important;
  }
}
