/* Global Mobile Fixes */
html,
body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* Ensure body has padding so content isn't hidden behind nav */
body {
    padding-bottom: 70px;
    /* Height of the bottom nav */
}

/* Mobile Header Padding */
@media only screen and (max-width: 991px) {
    .main-header .header-upper {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .main-header {
        padding-top: 1px;
        padding-bottom: 1px;
    }

    .header-upper .logo-box {
        padding: 5px 0;
    }

    /* Ensure header has fixed height */
    .header-inner {
        min-height: 50px;
    }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0 !important;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2147483647;
    /* Max z-index to ensure it's on top */
    padding-bottom: env(safe-area-inset-bottom);
    /* iOS safe area */
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--heading-color);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
}

.mobile-bottom-nav a i {
    font-size: 20px;
    margin-bottom: 5px;
    color: var(--base-color);
    transition: 0.3s;
}

.mobile-bottom-nav a.active i,
.mobile-bottom-nav a:hover i {
    color: var(--primary-color);
}

.mobile-bottom-nav a span {
    font-size: 11px;
    font-weight: 600;
}



/* Package Cards Mobile Enhancements */
@media only screen and (max-width: 767px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .destination-item.style-two,
    .feature-item.style-three {
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
        margin-bottom: 25px;
        margin-left: 10px;
        margin-right: 10px;
        border-radius: 12px;
        overflow: hidden;
    }

    .destination-item.style-two .image img {
        border-radius: 12px 12px 0 0;
    }

    .destination-item.style-two .content {
        padding: 20px;
    }

    /* Ensure cards don't touch edges unpleasantly */
    .row {
        --bs-gutter-x: 20px;
    }

    /* Better spacing for section titles on mobile */
    .section-title h2 {
        font-size: 28px;
        line-height: 1.3;
    }

    /* Adjust destination item for 2-column layout */
    .destination-active .destination-item.style-two {
        padding: 10px 5px !important;
        margin-left: 5px;
        margin-right: 5px;
    }

    .destination-active .destination-item.style-two .content {
        padding: 10px 5px;
    }

    .destination-active .destination-item.style-two .content h6 {
        font-size: 16px;
        margin-bottom: 5px;
    }
}

/* Modern Get Quote Button - Mobile Enhancements */
@media only screen and (max-width: 991px) {
    .get-quote-btn-modern {
        margin-right: 10px;
    }
}

@media only screen and (max-width: 575px) {
    .get-quote-btn-modern {
        padding: 8px 14px 8px 10px;
    }

    .get-quote-btn-modern .btn-content {
        gap: 6px;
    }

    .get-quote-btn-modern .icon-wrapper {
        width: 26px;
        height: 26px;
    }

    .get-quote-btn-modern .icon-wrapper i {
        font-size: 11px;
    }

    .get-quote-btn-modern .btn-title {
        font-size: 13px;
    }
}

@media only screen and (max-width: 375px) {
    .get-quote-btn-modern {
        padding: 6px 12px 6px 8px;
    }

    .get-quote-btn-modern .btn-content {
        gap: 5px;
    }

    .get-quote-btn-modern .icon-wrapper {
        width: 24px;
        height: 24px;
    }

    .get-quote-btn-modern .icon-wrapper i {
        font-size: 10px;
    }

    .get-quote-btn-modern .btn-title {
        font-size: 12px;
        letter-spacing: 0.3px;
    }

    .get-quote-btn-modern .arrow-wrapper i {
        font-size: 10px;
    }
}

/* Hero Area Responsive Padding - Ensure Compact Heights */
@media only screen and (max-width: 1199px) {
    .hero-area-three {
        padding-top: 70px !important;
        padding-bottom: 50px !important;
    }
}

@media only screen and (max-width: 991px) {
    .hero-area-three {
        padding-top: 60px !important;
        padding-bottom: 40px !important;
    }

    .hero-content-three.mb-60 {
        margin-bottom: 40px !important;
    }
}

@media only screen and (max-width: 767px) {
    .hero-area-three {
        padding-top: 60px !important;
        padding-bottom: 45px !important;
    }

    .hero-content-three.mb-60 {
        margin-bottom: 35px !important;
    }

    .hero-content-three h1 {
        font-size: 40px !important;
        line-height: 1.2;
    }

    .hero-content-three .subtitle {
        font-size: 15px !important;
    }

    .hero-content-three p {
        font-size: 16px !important;
    }
}

