/* ===== Header layout alignment with sticky nav design ===== */
.header-wrapper {
    /* Full-width 100vw background - breaks out of any container */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    
    /* Only bottom border for seamless blend */
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    
    /* Visual styling */
    background-color: var(--color-background);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04); /* Only bottom shadow */
}

/* Dynamic viewport units for modern browsers */
@supports (width: 100dvw) {
    .header-wrapper {
        width: 100dvw;
        margin-left: calc(-50dvw + 50%);
        margin-right: calc(-50dvw + 50%);
    }
}

.header-inner-container {
    /* Centered boxed content - matches sticky nav 1226px */
    max-width: 1226px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;

    /* Bootstrap navbar container behavior */
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start; /* Natural flow instead of space-between */
    gap: 0; /* Let children handle their own spacing */
}

.header-shell .navbar {
    border-bottom: 0;
    background-color: transparent;
    padding: 0; /* Remove default Bootstrap navbar padding */
}

.mobile-offcanvas-header {
    min-height: 56px;
}

.mobile-section-heading {
    font-size: var(--fs-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.menu-icon-wrapper {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.top-pick-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    background-color: var(--color-background-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Top Tours Bar - Full-width background + centered content (matches header & sticky nav) */
.top-tours-bar.top-tours-shell {
    /* Full-bleed 100vw background - break out of container */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    
    /* Visual styling */
    background: var(--color-background);
    box-sizing: border-box;
    padding: 0; /* No padding on wrapper - handled by inner container */
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Dynamic viewport units support */
@supports (width: 100dvw) {
    .top-tours-bar.top-tours-shell {
        width: 100dvw;
        margin-left: calc(-50dvw + 50%);
        margin-right: calc(-50dvw + 50%);
    }
}

/* Inner container - centered and boxed (matches .header-inner-container and .sticky-nav-container) */
.top-tours-inner-container {
    max-width: 1226px;
    margin: 0 auto;
    padding: 0 1rem; /* Minimal vertical spacing - no top/bottom padding */
}

/* Top Tours navigation links */
.featured-tours-nav .nav-link {
    font-size: var(--fs-sm);
}

.nav-label {
    font-weight: var(--weight-semibold);
    font-size: var(--fs-sm);
}

/* ===== Minimal custom utilities ===== */
.tap-44 {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

/* Icon sizing - 22px on mobile, 24px from md breakpoint up */
.icon { 
    width: 22px; 
    height: 22px; 
    display: block;
}

@media (min-width: 768px) { 
    .icon { 
        width: 24px; 
        height: 24px; 
    } 
}

/* Consistent stroke width for all SVG elements */
.icon path, 
.icon circle, 
.icon line, 
.icon rect { 
    stroke-width: 1.75; 
}

/* Cart badge - properly sized and positioned outside the icon corner */
.site-header .mobile-cart .pca-cart-count {
    position: absolute !important;
    top: -4px !important;  /* Negative offset to sit outside corner */
    right: -4px !important; /* Negative offset to sit outside corner */
    left: auto;
    transform: none;
    
    /* Size: 14-16px badge on 20-22px icon */
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    
    /* Perfect circle for single digits */
    border-radius: 50% !important;
    
    /* Colors and text */
    background: #dc3545 !important;
    color: #fff !important;
    font-size: var(--fs-xs) !important;
    font-weight: var(--weight-bold) !important;
    font-family: var(--font-body) !important;
    
    /* True centering with flex + optical adjustment */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding: 0 !important; /* Reset padding */
    padding-top: 1px !important; /* 1px optical adjustment for numeral */
    
    /* Crisp white ring using border instead of shadow */
    border: 2px solid #fff !important;
    box-shadow: none !important; /* Remove the shadow */
    
    /* Stack above icon */
    z-index: 10 !important;
}

/* Switch to pill shape for 2+ digits (10+) */
.site-header .mobile-cart .pca-cart-count.pill {
    width: auto !important;
    min-width: 16px !important;
    padding: 1px 5px 0 !important; /* Maintain optical adjustment, add horizontal padding */
    border-radius: 999px !important; /* Pill shape */
}

/* Remove inline gap blur on SVG icons */
.tap-44 svg,
.text-body-secondary svg {
    display: block;
}

.tap-44:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

.tap-44:active {
    background-color: rgba(0, 0, 0, 0.08) !important;
}

/* Optional: Border on scroll */
.site-header.is-stuck {
    border-bottom: 1px solid rgba(0,0,0,.06);
}

/* Mobile actions safe-area padding (iOS notch) */

/* ===== Bootstrap Offcanvas Mobile Menu ===== */

/* Offcanvas width - edge-to-edge feel */
#mobileMenu {
    --bs-offcanvas-width: 360px;
    border-left: 0;  /* Remove default edge border */
}

/* Full width on very small screens for true native feel */
@media (max-width: 400px) {
    #mobileMenu {
        --bs-offcanvas-width: 100vw;
    }
}

/* Removed duplicate - see consolidated definition at line ~860 */

/* Make WP menu items read like rows and show a chevron on parents */
#mobileMenu .menu > li > a {
    display: flex;
    align-items: center;
    padding: .75rem .75rem;        /* ~48px row height */
    border-radius: .5rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

#mobileMenu .menu > li > a:hover {
    background: var(--bs-light);
    color: var(--bs-link-color);
}

/* Parent indicator chevron on the right */
#mobileMenu .menu > li.menu-item-has-children > a::after {
    content: "";
    margin-left: auto;
    width: .5rem;
    height: .5rem;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: .5;
}

/* Active item */
#mobileMenu .menu > li.current-menu-item > a {
    color: var(--bs-primary);
    font-weight: var(--weight-semibold);
    background: var(--bs-primary-bg-subtle, rgba(13,110,253,.08));
}

/* Ensure the offcanvas body can host the absolute sub-sheet */
#mobileMenu .offcanvas-body { 
    position: relative; 
    padding-bottom: max(16px, env(safe-area-inset-bottom)); 
}

