/*
* Meraki Campsite Responsive Stylesheet
* Media queries for responsive design
*/

/*--------------------------------------------------------------
# Critical Mobile Base Styles
--------------------------------------------------------------*/
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container,
.container-fluid {
    width: 100%;
    max-width: 100%;
}

/*--------------------------------------------------------------
# Small devices (landscape phones, 576px and up)
--------------------------------------------------------------*/
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

/*--------------------------------------------------------------
# Medium devices (tablets, 768px and up)
--------------------------------------------------------------*/
@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    .hero h1 {
        font-size: 3.8rem;
    }

    .banner-title {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.7rem;
    }
}

/*--------------------------------------------------------------
# Large devices (desktops, 992px and up)
--------------------------------------------------------------*/
@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }

    .hero h1 {
        font-size: 4rem;
    }

    .section-title {
        font-size: 3rem;
    }

    .amenities-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/*--------------------------------------------------------------
# Extra large devices (large desktops, 1200px and up)
--------------------------------------------------------------*/
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .hero h1 {
        font-size: 4.2rem;
    }
}

/*--------------------------------------------------------------
# Extra extra large devices (larger desktops, 1400px and up)
--------------------------------------------------------------*/
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/*--------------------------------------------------------------
# Responsive Styles for Smaller Screens
--------------------------------------------------------------*/
@media (max-width: 1199.98px) {
    .panorama-container {
        height: 450px;
    }
}

/*--------------------------------------------------------------
# Laptop optimizations (medium-large laptops)
--------------------------------------------------------------*/
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Bring carousel arrows inside viewport on laptops */
    .carousel-control-prev { left: 8px !important; right: auto !important; }
    .carousel-control-next { right: 8px !important; left: auto !important; }

    /* Slightly reduce oversized headings */
    .hero h1 { font-size: 3.2rem; }
    .section-title { font-size: 2.4rem; }
    .banner-title { font-size: 2.2rem; }

    /* Tighter navbar spacing to avoid wrapping */
    .meraki-navbar .nav-link { font-size: 1rem; padding: 0.45rem 0.7rem; }
    .meraki-navbar .btn-book { padding: 0.6rem 1.2rem !important; font-size: 1rem; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    /* Keep carousel arrows visible on common 1366px laptops */
    .carousel-control-prev { left: 12px !important; right: auto !important; }
    .carousel-control-next { right: 12px !important; left: auto !important; }

    /* Scale headings for laptop readability */
    .hero h1 { font-size: 3.5rem; }
    .section-title { font-size: 2.6rem; }
    .banner-title { font-size: 2.4rem; }

    /* Navbar tweaks to prevent overflow */
    .meraki-navbar .nav-link { font-size: 1.02rem; padding: 0.5rem 0.8rem; }
    .meraki-navbar .btn-book { padding: 0.65rem 1.3rem !important; font-size: 1.04rem; }
}

