/**
 * Palace Tours Display - Definitive Final Fixes v21.1.11
 * v21.1.11: Fixes white space, lifts Menu above gold bar, ensures Map visibility.
 */

/* --- 1. HEADER & MENU PROTECTION --- */
/* Force site navigation to the absolute top layer */
.elementor-location-header,
.elementor-nav-menu--dropdown,
.elementor-menu-toggle,
#header_pop {
    z-index: 10000 !important;
}

/* --- 2. KILL WHITE SPACE (Targeted Content Constraint) --- */
/* Instead of shrinking the width, we hide anything that spills over.
   This prevents the "invisible wall" while keeping the layout intact. */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden !important;
        position: relative !important;
        width: 100% !important;
    }

    /* Constrain the specific Elementor sections holding our tour */
    .elementor-section, .e-con, .e-con-inner {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Snaps the tour content to the phone width */
    .ptd-tour-container {
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
}

/* --- 3. GOLD BAR ALIGNMENT & Z-INDEX --- */
@media (max-width: 768px) {
    /* Set to 998 to stay beneath site header (Z=10000) */
    body .ptd-mobile-sticky-header {
        z-index: 998 !important; 
        position: fixed !important;
        top: var(--ptd-sticky-offset, 60px) !important;
        background: #c9a227 !important;
        height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }

    body .ptd-sticky-wrapper.is-stuck {
        z-index: 997 !important;
    }
}

/* --- 4. ITINERARY: KILL 450px SPRAWL --- */
@media (max-width: 767px) {
    body .ptd-tour-container .ptd-ge-day {
        display: block !important;
        width: 100% !important;
        grid-template-columns: none !important; /* Forces 1-column */
    }

    body .ptd-tour-container .ptd-ge-day-image-col {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
    }

    body .ptd-tour-container .ptd-ge-day-text-col {
        width: 100% !important;
        min-height: 1px !important;
        padding: 15px !important;
    }
}

/* --- 5. GOOGLE MAPS & GALLERY --- */
body .ptd-route-map {
    width: 100% !important;
    height: 350px !important;
    display: block !important;
}

/* Re-allow map tiles to expand inside the constrained container */
.gm-style img {
    max-width: none !important;
}

@media (max-width: 768px) {
    body .ptd-tour-container .ptd-gallery {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    body .ptd-tour-container .ptd-gallery-link {
        aspect-ratio: 4 / 3 !important;
        overflow: hidden !important;
        border-radius: 8px !important;
    }
}