/**
 * Header Styles - Bootstrap 5.3.3 Navbar Overrides
 * Uses design system tokens from tokens.css
 * Minimal custom CSS following Bootstrap patterns
 *
 * @package TravelerChildTheme
 */

/* ===============================================
   HEADER-SPECIFIC TOKENS - Extends design system
   =============================================== */
:root {
    /* Accessibility-enhanced colors (WCAG AA+) */
    --text-secondary: var(--color-muted, #495057);  /* 7.02:1 on white */
    --text-success: #146c43;   /* 6.45:1 on white (darker than --color-success) */
    --focus-ring: #3c72dc;     /* Primary blue for focus */
    --bg-hover-muted: var(--color-background-light, #f8f9fa); /* Light gray hover */

    /* Badge colors - friendlier green */
    --badge-success-bg: #16a34a; /* Emerald-600 - vibrant, friendly */
    --badge-success-hover: #15803d; /* Emerald-700 for hover */

    /* Premium header sizing - compact, refined */
    --fs-nav: 15px; /* Compact nav size for premium feel */
}

/* ===============================================
   OFFCANVAS SCROLL COMPENSATION
   Prevent layout shift when mobile menu opens
   Bootstrap offcanvas removes scrollbar, causing content jump.
   scrollbar-gutter: stable reserves space for scrollbar always.
   =============================================== */
html {
    scrollbar-gutter: stable;
}

/* Fallback for browsers without scrollbar-gutter support */
@supports not (scrollbar-gutter: stable) {
    html {
        overflow-y: scroll; /* Always show scrollbar */
    }
}

/* Compensate sticky header when offcanvas is open */
body.modal-open .sticky-top,
body:has(.offcanvas.show) .sticky-top {
    /* Bootstrap adds padding-right to body, but sticky elements need it too */
    padding-right: inherit;
}

/* ===============================================
   ACCESSIBILITY - Screen Reader Only Text
   =============================================== */
/* Bootstrap visually-hidden equivalent for compatibility */
.pcat-sr-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ===============================================
   FOCUS SYSTEM - WCAG 2.1 AAA Focus Visible (Unified)
   =============================================== */
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
.nav-link:focus-visible,
.mobile-menu-link:focus-visible {
    outline: 3px solid var(--focus-ring, #3c72dc) !important; /* Thicker = WCAG AAA */
    outline-offset: 2px; /* Consistent OUTSIDE offset */
    border-radius: 4px;
}

/* Special case: Cart icon needs larger offset to clear badge */
.site-header .cart-contents:focus-visible {
    outline: 3px solid var(--focus-ring, #3c72dc) !important;
    outline-offset: 3px; /* Larger offset to clear badge position */
    border-radius: 8px; /* Rounder for icon shape */
}

/* Prevent SVG from receiving focus */
svg[aria-hidden="true"] {
    focusable: false;
    pointer-events: none;
}

/* ===============================================
   STICKY HEADER WRAPPER - Unified Navigation
   Includes navbar + top tours bar for cohesive UX
   =============================================== */
.header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1030; /* Bootstrap sticky z-index */
    background-color: #fff;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    will-change: transform;
}

/* Auto-hide on scroll down (unified behavior for navbar + top tours) */
.header-wrapper.is-hidden {
    transform: translateY(-100%);
}

/* Shadow when scrolled */
.header-wrapper.is-scrolled {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* Accessibility - respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .header-wrapper {
        transition: box-shadow 0.3s ease; /* Keep shadow, remove transform transition */
    }
    .header-wrapper.is-hidden {
        display: none; /* Instant hide instead of animated */
    }
}

/* Force hide desktop menu on mobile to prevent submenu display bug */
@media (max-width: 991.98px) {
    #navbarSupportedContent {
        display: none !important;
    }
}

/* ===============================================
   NAVBAR CUSTOMIZATION - Premium Compact Style
   =============================================== */
nav.navbar {
    color: rgba(222, 222, 222, 1);
}

.site-header .navbar {
    padding-top: 0.75rem; /* 12px - Bootstrap spacer-3 equivalent (8px grid) */
    padding-bottom: 0.5rem; /* 8px - Bootstrap spacer-2 (breathing room) */
    border-bottom: 1px solid var(--color-border, #e5e7eb); /* 1px bottom border */
    margin-bottom: 0 !important;
    min-height: 60px; /* Consistent navbar height - prevents layout shift */
}

/* Add subtle border on scroll for hierarchy */
.header-wrapper.is-scrolled .site-header .navbar {
    border-bottom-color: var(--color-border, #e5e7eb);
}

/* Ensure all navbar direct children align vertically */
.site-header .navbar > .container {
    display: flex;
    align-items: center; /* Bootstrap align-items-center utility */
    min-height: 60px; /* Prevents layout shift - matches navbar min-height */
}

/* Ensure navbar-collapse also centers vertically */
.site-header .navbar-collapse {
    align-items: center;
}

/* Remove bottom margin from nav menu (Bootstrap override for pixel-perfect) */
.site-header .navbar-nav {
    margin-bottom: 0 !important;
}

/* Brand logo sizing - desktop (larger for brand prominence) */
.site-header .navbar-brand img {
    max-height: 50px; /* Increased for better brand presence */
    width: auto;
    height: auto;
}

/* Mobile logo - smaller for space efficiency */
@media (max-width: 991px) {
    .navbar-brand img {
        max-height: 40px; /* Slightly smaller on mobile */
    }
}

/* Align header & top tours to same content width */
.site-header .container,
.top-tours-bar .container {
    max-width: 1226px !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Override parent theme container overrides */
@media (min-width: 768px) {
    .site-header .container,
    .top-tours-bar .container {
        max-width: 1226px !important;
        padding: 0 1rem !important; /* Override parent theme padding: 0 20px */
    }
}

/* Primary nav typography - premium compact sizing */
.site-header .navbar-nav {
    gap: 0.25rem; /* Controlled spacing between items */
    align-items: center;
}

.site-header .navbar-nav .nav-link {
    font-size: var(--fs-nav, 15px); /* Compact 15px for premium feel */
    font-weight: var(--weight-medium, 500);
    font-family: var(--font-body);
    /* letter-spacing removed - modern fonts (Inter) are already optically balanced */
    padding: 0.35rem 0; /* Minimal vertical padding */
    line-height: 1.2;
    color: var(--color-heading, #111827) !important;
}

/* Navbar link hover state */
.site-header .navbar-nav .nav-link:hover,
.site-header .navbar-nav .nav-link:focus {
    color: var(--color-primary, #324fbe) !important;
}

/* Active/current page link */
.site-header .navbar-nav .nav-link.active,
.site-header .navbar-nav .nav-link[aria-current="page"] {
    color: var(--color-primary, #324fbe) !important;
}

/* Dropdown menu styling */
.navbar-nav .dropdown-menu {
    min-width: 200px;
    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);
}

/* Action icons cluster - refined spacing and sizing */
.site-header .d-lg-flex.align-items-center.gap-2.ms-3 {
    gap: 0.875rem; /* Slightly roomier than default */
}

/* Unified icon sizing - calm, premium appearance */
.site-header .btn-link svg,
.site-header .cart-contents svg {
    width: 18px;
    height: 18px;
}

/* Fix for parent theme aggressive .btn styling */
.site-header .btn-link,
.site-header .cart-contents.btn-link,
.site-header button[data-bs-toggle="offcanvas"].btn-link {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.5rem !important;
    color: var(--bs-secondary-color, #6c757d) !important;
}

.site-header .btn-link:hover,
.site-header .cart-contents.btn-link:hover,
.site-header button[data-bs-toggle="offcanvas"].btn-link:hover {
    background: transparent !important;
    color: var(--bs-body-color, #212529) !important;
}

/* Hamburger menu icon - ensure visibility */
.site-header .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.1) !important;
    padding: 0.5rem !important;
}

.site-header .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(50, 79, 190, 0.25) !important;
}

.site-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23111827' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    width: 1.25rem;
    height: 1.25rem;
}

/* Fix for top tours scroll chevron buttons */
#topToursScrollLeft.btn-light,
#topToursScrollRight.btn-light {
    background: #f8f9fa !important; /* Bootstrap .btn-light color */
    color: #212529 !important;
    border: 1px solid rgba(0,0,0,0.125) !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;
    padding: 0 !important; /* Respect inline padding: 0 */
}

#topToursScrollLeft.btn-light:hover,
#topToursScrollRight.btn-light:hover {
    background: #e2e6ea !important; /* Bootstrap .btn-light hover */
    color: #212529 !important;
    transform: translateY(-50%) scale(1.05) !important;
}

#topToursScrollLeft.btn-light:active,
#topToursScrollRight.btn-light:active {
    background: #dae0e5 !important; /* Bootstrap .btn-light active */
    transform: translateY(-50%) scale(0.95) !important;
}

/* ===============================================
   CART BADGE POSITIONING & URGENCY
   =============================================== */
.site-header .cart-contents {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Cart icon - override parent theme link colors */
.site-header .cart-contents {
    color: var(--bs-secondary-color, #6c757d) !important; /* Gray, not blue */
    text-decoration: none !important;
}

.site-header .cart-contents:hover {
    color: var(--bs-body-color, #212529) !important; /* Darker gray on hover */
}

.site-header .cart-contents svg {
    color: currentColor; /* Inherit from parent */
    fill: currentColor;
}

/* Cart count overlay - neat pill (works with .cart-count or .badge) */
.site-header .cart-contents .cart-count,
.site-header .cart-contents .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 21px;
    text-align: center;
    background: #dc3545 !important; /* Bootstrap danger red for cart badge */
    color: #fff !important;
    font-weight: var(--weight-semibold, 600);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
    border: 2px solid #fff;
}

/* Pulse animation removed - cleaner, less distracting UX */
.site-header .cart-contents .has-items {
    /* Animation disabled */
}

/* Keyframes kept for reference but not used */
/* @keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
} */

/* ===============================================
   TOP TOURS BAR - Integrated into Header Wrapper
   Part of unified sticky navigation system
   =============================================== */
.top-tours-bar {
    position: relative; /* Changed from sticky - parent handles positioning */
    background-color: #fff;
    border-top: none !important; /* No divider - unified with navbar */
    border-bottom: 1px solid rgba(0,0,0,0.08) !important; /* Bottom border for entire header unit */
    width: 100%; /* Full width within header-wrapper */
    padding-top: 0 !important; /* No gap above top tours */
    margin-top: 0 !important; /* No margin above top tours */
}

/* No separate visibility control - parent .header-wrapper handles auto-hide */

/* Top Tours uses Bootstrap .container for perfect alignment with navbar */
/* No custom container needed - Bootstrap handles responsive widths */

/* Scroll affordance - gradient fade hints at more content */
.top-tours-bar .container::after {
    content: "";
    position: absolute;
    top: 0;
    right: 1rem; /* Account for container padding */
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Show fade when content overflows */
.top-tours-bar .container.has-overflow::after {
    opacity: 1;
}

/* Top Tours typography - premium compact pills */
.top-tours-bar {
    border-bottom: 1px solid var(--color-border, #e5e7eb) !important;
}

/* Remove default nav padding to align with logo */
#topToursNav {
    padding-left: 0;
    padding-right: 0;
    margin-left: -0.5rem; /* Bootstrap negative margin: optical alignment (-8px) */
}

#topToursNav .nav-link {
    position: relative; /* CRITICAL FIX: Create positioning context for tooltips */
    display: flex; /* Ensure flex layout for alignment */
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-sm, 14px); /* Bumped from 12px for better readability */
    font-weight: var(--weight-medium, 500);
    font-family: var(--font-body);
    line-height: 1.2;
    /* letter-spacing removed - improves accessibility for dyslexic users */
    border-radius: 999px; /* Perfect pill */
    padding: 0.375rem 0.75rem; /* Tighter padding - was 0.5rem 1rem */
    transition: background-color 0.15s ease, color 0.15s ease;
    border: 1px solid transparent;
    min-height: 44px; /* Accessibility: Touch target minimum */
}

/* ========================================
   PREMIUM TOP TOURS - Monochrome SVG Icons
   Consistent iconography for trust & professionalism
   ======================================== */

/* Section heading - using design system tokens */
.top-tours-heading {
    font-size: var(--fs-sm); /* 14px from tokens.css */
    font-weight: var(--weight-medium, 500); /* Medium weight from tokens.css */
    color: #4f4f4f; /* Darker gray */
    margin-right: 1rem;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent heading from wrapping */
}

/* Hide heading on mobile to declutter */
@media (max-width: 991.98px) {
    .top-tours-heading {
        display: none;
    }
}

/* Nav chip pattern - inline-flex for tight alignment */
.nav-chip {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem; /* 8px between icon and label */
    white-space: nowrap; /* Prevent text wrapping */
    flex-shrink: 0; /* Prevent pill from shrinking */
}

/* Icon box - fixed 20x20px for consistent alignment */
.nav-chip .icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--color-muted, #6b7280); /* Neutral gray default */
    transition: color 0.15s ease;
    vertical-align: middle; /* Align with text baseline */
    margin-top: -2px; /* Optical adjustment to center with text */
}

/* SVG sizing - Lucide standard 1.5px stroke */
.nav-chip .icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.5px;
}

/* Label typography - using design system tokens */
.nav-chip .label {
    font-size: var(--fs-sm); /* 14px from tokens.css */
    font-weight: var(--weight-medium, 500); /* Medium weight from tokens.css */
    color: #4f4f4f; /* Darker gray */
    transition: color 0.15s ease, text-decoration 0.15s ease;
    white-space: nowrap; /* Prevent label text wrapping */
}

/* Ensure all spans in align-items-center follow design system */
.top-tours-bar .align-items-center span {
    color: #4f4f4f;
    font-size: var(--fs-sm); /* 14px */
    font-weight: var(--weight-medium, 500);
}

/* Hover state - brand blue with underline for accessibility */
#topToursNav .nav-link:hover {
    background-color: var(--bg-hover-muted, #f8f9fa);
    transform: translateY(-1px);
}

#topToursNav .nav-link:hover .icon {
    color: var(--color-primary, #324fbe); /* Icon turns brand blue */
}

#topToursNav .nav-link:hover .label {
    color: var(--color-primary, #324fbe); /* Label turns brand blue */
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Active state */
#topToursNav .nav-link:active {
    transform: translateY(0);
}

/* Active/current page state - removed for cleaner appearance */
/* Pills remain neutral, only hover state provides feedback */

#topToursNav .text-success {
    white-space: nowrap;
}