#mobileMenu .menu .sub-menu { 
    margin: .25rem 0 0 .5rem; 
}

/* Footer rows - consistent tap targets */
#mobileMenu footer a {
    min-height: 44px;          /* guarantee comfy taps */
    border-radius: .5rem;
}

#mobileMenu footer a:hover {
    background: var(--bs-light);
}

#mobileMenu .nav-link.active { 
    background: rgba(0, 0, 0, 0.08); 
    font-weight: var(--weight-semibold); 
    color: var(--hdr-accent);
}

/* Ensure search input in mobile menu is properly styled */
#mobileMenu .input-group-text {
    background: transparent;
    border-right: 0;
}

#mobileMenu .form-control {
    border-left: 0;
    padding-left: 0;
}

#mobileMenu .form-control:focus {
    box-shadow: none;
    border-color: var(--hdr-border);
}
.mobile-actions {
    padding-right: max(0px, env(safe-area-inset-right));
}

/* Removed redundant mobile-cart-badge - using pca-cart-count instead */

@media (max-width: 575.98px) {
    .navbar-brand img { 
        max-height: 36px !important;
    }
}

/* ===== Top bar ===== */
.site-header .navbar {
    background: var(--color-background);
    min-height: var(--hdr-height);
    border-bottom: none; /* No border - handled by .header-wrapper */
    box-shadow: none; /* No shadow - handled by .header-wrapper */
    font-family: var(--font-body); /* Override parent theme Poppins */
    font-size: var(--fs-body);
    color: var(--color-body);
}

.site-header .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
    min-height: inherit;
}