/*--------------------------------------------------------------
# Booking page laptop responsiveness
--------------------------------------------------------------*/
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Tabs: prevent overflow on smaller laptops */
    #bookingTabs.nav { flex-wrap: wrap; gap: 0.25rem; }
    #bookingTabs .nav-link { font-size: 0.95rem; padding: 0.45rem 0.6rem; white-space: nowrap; }

    /* Form wrapper breathing room without causing wrap */
    .booking-form-wrapper { padding: 22px; }

    /* Sidebar sticky offset slightly tighter */
    .booking-sidebar { top: 84px; }

    /* Calendar compactness */
    .calendar-container { padding: 12px; }
    .calendar-header h3 { font-size: 1.1rem; }
    .calendar-grid .day { font-size: 11px; }

    /* Global page elements */
    .lead { font-size: 1rem; }
    .card-img-top { max-height: 200px; object-fit: cover; }
    .accommodation-card img { height: 220px; }
    .activity-card img { height: 200px; }
    .gallery-image img { height: 200px; }
    .section-title-wrapper { margin-bottom: 2.2rem; }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    /* Tabs: slight size reduction for 1366px */
    #bookingTabs.nav { flex-wrap: wrap; gap: 0.3rem; }
    #bookingTabs .nav-link { font-size: 1rem; padding: 0.5rem 0.75rem; white-space: nowrap; }

    /* Sidebar sticky offset to account for navbar */
    .booking-sidebar { top: 92px; }

    /* Calendar readability without overflow */
    .calendar-container { padding: 14px; }
    .calendar-header h3 { font-size: 1.15rem; }

    /* Sitewide tuning for common components */
    .lead { font-size: 1.05rem; }
    .card-img-top { max-height: 220px; object-fit: cover; }
    .accommodation-card img { height: 230px; }
    .activity-card img { height: 210px; }
    .gallery-image img { height: 220px; }
    .section-title-wrapper { margin-bottom: 2.5rem; }
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--white);
        padding: 15px;
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
        margin-top: 10px;
    }

    .navbar-nav {
        align-items: center;
    }

    .nav-item {
        margin: 2px 0;
        width: 100%;
        text-align: center;
    }

    .nav-link.active:before {
        display: none;
    }

    .btn-book {
        margin-top: 10px;
        width: 100%;
    }

    .hero {
        height: auto;
        min-height: 600px;
        padding: 150px 0 100px;
    }

    .hero-booking-bar {
        position: relative;
        margin-top: -50px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .booking-form-container {
        margin-bottom: 30px;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .panorama-container {
        height: 400px;
    }

    .contact-info-card,
    .tour-nav-sidebar {
        margin-bottom: 30px;
    }

    .booking-sidebar {
        margin-top: 24px;
    }
}

@media (max-width: 767.98px) {
    .section-title {
        font-size: 2.2rem;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .banner-title {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1rem;
    }

    .hero-booking-bar {
        padding: 15px 0;
        position: relative;
        left: 0; right: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .hero-booking-bar-mobile { display: none; }

    .booking-form-container {
        padding: 14px;
        width: 100%;
        max-width: 92vw;
        margin: 0 auto;
    }

    .about-image {
        margin-bottom: 30px;
    }

    .panorama-container {
        height: 350px;
    }

    /* Mobile Navigation Improvements */
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1.2rem;
        padding: 0.5rem 0;
    }

    .navbar-toggler {
        border: none;
        padding: 0.5rem;
        font-size: 1.25rem;
    }

    .navbar-collapse {
        margin-top: 1rem;
        padding: 1rem;
        border-top: 1px solid rgba(0,0,0,0.1);
    }

    .nav-link {
        padding: 0.75rem 0;
        font-size: 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile Form Improvements */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        min-height: 44px;
    }

    .form-label {
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }

    /* Mobile Button Improvements */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile Card Improvements */
    .card {
        margin-bottom: 1.5rem;
        border-radius: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-img-top {
        height: 200px;
        object-fit: cover;
    }

    /* Mobile Modal Improvements */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }

    .modal-content {
        border-radius: 0.75rem;
    }

    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid #e9ecef;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        border-top: 1px solid #e9ecef;
    }

    .amenities-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .activity-icon,
    .feature-icon,
    .instruction-icon,
    .process-icon,
    .contact-icon {
        width: 56px;
        height: 56px;
        font-size: 1.35rem;
    }

    .social-links-lg {
        justify-content: center;
    }

    .booking-process .col-md-3 {
        margin-bottom: 20px;
        padding: 0 8px;
    }
    .booking-process .process-card {
        min-height: 200px;
        padding: 20px 15px;
        margin: 0 auto;
        max-width: 100%;
    }

    /* Ensure proper section spacing on mobile */
    .booking-process {
        padding: 40px 0;
    }

    /* Improve mobile spacing for booking process */
    .booking-process .row {
        margin: 0 -8px;
    }

    .booking-process .process-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
    }

    .booking-process .process-number {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
        top: -3px;
        right: -3px;
    }

    .booking-process h5 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .booking-process p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* --- Booking page mobile enhancements --- */
    /* Make booking tabs horizontally scrollable on mobile */
    #bookingTabs.nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.4rem;
        scrollbar-width: none; /* Firefox */
    }
    #bookingTabs.nav::-webkit-scrollbar { display: none; }
    #bookingTabs .nav-item { flex: 0 0 auto; }
    #bookingTabs .nav-link {
        font-size: 0.95rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

    /* Calendar compact layout - keep inside card, avoid clipping */
    .calendar-container { padding: 10px; position: relative; z-index: 2; width: 100%; max-width: 100%; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
    .booking-sidebar .sidebar-widget { position: relative; overflow: visible; }
    .calendar-grid { width: 100%; max-width: 100%; grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .calendar-header { margin-bottom: 8px; }
    .calendar-header h3 { font-size: 1rem; }
    .calendar-grid { gap: 2px; }
    .calendar-grid .day { font-size: 11px; padding: 2px; }

    /* Sidebar should not stick on mobile */
    .booking-sidebar { position: static; top: auto; margin-top: 16px; }
    .booking-sidebar .sidebar-widget { margin-bottom: 16px; }

    /* Form wrapper tighter padding */
    .booking-form-wrapper { padding: 16px; position: relative; z-index: 1; }
}

@media (max-width: 575.98px) {
    .section-title {
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero {
        min-height: 540px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .hero-content,
    .hero .container {
        padding-left: 12px;
        padding-right: 12px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .banner-title {
        font-size: 2.2rem;
    }

    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }

    .hero-buttons .btn:last-child {
        margin-bottom: 0;
    }

    .booking-form-container label {
        font-size: 0.9rem;
    }

    .booking-form-container .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .activity-icon,
    .feature-icon,
    .instruction-icon,
    .process-icon,
    .contact-icon {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    .panorama-container {
        height: 300px;
    }

    .accommodation-features {
        gap: 10px;
    }

    .accommodation-features span {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .amenities-list {
        grid-template-columns: 1fr;
    }

    .gallery-image img {
        height: 180px;
    }

    .accordion-button {
        padding: 15px;
        font-size: 0.9rem;
    }

    .contact-form-wrapper,
    .direction-card,
    .booking-form-wrapper {
        padding: 20px;
    }

    .insta-image {
        height: 80px;
    }

    .social-share-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Extra small mobile optimizations for booking process */
    .booking-process .col-md-3 {
        margin-bottom: 16px;
        padding: 0 4px;
    }

    .booking-process .process-card {
        min-height: 180px;
        padding: 16px 12px;
    }

    .booking-process .process-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .booking-process .process-number {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
        top: -2px;
        right: -2px;
    }

    .booking-process h5 {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .booking-process p {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    /* Extra-small refinements for booking */
    #bookingTabs .nav-link { font-size: 0.92rem; padding: 0.45rem 0.65rem; }
    .calendar-header h3 { font-size: 0.95rem; }
    .calendar-grid .day { font-size: 10px; }
    .calendar-container { padding: 8px; }
    .booking-form-wrapper { padding: 14px; }

    /* Extra Small Mobile Optimizations */
    .navbar-brand {
        font-size: 1.1rem;
    }

    .hero {
        min-height: 500px;
        padding: 100px 0 60px;
    }

    .section {
        padding: 40px 0;
    }

    /* Prevent horizontal scroll */
    * {
        max-width: 100%;
    }

    /* Better touch targets */
    a, button, input, select, textarea {
        min-height: 44px;
    }

    /* Safe area for iOS notched devices */
    .safe-area-top {
        padding-top: env(safe-area-inset-top);
    }

    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Responsive Blog Details Modal */
@media (max-width: 767.98px) {
  #blogDetailsModal .modal-dialog {
    max-width: 98vw;
    margin: 0.5rem auto;
  }
  #blogDetailsModal .modal-content {
    border-radius: 0.7rem;
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 0.5rem 0.2rem;
  }
  #blogDetailsModal .modal-header {
    padding: 1rem 1rem 0.5rem 1rem;
  }
  #blogDetailsModal .modal-body {
    padding: 0.5rem 1rem 1rem 1rem;
  }
  #blogDetailsModal img#blogDetailsImage {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    margin-bottom: 1rem;
  }
  #blogDetailsContent {
    max-height: 250px;
    font-size: 1rem;
    line-height: 1.5;
    padding-right: 0;
  }
}

@media (max-width: 575.98px) {
  #blogDetailsModal .modal-dialog {
    max-width: 100vw;
    margin: 0.2rem auto;
  }
  #blogDetailsModal .modal-content {
    border-radius: 0.5rem;
    padding: 0.2rem 0.1rem;
  }
  #blogDetailsModal .modal-header {
    padding: 0.7rem 0.7rem 0.3rem 0.7rem;
  }
  #blogDetailsModal .modal-body {
    padding: 0.3rem 0.7rem 0.7rem 0.7rem;
  }
  #blogDetailsModal img#blogDetailsImage {
    max-height: 140px;
  }
  #blogDetailsContent {
    max-height: 180px;
    font-size: 0.97rem;
  }

  /* Additional mobile optimizations for extra small screens */
  .dropdown-menu {
    min-width: 100%;
    max-width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  }

  /* Better gallery images on mobile */
  .gallery-image img,
  .card-img-top {
        height: 200px;
        object-fit: cover;
        object-position: center;
    }

    /* Better table responsiveness */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Touch-friendly interactive elements */
    .nav-item.dropdown .dropdown-toggle::after {
        margin-left: 0.5rem;
    }
}