/* Hide pricing - reduces price anchoring friction */
.top-tours-bar .price {
    display: none !important;
}

/* Optional hover-reveal pattern (commented out - use only if A/B testing shows benefit)
@media (min-width: 1200px) {
    .top-tours-bar a:hover .price,
    .top-tours-bar a:focus-visible .price {
        display: inline-flex !important;
    }
}
*/

/* Top tours label and content styling */
#topToursNav .nav-item span {
    font-size: var(--fs-sm); /* 14px from design system - consistent with pills */
    font-weight: var(--weight-medium, 500);
}

/* Top tours label (not clickable) - no hover effect */
.nav-item.nav-label-item {
    pointer-events: none;
}

/* Bestseller badge - friendly green with white text (WCAG AA compliant) */
#topToursNav .badge.bg-success {
    background-color: var(--badge-success-bg, #16a34a) !important; /* Emerald-600 - friendly, vibrant green */
    color: #ffffff !important; /* Pure white text for maximum contrast (4.5:1) */
    font-weight: var(--weight-semibold, 600); /* Design system weight */
    font-size: 10px; /* Compact for pill */
    padding: 2px 8px;
    letter-spacing: 0.02em; /* Slight spacing for uppercase readability */
    border-radius: var(--radius-round, 50%); /* Pill shape using design token */
}