@media only screen and (max-width: 575px) {
    .hero-area-three {
        padding-top: 55px !important;
        padding-bottom: 40px !important;
    }

    .hero-content-three.mb-60 {
        margin-bottom: 30px !important;
    }

    .hero-content-three h1 {
        font-size: 34px !important;
        margin-bottom: 12px;
    }

    .hero-content-three p {
        font-size: 15px !important;
    }

    .hero-content-three .subtitle {
        font-size: 14px !important;
        margin-bottom: 12px !important;
    }
}

@media only screen and (max-width: 375px) {
    .hero-area-three {
        padding-top: 60px !important;
        padding-bottom: 35px !important;
    }

    .hero-content-three h1 {
        font-size: 28px !important;
        letter-spacing: 0.02em;
    }

    .hero-content-three p {
        font-size: 18px !important;
        letter-spacing: 0.02em;
    }

    .hero-content-three .subtitle {
        font-size: 16px !important;
    }
}

/* Weather Card Mobile Enhancements */
@media only screen and (max-width: 991px) {
    .weather-card {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px !important;
        padding: 20px 15px !important;
        align-items: stretch !important;
    }

    /* 1. Main Weather Block - Repurposed as Card */
    .weather-main-wrap {
        grid-column: span 1;
        width: 100% !important;
        margin: 0 !important;
        background-color: #f8f9fa;
        border-radius: 12px;
        padding: 15px 5px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        min-height: 110px;
    }

    .weather-icon-circle {
        width: 40px !important;
        height: 40px !important;
        background: transparent !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
    }

    .weather-icon-circle img {
        width: 45px !important;
        height: 45px !important;
        object-fit: contain;
    }

    .weather-main-info {
        padding: 0 !important;
        background: transparent !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: 4px !important;
        width: 100%;
    }

    .weather-main-info h2 {
        font-size: 18px !important;
        margin: 0 !important;
        line-height: 1.2;
        font-weight: 700 !important;
    }

    .weather-main-info span {
        font-size: 11px !important;
        text-transform: capitalize;
        color: #6c757d !important;
        display: block;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* 2. Metrics Block - Unwrap to join Grid */
    .enhanced-metrics-grid {
        display: contents !important;
    }

    .enhanced-metrics-grid .metric-item {
        grid-column: span 1;
        width: 100% !important;
        background-color: #f8f9fa;
        padding: 15px 5px !important;
        border-radius: 12px;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        /* Ensure center text */
        gap: 8px !important;
        height: auto !important;
        min-height: 110px;
    }

    /* Wind Metric Centering */
    .wind-metric {
        display: flex !important;
        grid-column: 2;
        /* Centers the 4th item in the 2nd row of a 3-col grid */
    }

    .enhanced-metrics-grid .metric-item i {
        font-size: 24px !important;
        margin-bottom: 0 !important;
        color: #198754 !important;
    }

    .enhanced-metrics-grid .metric-item>div {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .enhanced-metrics-grid .metric-item small {
        font-size: 11px !important;
        margin-bottom: 4px !important;
        color: #6c757d !important;
    }

    .enhanced-metrics-grid .metric-item strong {
        font-size: 18px !important;
        line-height: 1.2;
    }

    /* 3. Action / Footer */
    .weather-action {
        grid-column: 1 / -1;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: 10px !important;
        padding-top: 10px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Remove the w-100-mobile class input if it causes conflict, but we added it manually to HTML safely */

    .last-updated-wrap {
        margin: 0 !important;
        font-size: 12px !important;
        text-align: left;
    }

    .weather-action button {
        padding: 6px 16px !important;
        font-size: 13px !important;
        width: auto !important;
    }
}

/* Bottom Menu Popup & Overlay */
.bottom-menu-popup {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 2147483648;
    border-radius: 20px 20px 0 0;
    padding: 25px 20px 30px;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.15);
    transition: bottom 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.bottom-menu-popup.active {
    bottom: 0;
}

.bottom-menu-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.bottom-menu-popup .popup-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.bottom-menu-popup .popup-header button {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    padding: 0;
    line-height: 1;
}

.popup-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    color: var(--heading-color);
    text-decoration: none;
    transition: 0.2s;
}

.popup-item:hover {
    background: #e9ecef;
    color: var(--primary-color);
}

.popup-item i {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--base-color);
}

.popup-item span {
    font-size: 13px;
    font-weight: 500;
}

.bottom-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2147483646;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.bottom-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}