/* --- Responsive Blog Carousel & Cards for Homepage --- */
@media (max-width: 1199.98px) {
  #blog-carousel-list .carousel-item .row {
    gap: 0.5rem 0;
  }
}
@media (max-width: 991.98px) {
  #blog-carousel-list .carousel-item .col-md-4 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: 1.5rem;
  }
  #blog-carousel-list .card.blog-card {
    width: 100%;
    min-width: 0;
    margin: 0 auto 1.2rem auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  }
  #blog-carousel-list .card-img-top {
    max-height: 180px;
    object-fit: cover;
  }
}
@media (max-width: 767.98px) {
  #blog-carousel-list .carousel-item .col-md-4 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 1.2rem;
  }
  #blog-carousel-list .card.blog-card {
    width: 100%;
    min-width: 0;
    margin: 0 auto 1.2rem auto;
    border-radius: 0.7rem;
  }
  #blog-carousel-list .card-img-top {
    max-height: 140px;
  }
  #blog-carousel-list .card-body {
    padding: 1rem 0.7rem;
  }
  #blog-carousel-list .card-title {
    font-size: 1.08rem;
  }
}
@media (max-width: 575.98px) {
  #blog-carousel-list .carousel-item .col-md-4 {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 1rem;
  }
  #blog-carousel-list .card.blog-card {
    margin-bottom: 0.7rem;
    border-radius: 0.5rem;
  }
  #blog-carousel-list .card-img-top {
    max-height: 100px;
  }
  #blog-carousel-list .card-title {
    font-size: 1rem;
  }
  #blog-carousel-list .card-body {
    padding: 0.7rem 0.4rem;
  }
  .carousel-control-prev, .carousel-control-next {
    width: 32px !important;
    height: 32px !important;
    top: 45%;
  }
  .carousel-control-prev { left: 8px !important; right: auto !important; }
  .carousel-control-next { right: 8px !important; left: auto !important; }
}