/* ===== Brand (logo) ===== */
.site-header .navbar-brand,
.site-header .site-logo {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.site-header .navbar-brand .custom-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

/* Logo performance and CLS prevention */
.site-header .navbar-brand .custom-logo-link img {
    display: block;
    height: 45px;
    width: auto;  /* Let width auto-adjust to maintain aspect ratio */
    max-width: 161px;
    object-fit: contain;
    image-rendering: auto;
}

/* ===== Desktop search (hidden <992px) ===== */
.site-header .search-container {
    order: 2;
    position: relative;
    height: 40px;
    /* flex properties now controlled by Bootstrap utilities (flex-grow-1, flex-shrink-1) */
    /* margin now controlled by Bootstrap mx-3 utility */
}

/* Width constraints for desktop search - constrain to ~60% to prevent nav wrap */
.site-header .search-container.desktop-only {
    flex: 0 1 60%; /* Constrain to 60% of available space */
    min-inline-size: 280px; /* Logical property for RTL support */
    max-inline-size: 420px; /* Slightly narrower to leave room for nav */
    /* Fallback for older browsers */
    min-width: 280px;
    max-width: 420px;
}

/* Legacy search selectors removed - using Bootstrap input-group pattern instead */
/* See .input-group.pcat-search-wrapper styles below */

/* ===== Primary nav + cart (right cluster) ===== */
.site-header .header-right {
    order: 3;
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 1 auto; /* Bootstrap utilities handle spacing (ms-auto) */
}

.site-header .navbar-nav.header-menu {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
}

.site-header .navbar-nav .nav-link {
    padding: 0;
    line-height: 44px;
    color: var(--hdr-text);
    font-size: var(--fs-sm) !important;
    font-weight: var(--weight-semibold) !important;
    font-family: var(--font-body);
    transition: color .15s;
}

.site-header .navbar-nav .nav-link:hover {
    color: var(--color-heading);
    text-decoration: none;
}

.site-header .header-cart {
    display: flex;
    align-items: center;
}

.site-header .cart-contents {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tap-size-sm);
    height: var(--tap-size-sm);
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--hdr-text);
    transition: background var(--easing), transform var(--easing);
}

.site-header .cart-contents:hover {
    background: var(--color-background-muted);
    transform: scale(1.03);
}

.site-header .cart-contents svg {
    width: 20px;
    height: 20px;
}

.site-header .cart-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--hdr-danger);
    color: #fff;
    font-size: var(--fs-xs);
    text-align: center;
    box-shadow: 0 0 0 2px var(--hdr-bg);
}

.site-header .cart-count:empty,
[data-count="0"] {
    display: none;
}



/* ===== WordPress menu essentials (keep minimal) ===== */
#navbarPuntaCana {
    flex-basis: auto;
}

#navbarPuntaCana .navbar-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    list-style: none;
}

#navbarPuntaCana .navbar-nav>li {
    position: relative;
    list-style: none;
}

#navbarPuntaCana .navbar-nav>li>a {
    display: block;
    padding: .5rem 0;
    color: var(--hdr-text);
    font: 600 14px/1 inherit;
    text-decoration: none;
}

#navbarPuntaCana .navbar-nav>li>a:hover {
    color: var(--color-heading);
    background-color: rgba(0, 0, 0, .05);
}

/* ===== Mobile (<992px) ===== */
@media (max-width:991.98px) {
    .site-header .navbar {
        min-height: 80px;
        height: 80px;
    }

    .site-header .header-container {
        padding: 0 16px;
        gap: 0;
        max-width: none;
    }

    .site-header .site-logo,
    .site-header .navbar-brand {
        height: 80px;
        display: flex;
        align-items: center;
        width: 150px;
    }

    .site-header .navbar-brand .custom-logo-link img {
        width: 150px;
        height: 41px;
        image-rendering: auto;  /* Ensure crisp rendering */
    }

    .site-header .search-container {
        display: none;
    }

    /* desktop search hidden */
    /* Mobile action buttons - consistent sizing and styling */
    .site-header .search-toggle,
    .site-header .navbar-toggler,
    .site-header .header-cart .cart-contents,
    .site-header .header-cart--mobile .cart-contents {
        width: var(--tap-size);
        height: var(--tap-size);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-md);
        background: transparent;
        border: 0;
        color: rgb(26, 43, 73);
    }

    .site-header .search-toggle:hover,
    .site-header .navbar-toggler:hover,
    .site-header .header-cart .cart-contents:hover {
        background: var(--color-background-muted);
        transform: scale(1.03);
    }

    #navbarPuntaCana {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-background);
        border-top: 1px solid var(--hdr-border);
        box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
        z-index: 1000;
    }

    .site-header .header-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .site-header .navbar-nav.header-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 1rem;
    }

    .site-header .navbar-nav .nav-link {
        line-height: 40px;
        padding: .5rem 1rem;
    }
}

