/* GLOBAL RESET & HTML5 BASICS */
:root {
    --primary-blue: #001f3f;
    --accent-orange: #ff851b;
    --text-dark: #333;
    --bg-light: #f9f9f9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* MOBILE-FIRST HEADER & HERO */
header {
    background: var(--primary-blue);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

.hero h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.tagline { color: var(--accent-orange); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }

/* FLUID GRID FOR GALLERY */
.public-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column on mobile */
    gap: 1.5rem;
    padding: 1rem;
}

.car-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.car-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.car-card p { padding: 1rem; font-weight: bold; text-align: center; }

/* MOBILE-FIRST FORM */
.booking-section { background: #fff; padding: 2rem 1rem; }
.booking-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem; /* Prevents iOS zoom on focus */
}

button[type="submit"] {
    background: var(--accent-orange);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

/* DESKTOP ADJUSTMENTS */
@media (min-width: 768px) {
    .public-grid { grid-template-columns: repeat(3, 1fr); }
    .hero h1 { font-size: 3rem; }
    .container { max-width: 1100px; margin: 0 auto; }
}

/* RESTORE HERO IMAGE FOR MOBILE */
.hero-perspective {
    display: block;
    height: var(--hero-height-mobile);
    background-size: cover;
    background-position: center;
    /* Ensure this path points to your mobile image */
    background-image: url('https://tristatedriveaway.com/images/hero-desktop.png')!important; 
}

/* ==========================================
   MOBILE MENU TRIGGER (THE HAMBURGER)
   ========================================== */
@media screen and (max-width: 768px) {
    /* 1. Force the container to be visible and have a size */
    #hamburger.mobile-menu-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        cursor: pointer;
        z-index: 1100;
        margin-left: auto; /* Pushes it to the right */
    }

    /* 2. Force the bars to have height and color */
    #hamburger.mobile-menu-btn .bar {
        width: 100%;
        height: 3px;
        background-color: #f05a28 !important; /* Force Brand Orange */
        display: block !important;
        border-radius: 2px;
    }

    /* 3. Ensure the nav links hide until toggled */
    #mobile-nav-menu {
        display: none !important;
    }

    /* 4. When toggled 'active' by your script, show them */
    #mobile-nav-menu.active {
        display: flex !important;
        flex-direction: column !important;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }
}

/* MOBILE-ONLY RULES (Phones) */
@media (max-width: 768px) {
    /* Restore Hero Image Visibility */
    .hero-perspective {
        display: block;
        height: var(--hero-height-mobile);
        background-image: url('https://tristatedriveaway.com/images/hero-desktop.png')!important;
        background-size: cover;
        background-position: center;
    }

    .nav-flex {
        display: flex !important;
        justify-content: space-between !important; /* Logo LEFT, Menu RIGHT */
        align-items: center !important;
        position: relative; /* Added to anchor the absolute menu */
    }

    .mobile-menu-btn {
        display: flex !important; /* Show on phones */
        order: 1; /* Moves to the right of the logo */
    }

    .nav-flex nav {
        display: none; /* Hide links until hamburger is clicked */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px;
        left: 0;
        background: #fff;
        padding: 20px;
        z-index: 999;
    }

    .nav-flex nav.active {
        display: flex !important; /* Show when toggled */
    }
}

#mobile-nav-menu.active {
    display: flex !important;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #001e3d;
    transition: 0.3s;
}

@media screen and (max-width: 768px) {
    .mobile-menu-btn {
        display: flex; 
    }

    .nav-links {
        display: none; 
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px;
        left: 0;
        background-color: #ffffff;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }
}

/* FORCE HIDE DESKTOP LINKS ON MOBILE */
@media screen and (max-width: 768px) {
    .nav-flex nav:not(#mobile-nav-menu) {
        display: none;
    }
    
    /* Ensure the mobile-specific menu remains controlled by the toggle */
    #mobile-nav-menu {
        display: none; 
    }

    #mobile-nav-menu.active {
        display: flex;
    }
}

/* ==========================================
   FIX: SILENCE GHOST LINKS & FORCE TOGGLE
   ========================================== */
@media screen and (max-width: 768px) {
    /* This hides the desktop version of the nav specifically on mobile */
    .nav-flex nav:not(#mobile-nav-menu) {
        display: none;
    }

    /* This ensures the mobile menu stays hidden until the hamburger is clicked */
    #mobile-nav-menu {
        display: none;
    }

    /* This is what the JavaScript triggers */
    #mobile-nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        z-index: 999;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
}

/* ==========================================
   FINAL MOBILE NAV FIX
   ========================================== */
@media screen and (max-width: 768px) {
    /* 1. Force the menu to hide and stack vertically */
    #mobile-nav-menu {
        display: none; 
        flex-direction: column; /* Fixes the horizontal layout */
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 20px 0;
        z-index: 999;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    /* 2. Show the menu only when clicked */
    #mobile-nav-menu.active {
        display: flex;
    }

    /* 3. Style the links so they stack and center */
    #mobile-nav-menu a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 15px 0;
        margin: 0;
        border-bottom: 1px solid #eee;
        color: #001e3d; /* Navy */
        text-decoration: none;
        font-weight: bold;
    }
}