/*--------------------------------------------------------------
# Print Styles
--------------------------------------------------------------*/
@media print {
    .navbar,
    .hero-booking-bar,
    .cta-section,
    .footer,
    .btn,
    .social-links,
    .breadcrumb,
    .gallery-filter,
    form,
    .modal {
        display: none !important;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }

    .page-banner,
    .hero {
        height: auto;
        padding: 30px 0;
        margin: 0;
    }

    .page-banner-overlay,
    .hero-overlay {
        display: none;
    }

    .banner-title,
    .hero h1 {
        color: var(--dark) !important;
    }

    .lead,
    p {
        color: var(--dark) !important;
    }

    a {
        text-decoration: none !important;
        color: var(--dark) !important;
    }

    .card,
    .accommodation-card,
    .activity-card,
    .testimonial-card,
    .feature-card,
    .tour-nav-sidebar,
    .panorama-container,
    .contact-info-card,
    .booking-form-wrapper,
    .sidebar-widget {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid var(--gray-300) !important;
    }

    .col-lg-6,
    .col-md-6,
    .col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/*--------------------------------------------------------------
# Performance and Touch Optimizations
--------------------------------------------------------------*/

/* Optimize for touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }

    .card:hover {
        transform: none;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero {
        background-size: cover;
        background-position: center;
    }

    .hero {
        background-attachment: scroll; /* Better performance on mobile */
    }
}

/* Additional mobile-specific utilities */
@media (max-width: 767.98px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }
}

/* Touch-friendly spacing and targets */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Better text rendering on mobile */
@media (max-width: 767.98px) {
    h1, h2, h3, h4, h5, h6 {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    p, a, span {
        -webkit-font-smoothing: antialiased;
    }

    /* Booking section: use normal flow on mobile (fix large gap) */
    .booking-section { padding-top: 0; }
    .booking-section .row { position: static; padding-top: 0; }
    .booking-section .col-lg-7 .section-title-wrapper,
    .booking-section .col-lg-7 .alert { position: static; width: auto; left: auto; right: auto; z-index: auto; padding: 0; margin-bottom: 1rem; }
    .booking-section .col-lg-7 .nav,
    .booking-section .col-lg-7 > .booking-form-wrapper > .nav,
    .booking-section .col-lg-7 > .booking-form-wrapper > ul.nav { margin-top: 0; }

    /* Calendar appears second (visually) after title/alert */
    .booking-section .col-lg-5 {
        order: 1 !important;
    }

    .booking-section .col-lg-7 {
        order: 2 !important;
    }
}

/*--------------------------------------------------------------
# reCAPTCHA Styles
--------------------------------------------------------------*/
.g-recaptcha {
    display: inline-block !important;
    margin: 0 auto !important;
}

.form-group.text-center .g-recaptcha {
    display: inline-block !important;
    text-align: center !important;
}

/* Ensure reCAPTCHA is properly centered for login/signup/contact */
.form-group.text-center {
    text-align: center !important;
}

.form-group.text-center > div {
    display: inline-block !important;
    margin: 0 auto !important;
}

/* Left-align reCAPTCHA only for booking forms */
.booking-form .form-group .g-recaptcha {
    display: inline-block !important;
    text-align: left !important;
    margin: 0 !important;
}

.booking-form .form-group {
    text-align: left !important;
}