/* Hover state for badges inside links */
#topToursNav .nav-link:hover .badge.bg-success {
    background-color: var(--badge-success-hover, #15803d) !important; /* Darker emerald-700 on hover */
}

/* ===============================================
   NAVBAR SEARCH - Simplified Bootstrap Pattern
   Following Bootstrap 5.3.3 input-group in navbar (docs line 238-242)
   =============================================== */

/* Outer wrapper - constrains max width */
.pca-search-wrapper-nav {
    max-width: 365px;
}

/* Let nested containers expand naturally */
.pca-search-wrapper-nav .pcat-search-component,
.pca-search-wrapper-nav .pcat-search-form {
    width: 100%;
    margin-left: 10px; /* Breathing room between logo and search field */
}

/* Style the input-group directly (the actual visible field) */
.pca-search-wrapper-nav .input-group {
    background: #ffffff !important;
    border: 1px solid #6b6c70 !important; /* Darker border, no shadow */
    border-radius: 0.5rem !important;
    height: 42px !important;
    padding: 2px !important; /* Inner padding */
    overflow: visible !important;
    transition: all 0.2s ease !important;
}

/* Icon - transparent (Bootstrap input-group-text pattern) */
.pca-search-wrapper-nav .input-group-text {
    border: none !important;
    background: transparent !important;
    padding: 0 8px 0 12px !important;
    position: static !important; /* Override pca-search.css absolute positioning */
    transform: none !important;
    left: auto !important;
    top: auto !important;
}