/* ==========================================
   FINAL HAMBURGER COLOR & LAYOUT FIX
   ========================================== */
@media screen and (max-width: 768px) {
    /* 1. Make the Hamburger Bars Orange for contrast */
    .bar {
        width: 25px;
        height: 3px;
        background-color: #f05a28; /* Your Brand Orange */
        display: block;
        transition: 0.3s;
    }

    /* 2. Fix the Mobile Menu Layout (Vertical Stack) */
    #mobile-nav-menu {
        display: none; /* Hidden until clicked */
        flex-direction: column; /* Forces links to stack vertically */
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #ffffff; /* White background for the open menu */
        padding: 20px 0;
        z-index: 999;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    /* 3. Show the menu when active */
    #mobile-nav-menu.active {
        display: flex;
    }

    /* 4. Style the links inside the menu */
    #mobile-nav-menu a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 15px 0;
        margin: 0;
        border-bottom: 1px solid #eee;
        color: #001e3d; /* Navy text for readability on white */
        text-decoration: none;
        font-weight: bold;
    }
}

/* ==========================================
   RECENT TRIPS MOBILE IMAGE FIX
   ========================================== */
@media screen and (max-width: 768px) {
    /* 1. Force the grid to a single column that fits the screen */
    .trips-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px;
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
    }

    /* 2. Ensure each card doesn't exceed the phone width */
    .trip-card {
        width: 100% !important;
        max-width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    /* 3. Make the images responsive so they shrink to fit the card */
    .trip-card img {
        width: 100% !important;
        height: auto !important; /* Maintains the aspect ratio so they don't look squashed */
        display: block;
        object-fit: cover;
    }
}

/* ==========================================
   AVAILABILITY PAGE STYLES
   ========================================== */
.date-row {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 5px solid #001e3d; /* Navy */
}

.status-badge {
    background: #f05a28; /* Orange */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 3px;
    margin-right: 15px;
}

.date-text {
    font-weight: bold;
    color: #333;
}

@media screen and (max-width: 768px) {
    .schedule-container h1 { font-size: 1.5rem; }
}

/* FORCE RESET FOR MOBILE MENU */
@media screen and (max-width: 768px) {
    /* 1. Hide the standard links by default */
    .nav-flex nav#mobile-nav-menu {
        display: none !important;
        flex-direction: column !important;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        z-index: 999;
    }

    /* 2. Show the links only when the 'active' class is triggered */
    .nav-flex nav#mobile-nav-menu.active {
        display: flex !important;
    }

    /* 3. Make the Hamburger Visible */
    #hamburger-trigger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
    }

    /* 4. Force the bars to be Orange and 3px thick */
    .line {
        width: 100%;
        height: 3px;
        background-color: #f05a28 !important;
        display: block !important;
    }
}

/* Ensure the button is hidden on Laptops */
@media screen and (min-width: 769px) {
    #hamburger-trigger {
        display: none !important;
    }
}

/* ==========================================
   TRI-STATE DRIVE AWAY WORKING LOGIC 
   Added: May 2026
   ========================================== */

@media screen and (max-width: 768px) {
    /* SYNCED: Target #hamburger specifically */
    #hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        cursor: pointer;
        z-index: 1100;
        margin-left: auto;
    }

    /* SYNCED: Target the .bar class from header.php */
    #hamburger .bar {
        width: 100%;
        height: 3px;
        background-color: #f05a28 !important; /* Force Brand Orange */
        display: block !important;
        border-radius: 2px;
    }

    /* Hide the mobile nav until toggled */
    #mobile-nav-menu {
        display: none !important; 
    }

    /* Show the mobile nav when active */
    #mobile-nav-menu.active {
        display: flex !important;
        flex-direction: column !important;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #ffffff;
        padding: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    /* Center and stack the links */
    #mobile-nav-menu a {
        display: block;
        padding: 15px;
        text-align: center;
        border-bottom: 1px solid #eee;
        color: #001e3d; /* Navy */
        font-weight: bold;
        text-decoration: none;
    }
}

/* ... [All 500 lines of your original mobile.css remain here] ... */

/* ==========================================
   FINAL OVERRIDE FOR OPENING THE MENU
   ========================================== */
@media screen and (max-width: 768px) {
    /* This rule ensures the menu actually appears when the JS clicks it */
    body #mobile-nav-menu.active {
        display: flex !important;
        flex-direction: column !important;
        position: absolute !important;
        top: 70px !important;
        left: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        z-index: 9999 !important;
        padding: 20px 0 !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
    }

    body #mobile-nav-menu.active a {
        display: block !important;
        padding: 15px !important;
        text-align: center !important;
        border-bottom: 1px solid #eee !important;
        color: #001e3d !important;
    }
}