/* ===== Bootstrap utility class overrides ===== */
.site-header .d-lg-none {
    display: flex !important;
}

.site-header .d-none.d-lg-flex {
    display: none !important;
}

.site-header .ms-lg-3 {
    margin-left: 0 !important;
}

/* Ensure logo is always visible */
.site-header .site-logo,
.site-header .navbar-brand {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (min-width: 992px) {
    .site-header .d-lg-none {
        display: none !important;
    }
    
    .site-header .d-none.d-lg-flex {
        display: flex !important;
    }
    
    .site-header .ms-lg-3 {
        margin-left: 1rem !important;
    }
}

/* ===== Accessibility & utilities ===== */
.site-header .navbar-toggler:focus {
    outline: 2px solid var(--hdr-focus);
    outline-offset: 2px;
}

.site-header a:focus,
.site-header button:focus {
    outline: 2px solid var(--hdr-focus);
    outline-offset: 2px;
    border-radius: 4px;
}

.site-header {
    overflow: visible !important; /* Prevent dropdown clipping */
    position: relative;
}

/* ===== Z-index hierarchy for proper dropdown stacking ===== */
.site-header .navbar {
    position: relative;
    z-index: 1040; /* Above sticky Top Tours bar (z-index: 30) */
}

.site-header .dropdown-menu {
    z-index: 1050; /* Highest priority for dropdown menus */
}

/* Prevent container clipping */
.site-header .container-xxl,
.site-header .container-fluid {
    overflow: visible !important;
}

/* ===== Dropdown menu specific fixes ===== */
.site-header .dropdown-menu {
    margin-top: 8px; /* Add space between toggle and menu */
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Ensure dropdown items also use correct font */
.site-header .dropdown-menu a {
    font-size: var(--fs-sm) !important;
    font-weight: var(--weight-regular); /* Normal weight for dropdown items */
    color: var(--hdr-text);
}

/* Ensure dropdown toggle doesn't get cut off */
.site-header .dropdown-toggle::after {
    vertical-align: middle;
}

/* Fix for dropdown positioning */
.site-header .navbar-nav .dropdown {
    position: static; /* Let Popper handle positioning */
}

@media (min-width: 992px) {
    .site-header .navbar-nav .dropdown-menu {
        position: absolute;
        right: 0; /* Align to right edge to avoid cart collision */
    }
}

/* ===== Mobile Search Overlay ===== */
.mobile-search-overlay[hidden] { 
    display: none !important; 
}

.mobile-search-overlay {
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.15); /* Subtle backdrop for transition */
    z-index: 1200; /* Above sticky nav (1100) but below modals */
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow-y: auto; display: flex; flex-direction: column;
}

.mobile-search-overlay.open { 
    opacity: 1;
}

.mobile-search-bar { 
    width: 100%; max-width: 600px; margin: 0 auto;
    padding: 20px 16px 0; flex: 1; display: flex; flex-direction: column;
    position: relative; z-index: 1; 
    height: 100vh; /* Full height, not min */
    height: 100dvh; /* Modern dynamic viewport height */
    background: var(--color-background); /* White content area on top of backdrop */
    border-radius: 0; /* No rounded corners on mobile - full screen */
    box-shadow: none; /* No shadow needed for full-screen */
}

.mobile-search-header {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 44px; margin: 0 0 10px;
}

.mobile-search-title {
    margin: 0; font-size: var(--fs-sm); line-height: 1.25; font-weight: var(--weight-medium);
    color: var(--color-heading); text-align: center; flex: 1;
}

.mobile-search-bar .close-mobile-search {
    position: absolute; 
    top: max(0px, env(safe-area-inset-top)); 
    right: max(0px, env(safe-area-inset-right)); 
    width: 44px; height: 44px;
    padding: 0; border-radius: 9999px; background: var(--color-background-muted); border: 0;
    color: var(--color-heading); display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px var(--color-border); transition: transform .12s ease, background .12s ease;
}

.mobile-search-container { margin-top: 6px; }

/* Mobile Search - Bootstrap 5 input-group customization */
.mobile-search-overlay .input-group.pcat-search-wrapper {
    height: 56px !important; /* Override base 38px */
    background: #fff !important; /* Override base #f9fafb */
    border: 2px solid #dee2e6 !important; /* Override base border */
    border-radius: 12px !important;
    padding: 0 !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.mobile-search-overlay .input-group.pcat-search-wrapper:focus-within {
    border-color: #86b7fe !important; /* Bootstrap focus border */
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important; /* Bootstrap focus ring */
    outline: 0 !important;
}

.mobile-search-overlay .input-group-text.pcat-search-icon {
    padding: 0 16px !important; /* Bootstrap standard padding */
    background-color: transparent !important;
    border: 0 !important;
    border-right: 1px solid #dee2e6 !important; /* Separator */
    border-radius: 0 !important;
    color: #6c757d !important; /* Bootstrap muted color */
}

.mobile-search-overlay .input-group-text.pcat-search-icon svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
}

.mobile-search-overlay .form-control.pcat-search-input {
    border: none !important;
    background: transparent !important;
    font-size: var(--fs-body) !important; /* Prevents iOS zoom */
    padding: 0.75rem 1rem !important; /* Override base padding */
    color: #212529 !important; /* Bootstrap body color */
    height: 100% !important;
}

.mobile-search-overlay .form-control.pcat-search-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.mobile-search-overlay .form-control.pcat-search-input::placeholder {
    color: #6c757d !important; /* Bootstrap muted text color */
    opacity: 1 !important;
}

/* Focus state enhancement - Hide icon on focus for cleaner UX (Mobile) */
.mobile-search-overlay .input-group.pcat-search-wrapper:focus-within .input-group-text.pcat-search-icon {
    display: none !important; /* Hide icon when user is typing */
}

/* Desktop search - Bootstrap input-group styling */
.search-container.desktop-only .input-group.pcat-search-wrapper {
    height: 42px !important; /* Comfortable desktop height */
    background: #f8f9fa !important; /* Light gray background */
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important; /* Subtle rounded, not pill-shaped */
    padding: 0 !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
}

.search-container.desktop-only .input-group.pcat-search-wrapper:hover {
    border-color: #adb5bd !important;
    background: #fff !important;
}

.search-container.desktop-only .input-group.pcat-search-wrapper:focus-within {
    border-color: #86b7fe !important;
    background: #fff !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15) !important;
    outline: 0 !important;
}

.search-container.desktop-only .form-control.pcat-search-input {
    border: none !important;
    background: transparent !important;
    font-size: var(--fs-sm) !important;
    padding: 0.5rem 0.75rem !important;
    color: #212529 !important;
    height: 100% !important;
}

.search-container.desktop-only .form-control.pcat-search-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.search-container.desktop-only .form-control.pcat-search-input::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Desktop search - Hide icon on focus for cleaner UX */
.search-container.desktop-only .input-group.pcat-search-wrapper:focus-within .input-group-text.pcat-search-icon {
    display: none !important;
}

/* Algolia Autocomplete Dropdown - Constrain within mobile viewport */
.mobile-search-bar .pcat-search-component {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
}

.mobile-search-bar .pcat-search-form {
    width: 100% !important;
}

.mobile-search-bar .algolia-autocomplete {
    position: static !important; /* Flow naturally after input */
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    margin-top: 16px !important;
}

.mobile-search-bar .algolia-autocomplete .aa-dropdown-menu {
    position: static !important; /* No absolute positioning */
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    background: #ffffff !important;
    max-height: calc(100vh - 200px) !important; /* Leave room for header + search */
    max-height: calc(100dvh - 200px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
}

/* Safe area support for notched devices */
@supports (padding: max(0px)) {
    .mobile-search-bar .algolia-autocomplete .aa-dropdown-menu {
        max-height: calc(100dvh - 200px - env(safe-area-inset-bottom)) !important;
    }
}

.mobile-search-suggestions {
    width: 100%; margin-top: 20px;
}

.mobile-search-suggestions h3 {
    font-size: var(--fs-xs); font-weight: var(--weight-semibold); color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 12px 0;
}

.mobile-search-suggestions .suggestion-pills {
    display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0;
}

.mobile-search-suggestions .suggestion-pill {
    min-height: 44px; padding: 10px 16px; background: var(--color-background-muted); border-radius: 9999px;
    font-size: var(--fs-sm); color: var(--color-heading); text-decoration: none; transition: all 0.15s ease;
    display: inline-flex; align-items: center;
}

.mobile-search-suggestions .suggestion-pill:hover {
    background: var(--color-border); color: var(--color-heading);
}

.mobile-search-footer {
    margin-top: auto; background: var(--color-background); border-top: 1px solid var(--hdr-border);
    text-align: center; padding: 10px 16px;
}

.mobile-search-footer-text {
    margin: 0; font-size: var(--fs-xs); line-height: 1.4; color: var(--hdr-muted);
}

.mobile-search-footer-link {
    font-size: var(--fs-xs); font-weight: var(--weight-semibold); color: var(--color-info); text-decoration: none;
    border-radius: 9999px; padding: 2px 4px;
}

body.mobile-search-open { 
    overflow: hidden; touch-action: none;
}

/* Ensure mobile search components are visible */
.mobile-search-overlay .mobile-search-container,
.mobile-search-overlay .pcat-search-component,
.mobile-search-overlay .pcat-search-form,
.mobile-search-overlay .pcat-search-wrapper,
.mobile-search-overlay .pcat-search-input {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-search-overlay .pcat-search-wrapper {
    display: flex !important;
}

/* ===== Mobile Actions - Clean minimal style ===== */
/* Using Bootstrap utilities instead of custom CSS where possible */
.tap-44:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.tap-44:active {
    background-color: rgba(0, 0, 0, 0.08);
}

/* Remove Bootstrap navbar-toggler default styles */
.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

/* ===== Mobile header spacing adjustments ===== */
@media (max-width: 991.98px) {
    /* Ensure proper height on mobile */
    .header-inner-container {
        min-height: 60px; /* Comfortable mobile touch target height */
    }
    
    /* Remove any border/shadow on mobile for cleaner look */
    .site-header .navbar {
        border-bottom: none;
        box-shadow: none;
    }
    
    /* Remove container wrapper on mobile for Top Tours */
    /* Top tours inner container - mobile padding adjustment */
    .top-tours-inner-container {
        padding: 0 16px; /* Tighter mobile padding */
    }

    /* Allow slight logo shrink on very narrow screens */
    .site-header .site-logo,
    .site-header .navbar-brand {
        flex-shrink: 1;
        max-width: 45vw;
    }

    .site-header .navbar-brand .custom-logo-link img {
        width: clamp(120px, 38vw, 150px);
        height: auto;
    }

    /* Breathing room between mobile action buttons */
    .site-header .mobile-right {
        gap: 8px;
    }

    /* Respect device safe areas */
    .site-header .header-container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* Safe-area support for mobile search overlay */
.mobile-search-bar {
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

/* Respect reduced motion preferences */
@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;
    }
}

/* ===== Mobile Drilldown Menu - Typography System ===== */

/* Typography tokens for consistency */
:root {
    --menu-title-size: 16px;
    --menu-title-size-small: 15px;  /* For ≤360px screens */
    --menu-subtitle-size: 13px;
    --menu-header-size: 11px;
    --menu-metadata-size: 13px;
    
    --menu-title-weight: 600;  /* Semibold */
    --menu-subtitle-weight: 400;  /* Regular */
    --menu-header-weight: 600;
    
    --menu-title-color: #1f2937;  /* Strong contrast */
    --menu-subtitle-color: #6b7280;  /* Muted */
    --menu-header-color: #9ca3af;  /* More muted */
    --menu-metadata-color: #6b7280;
}

/* Row rhythm and tap targets */
#mobileMenu .menu > li > a,
#mobileSubsheet [data-subsheet-list] a,
#mobileMenu footer a {
    display: flex;
    align-items: center;
    padding: 12px;  /* Consistent 12px vertical rhythm */
    min-height: 48px;  /* Minimum tap target */
    border-radius: .5rem;
    transition: background-color 0.15s ease;
}

/* Primary row titles */
#mobileMenu .menu > li > a,
#mobileSubsheet [data-subsheet-list] a,
#mobileMenu footer section a > span.flex-grow-1,
#mobileMenu .hover-bg > .flex-grow-1 {
    font-size: var(--menu-title-size);
    font-weight: var(--menu-title-weight);
    line-height: 1.35;
    color: var(--menu-title-color);
}

/* Subtitles within rows */
#mobileMenu .text-muted.small,
#mobileMenu .hover-bg .text-muted.small {
    font-size: var(--menu-subtitle-size);
    font-weight: var(--menu-subtitle-weight);
    line-height: 1.35;
    color: var(--menu-subtitle-color);
    margin-top: 2px;  /* 2-4px gap from title */
}