/* Input - transparent (Bootstrap form-control pattern) */
.pca-search-wrapper-nav .form-control {
    border: none !important;
    background: transparent !important;
    padding: 0 16px 0 4px !important; /* Tighter left padding (4px from icon) */
    font-size: 15px !important;
    height: 100% !important;
    box-shadow: none !important;
}

/* Hover state */
.pca-search-wrapper-nav .input-group:hover {
    border-color: var(--color-primary, #324fbe) !important;
}

/* Focus state - WCAG 2.1 AA */
.pca-search-wrapper-nav .input-group:focus-within {
    border-color: var(--color-primary, #324fbe) !important;
    outline: 3px solid rgba(50, 79, 190, 0.4) !important;
    outline-offset: 2px;
}

/* Icon personality - rose heart */
.pca-search-wrapper-nav svg path:first-child {
    fill: #f43f5e !important;
    opacity: 0.9;
}

.pca-search-wrapper-nav svg path:last-child {
    fill: currentColor;
}

/* Focus: unify icon colors */
.pca-search-wrapper-nav .input-group:focus-within svg path {
    fill: var(--color-primary, #324fbe) !important;
    opacity: 1;
}

/* Icon size */
.pca-search-wrapper-nav svg {
    width: 18px !important;
    height: 18px !important;
}

/* ===============================================
   AUTOCOMPLETE DROPDOWN - Desktop Search
   =============================================== */

/* Ensure input-group has positioning context for dropdown */
.pca-search-wrapper-nav .input-group.pcat-search-wrapper {
    position: relative !important; /* Create positioning context for autocomplete */
}

/* Dropdown - Force correct width and positioning */
.pca-autocomplete-results,
[id^="pca-search-results"] {
    width: 365px !important; /* Force exact width */
    max-width: 365px !important; /* Override inline max-width: 600px */
}

/* Desktop search autocomplete - position relative to input-group */
.pca-search-wrapper-nav .pca-autocomplete-results,
.pca-search-component .pca-autocomplete-results {
    position: absolute !important; /* Override JS position: fixed */
    top: calc(100% + 4px) !important; /* Override inline top value */
    left: 0 !important; /* Override inline left value - align with input-group */
    width: 365px !important;
    max-width: 365px !important;
    border: 1.5px solid #6b6c70 !important; /* Match search field border */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important; /* Visible shadow */
    z-index: 1060 !important; /* Above navbar/top-tours */
}

/* Hide when empty */
.pca-autocomplete-results:empty,
.pca-autocomplete-results:not(:has(*)) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ===============================================
   RESPONSIVE BREAKPOINTS - Desktop Search
   =============================================== */
/* Hide desktop search earlier to prevent cramping (1200px instead of 992px) */
@media (max-width: 1199px) {
    .pca-search-wrapper-nav {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .pca-search-wrapper-nav {
        display: flex !important;
    }
}

/* Show mobile search toggle from 992px-1199px (tablet range) */
@media (min-width: 992px) and (max-width: 1199px) {
    .header-mobile-search-toggle {
        display: flex !important;
    }
}

/* ========================================
   PHASE 3: Responsive Refinement - Prevent Crowding
   ======================================== */

/* Consistent sizing across all desktop sizes */
@media (min-width: 1200px) {
    .pca-search-wrapper-nav {
        max-width: 365px !important;
    }
}

/* ===============================================
   OFFCANVAS - Search and Mobile Menu
   =============================================== */
/* Fix z-index stacking - offcanvas above backdrop */
#searchDialog.offcanvas,
#mobileMenu.offcanvas {
    z-index: 1056 !important; /* Above backdrop (1055) */
}

.offcanvas-backdrop,
.modal-backdrop {
    z-index: 1055 !important; /* Below offcanvas content */
}

/* Note: Mobile menu uses data-bs-backdrop="false" so no backdrop is created */

/* Mobile menu header - clean white background */
#mobileMenu .offcanvas-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

/* Close button - dark gray, smaller, no shadow */
#mobileMenu .offcanvas-header .btn-close {
    width: 1.25rem; /* Slightly larger for visibility */
    height: 1.25rem;
    background-size: 1rem; /* Visible X icon */
    background-color: transparent !important;
    opacity: 0.7;
    box-shadow: none !important;
    filter: none; /* Remove filter - use default dark color */
}

#mobileMenu .offcanvas-header .btn-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* ===============================================
   MOBILE MENU - CONVERSION-OPTIMIZED UX
   Custom classes for mobile-menu-simple.php
   =============================================== */

/* --- MOBILE MENU FOOTER - Sticky to bottom with subtle green highlight --- */
.mobile-menu-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.25rem;
    background-color: #d1fae5; /* Light green - Bootstrap success-subtle equivalent */
    border-top: 1px solid #10b981; /* Green border for definition */
    z-index: 10;
}

.mobile-menu-footer-text {
    margin: 0 !important;
    margin-block-end: 0 !important; /* Override Elementor */
    text-align: center;
    font-size: var(--fs-xs, 12px) !important; /* Override parent theme 16px !important */
    color: #059669 !important; /* Bootstrap success-dark green */
    line-height: 1.4;
    font-weight: var(--weight-medium, 500) !important; /* Medium weight for emphasis */
}

/* --- NAVIGATION STRUCTURE --- */
.mobile-menu-nav {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Section labels - visual hierarchy */
.mobile-menu-section-label {
    padding: 1rem 1rem 0.5rem 1rem; /* 16px sides, 16px top, 8px bottom */
    margin-top: 0.75rem; /* 12px between sections */
    list-style: none;
}

.mobile-menu-section-label:first-child {
    margin-top: 0.5rem; /* Less space for first section */
}

.mobile-menu-section-label span {
    display: block;
    font-size: var(--fs-xs, 12px);
    font-weight: var(--weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted, #6b7280);
}

/* --- MENU LINKS - Conversion-optimized with parity --- */
.mobile-menu-link {
    display: flex !important;
    align-items: center;
    gap: 0.875rem; /* 14px between icon and text */
    padding: 0.875rem 1rem !important; /* 14px 16px - comfortable tap targets */
    min-height: 52px; /* Generous touch target */

    font-size: var(--fs-body, 16px) !important; /* Override parent theme */
    font-weight: var(--weight-regular, 400) !important; /* Consistent weight */
    font-family: var(--font-body);
    line-height: 1.5;
    color: var(--color-heading, #111827) !important; /* Dark gray, not blue */
    text-decoration: none !important;

    border-radius: 0; /* Flat for mobile menu feel */
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Ensure all text spans have consistent sizing */
.mobile-menu-link span {
    font-size: var(--fs-body, 16px) !important;
    font-weight: var(--weight-regular, 400) !important;
}

/* Primary CTA link - Tours & Excursions - bold for emphasis */
.mobile-menu-link-primary span {
    font-weight: var(--weight-bold, 700) !important;
}

.mobile-menu-link:hover,
.mobile-menu-link:focus-visible {
    background-color: var(--color-background-muted, #f3f4f6);
    color: var(--color-heading, #111827) !important;
}

.mobile-menu-link:active {
    background-color: var(--color-background-light, #f8f9fa);
}

/* Override parent theme link colors aggressively */
.offcanvas-body .mobile-menu-link {
    color: var(--color-heading, #111827) !important;
}

.offcanvas-body .mobile-menu-link:visited {
    color: var(--color-heading, #111827) !important;
}

/* --- ICON SYSTEM - Color-coded for clarity with perfect parity --- */
.mobile-menu-icon {
    flex-shrink: 0;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    min-height: 20px;
    fill: currentColor;
}

/* Fix for icons with viewBox="0 0 16 16" - force consistent visual size */
.mobile-menu-icon[viewBox="0 0 16 16"] {
    transform: scale(1.25); /* Scale up 16px viewBox to match 20px viewBox icons */
    transform-origin: center;
}

/* Primary actions (Browse tours) - Brand blue */
.mobile-menu-icon-primary {
    color: var(--color-primary, #324fbe);
}

/* Contact actions (WhatsApp, Phone) - Success green */
.mobile-menu-icon-success {
    color: var(--color-success, #10b981);
}

/* Secondary actions (Help, Cart) - Muted gray */
.mobile-menu-icon-secondary {
    color: var(--color-muted, #6b7280);
}

/* Icons inherit link hover state */
.mobile-menu-link:hover .mobile-menu-icon-primary {
    color: var(--color-primary-hover, #2a42a1);
}

.mobile-menu-link:hover .mobile-menu-icon-success {
    color: var(--color-success-dark, #059669);
}

.mobile-menu-link:hover .mobile-menu-icon-secondary {
    color: var(--color-heading, #111827);
}

/* --- CONTACT LINKS - Enhanced prominence --- */
.mobile-menu-link-contact {
    background-color: rgba(16, 185, 129, 0.05); /* Subtle success tint */
    margin: 0 0.5rem; /* Inset from edges */
    border-radius: var(--radius-md, 6px) !important;
}

.mobile-menu-link-contact:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

/* --- BADGES & LABELS --- */
.mobile-menu-badge {
    margin-left: auto;
    padding: 0.25rem 0.625rem; /* 4px 10px */
    font-size: var(--fs-xs, 12px);
    font-weight: var(--weight-semibold, 600);
    color: #ffffff;
    background-color: var(--color-success, #10b981);
    border-radius: var(--radius-round, 50%); /* Pill shape */
    white-space: nowrap;
}

.mobile-menu-phone {
    margin-left: auto;
    font-size: var(--fs-sm, 14px);
    color: var(--color-muted, #6b7280);
    white-space: nowrap;
}

/* --- CART BADGE (reuse existing) --- */
.mobile-menu-link .badge.bg-danger {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 0.375rem;
    font-size: 11px;
    line-height: 22px;
    text-align: center;
    border-radius: var(--radius-round, 50%);
}

/* --- RESPONSIVE OPTIMIZATIONS --- */
@media (max-width: 375px) {
    /* Smaller phones - tighter spacing */
    .mobile-menu-cta-section {
        padding: 1rem;
    }

    .mobile-menu-link {
        padding: 0.75rem 0.875rem !important;
        gap: 0.75rem;
    }

    .mobile-menu-phone {
        font-size: var(--fs-xs, 12px);
    }
}

@media (min-width: 768px) {
    /* Tablets in portrait - don't show mobile menu */
    #mobileMenu {
        display: none;
    }
}

/* --- ACCESSIBILITY ENHANCEMENTS --- */
/* Focus states unified at top of file (lines 30-45) */

.mobile-menu-cta-button:focus-visible {
    outline: 3px solid #ffffff !important; /* Updated to 3px for consistency */
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-link,
    .mobile-menu-cta-button {
        transition: none;
    }
}

/* Legacy offcanvas styles (kept for search overlay) */
.offcanvas-body .nav-link {
    min-height: 48px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.offcanvas-body .nav-link:hover {
    background-color: #f3f4f6;
}

.offcanvas-body .nav-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* ===============================================
   RESPONSIVE ADJUSTMENTS
   =============================================== */
@media (max-width: 991px) {
    .navbar {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .navbar-brand img {
        max-height: 36px; /* Smaller on mobile */
    }
}

/* Mobile adjustments for body scroll - Account for unified header height */
body {
    scroll-padding-top: 120px; /* Account for navbar (60px) + top tours (44px) + padding */
}

@media (max-width: 991px) {
    body {
        scroll-padding-top: 104px; /* Mobile: navbar (60px) + top tours (44px) */
    }
}

/* ===============================================
   SMOOTH SCROLL
   =============================================== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ===============================================
   ACCESSIBILITY UTILITIES
   =============================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link - visible only on focus (WCAG 2.1 AA) */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.visually-hidden-focusable:focus {
    position: fixed !important;
    top: 10px;
    left: 10px;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    color: #000;
    border: 2px solid #0d6efd;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Trust signal hover effect */
.hover-primary:hover {
    color: var(--bs-primary) !important;
}

/* Improved contrast for success text (pricing) */
.text-success {
    color: var(--text-success, #146c43) !important;
}

/* Secondary text with better contrast */
.text-secondary {
    color: var(--text-secondary, #495057) !important;
}

/* ===============================================
   LEGACY SUPPORT (Can be removed after testing)
   =============================================== */
/* Minimal tap target utility */
.tap-44 {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icon sizing */
.icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}