/* Right-side metadata */
#mobileMenu .text-muted.small[dir="ltr"],
#mobileMenu .text-body-secondary.small {
    font-size: var(--menu-metadata-size);
    font-weight: var(--menu-subtitle-weight);
    color: var(--menu-metadata-color);
    align-self: center;  /* Align to title baseline */
}

/* Responsive adjustments for small screens */
@media (max-width: 360px) {
    #mobileMenu .menu > li > a,
    #mobileSubsheet [data-subsheet-list] a,
    #mobileMenu footer section a > span.flex-grow-1,
    #mobileMenu .hover-bg > .flex-grow-1 {
        font-size: var(--menu-title-size-small);
    }
}

/* Hover state - subtle background change */
#mobileMenu .menu > li > a:hover,
#mobileSubsheet [data-subsheet-list] a:hover,
#mobileMenu footer a:hover,
#mobileMenu .hover-bg:hover {
    background: rgba(0,0,0,.04);
}

/* Active/pressed state - optimized for performance */
#mobileMenu .menu > li > a:active,
#mobileSubsheet [data-subsheet-list] a:active,
#mobileMenu footer a:active,
#mobileMenu .hover-bg:active {
    background: rgba(0,0,0,.08);
    opacity: 0.95;  /* Lighter than transform for performance */
}

/* Focus-visible states for keyboard navigation */
#mobileMenu .menu > li > a:focus-visible,
#mobileSubsheet [data-subsheet-list] a:focus-visible,
#mobileMenu footer a:focus-visible,
#mobileMenu .hover-bg:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

/* Section headers - small, uppercase, low contrast */
#mobileMenu h3 {
    font-size: var(--menu-header-size);
    font-weight: var(--menu-header-weight);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--menu-header-color);
    margin-bottom: 12px;  /* Space before first row */
    margin-top: 0;
    line-height: 1;
}

/* Section spacing and dividers */
#mobileMenu section {
    padding-top: 16px;
    padding-bottom: 16px;
}

#mobileMenu section:first-child {
    padding-top: 8px;
}

#mobileMenu section + section {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#mobileMenu .border-bottom {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

/* Top picks media rows */
#mobileMenu .hover-bg {
    transition: background-color 0.15s ease;
}

/* Active item using Bootstrap variables */
#mobileMenu .menu > li.current-menu-item > a,
#mobileSubsheet [data-subsheet-list] li.current-menu-item > a {
    color: var(--bs-primary);
    font-weight: var(--weight-semibold);
    background-color: rgba(13,110,253,.08);
}

/* Scroll containment without double scrollbars */
#mobileMenu .offcanvas-body {
    position: relative;
    overflow: hidden;  /* Container does NOT scroll or bleed */
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Only the list content scrolls, not the header */
#mobileMenu .offcanvas-body > .flex-grow-1 {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
}

/* Sub-sheet slide animation - single source of truth */
.offcanvas-subsheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-background);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 250ms ease; /* 250ms max for iOS reliability */
    z-index: 10;  /* Above main menu content */
    overscroll-behavior: contain;  /* Prevent scroll chaining */
    pointer-events: none; /* Prevent taps when closed */
}

.offcanvas-subsheet.show {
    transform: translateX(0);
    pointer-events: auto; /* Enable taps when open */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .offcanvas-subsheet { 
        transition: transform 50ms ease; /* Very fast for reduced motion */
    }
}

/* Back control: always transparent, nice focus ring, easier tap target */
.subsheet-back {
    background: transparent !important;
    border: 0 !important;
    -webkit-tap-highlight-color: transparent;
    border-radius: .375rem;
    transition: opacity 0.15s ease;
}

.subsheet-back:hover {
    opacity: .75;
}

.subsheet-back:focus {
    box-shadow: none;
    outline: 0;
}

.subsheet-back:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* iOS Safari fixes for More trigger - ensure full row is tappable */
#mobileMenu [data-more-trigger] {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    z-index: 5; /* Above other menu items but below subsheet */
    display: flex !important; /* Ensure flex layout */
    width: 100% !important; /* Full width hit area */
    min-height: 44px; /* iOS minimum tap target */
}

/* Ensure More button is clickable on iOS */
#mobileMenu .more-trigger {
    touch-action: manipulation; /* Prevent double-tap zoom */
    pointer-events: auto !important; /* Force clickability */
}

/* Prevent SVGs from intercepting taps */
#mobileMenu [data-more-trigger] svg {
    pointer-events: none;
}

/* Parent indicator chevron - aligned to title baseline */
#mobileMenu .menu > li.menu-item-has-children > a::after {
    content: "";
    margin-left: auto;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12l7-7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    opacity: 0.7;
    align-self: center;  /* Align to row center/baseline */
    transition: transform 0.15s ease;
}

/* Subtle animation on hover */
#mobileMenu .menu > li.menu-item-has-children > a:hover::after {
    transform: translateX(2px);
    opacity: 1;
}

/* Disable animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
    #mobileMenu .menu > li.menu-item-has-children > a::after {
        transition: none;
    }
    
    #mobileMenu .menu > li.menu-item-has-children > a:hover::after {
        transform: none;
    }
}

/* One bar that works for both states - unified header styling with elevation */
#mobileMenu .offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    min-height: 56px;
    padding: 6px 16px;  /* 16px horizontal for better brand spacing */
    background: var(--color-background);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 0 rgba(0,0,0,.03);  /* Subtle elevation */
    padding-top: calc(6px + env(safe-area-inset-top));  /* Maintain safe area */
    z-index: 10;  /* Above content */
    position: relative;
}

/* Equal sizing for both header buttons - 44px consistent tap targets */
#mobileMenu .btn-close,
#mobileMenu .subsheet-back {
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin: 0;  /* Reset any default margins */
    vertical-align: middle;  /* Ensure same baseline */
}

/* Close button specific styling */
#mobileMenu .btn-close {
    width: 44px;
    min-width: 44px;
    opacity: 1;
    justify-content: center;
    border-radius: .5rem;
    background-position: center;
    background-size: 0.75rem;  /* 50% smaller X icon */
}

#mobileMenu .btn-close:focus {
    box-shadow: 0 0 0 3px rgba(13,110,253,.2);
}

/* Back button specific styling - now just icon */
#mobileMenu .subsheet-back {
    padding: 0 8px;  /* Horizontal padding */
    width: 44px;  /* Same as close button for symmetry */
}

#mobileMenu .subsheet-back svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;  /* Prevent icon from shrinking */
}

/* Subsheet title - same or slightly bigger than row titles */
#mobileMenu .subsheet-title {
    font-size: var(--fs-body);
    font-weight: var(--weight-semibold);
    color: var(--menu-title-color);
    text-align: center;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

/* Smooth header state transitions */
#mobileMenu .header-default,
#mobileMenu .header-subsheet {
    transition: opacity 0.15s ease;
}

/* Stronger backdrop for native sheet feel */
.offcanvas-backdrop.show {
    opacity: .5;
    background-color: rgba(0,0,0,.5);
}

/* Safe-area and device quirks - dynamic viewport support */
@supports(height: 100dvh) {
    #mobileMenu .offcanvas-body {
        min-height: 100dvh;
    }
}

.search-container.desktop-only .pcat-search-icon {
    display: none !important;
}

.search-container.desktop-only .pcat-search-wrapper {
    border-right: none !important;
}