/* --- Global Styles & Variables --- */
:root {
    --color-black: #0a0a0a;
    --color-white: #ffffff;
    --color-grey-dark: #333333;
    --color-grey-medium: #666666;
    --color-grey-light: #cccccc;
    --color-grey-bg: #f4f4f4; /* Light grey for subtle background contrast if needed */
    --font-primary: 'Lato', sans-serif;
    --font-headings: 'Oswald', sans-serif;
    --header-height: 70px; /* Define header height for scroll padding */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    /* *** Added scroll-padding-top to account for fixed header */
    scroll-padding-top: var(--header-height);
    font-size: 100%; /* Base font size for rem calculations */
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-black);
    color: var(--color-white);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-headings);
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--color-white);
    font-weight: 700;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; text-align: center; margin-bottom: 2rem; }
h3 { font-size: 1.5rem; color: var(--color-grey-light); font-weight: 400;}

p {
    margin-bottom: 1rem;
    color: var(--color-grey-light);
}

a {
    color: var(--color-white);
    text-decoration: none;
    /* transition: color 0.3s ease; */
}

a:hover {
    color: var(--color-grey-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Prevents bottom space under images */
}

section {
    padding: 60px 0;
}

/* Hamburger Menu Button (hidden by default for larger screens) */
.menu-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    position: absolute;
    right: 20px;
    top: 15px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-white);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.menu-open .bar1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-open .bar2 {
    opacity: 0;
}

.menu-open .bar3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* --- Header & Navigation --- */
.main-header {
    background-color: rgba(0, 0, 0, 0.9); /* Slightly less transparent */
    padding: 10px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--color-grey-dark);
    height: var(--header-height);
    display: flex; /* Center content vertically */
    align-items: center;
    transition: all 0.3s ease; /* Smooth transition for mobile menu slide */
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Ensure container takes full width */
}

.logo {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.logo-image {
    height: 52px;
    width: auto;
    margin-right: 30px;
}

.logo a {
    font-family: var(--font-headings);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-white);
}

.main-nav {
    transition: all 0.3s ease; /* For smooth mobile menu transition */
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: border-bottom 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active { /* Add 'active' class via JS if needed */
    border-bottom: 2px solid var(--color-white);
}

/* --- Hero Section --- */
.hero-section {
    /* Updated to use car.png as background */
    background: url('images/car.png') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 90vh; /* Use min-height for flexibility */
    padding-top: var(--header-height); /* Account for fixed header */
    color: var(--color-white);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 24%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px; /* Limit content width */
    margin: 0 auto; /* Center content */
    padding: 40px 20px; /* Add some padding */
    /* Removed fixed height and inline background */
}

/* Company name banner styling */
.company-name-banner {
    background: rgba(10, 10, 10, 0.85); /* Slightly more opaque */
    border: 1px solid var(--color-grey-medium);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: inline-block;
    margin-bottom: 25px; /* Increased margin */
    position: relative;
    overflow: hidden; /* Keep overflow hidden */
    max-width: 100%; /* Allow banner to scale */
}

.banner-car-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-position: center;
    background-size: cover;
    opacity: 0.25; /* Adjusted opacity */
    z-index: 0;
    filter: grayscale(90%); /* Adjusted filter */
}

.company-name-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px; /* Thinner line */
    background: linear-gradient(to right, var(--color-grey-dark), var(--color-grey-light), var(--color-grey-dark));
    z-index: 1;
}

.company-name-banner h1 {
    font-size: clamp(2.5rem, 6vw, 4rem); /* Responsive font size */
    margin-bottom: 0;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.9); /* Stronger shadow */
    letter-spacing: 1.5px;
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 400;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    margin: 0;
}
.hero-content p {
     text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    /* transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease; */
    text-align: center;
}

.btn:active {
    transform: translateY(1px); /* Add subtle click effect */
}

.btn-primary {
    background-color: var(--color-white);
    color: var(--color-black);
    border: 2px solid var(--color-white);
    margin-right: 15px;
    margin-bottom: 15px;
}

.btn-primary:hover {
    background-color: #ef0808;
    color: var(--color-white);
}

.btn-primary-2 {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
    margin-right: 15px;
}

.btn-primary-2:hover {
    border: 2px solid var(--color-grey-light);
}

/* --- Value Proposition Section --- */
.value-prop-section {
    background-color: var(--color-grey-dark);
}
.value-items {
    display: grid;
    /* Responsive grid columns */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    text-align: center;
}
.value-item .icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem auto; /* Center icon */
    /* *** Adjusted filter - test with real icons */
    filter: brightness(1.5);
}

/* --- Services Section --- */
.services-section {
    background-color: var(--color-black);
}
/* Grid for better alignment */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.service-item {
    margin-bottom: 1rem; /* Reduced margin as gap handles spacing */
    text-align: center;
    background-color: var(--color-grey-dark); /* Add subtle background */
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--color-grey-medium);
}

/* Service icons styling */
.service-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem auto;
    filter: brightness(1.5);
}

.service-img {
    max-width: 100%; /* Allow image to fill container width */
    height: 200px; /* Fixed height for consistency */
    object-fit: cover; /* Ensure image covers area */
    margin-bottom: 1.5rem;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: opacity 0.3s ease, filter 0.3s ease;
    border-radius: 4px;
}
.service-item:hover .service-img {
    opacity: 1;
    filter: grayscale(20%); /* Reduce grayscale on hover */
}
.service-item h3 {
    color: var(--color-white); /* Ensure heading is white */
}

/* --- Tour Packages Section (formerly Fare Calculator) --- */
/* *** Renamed class */
.tours-section {
    background-color: var(--color-grey-dark);
}

/* *** Use Flexbox for more robust layout */
.tours-container {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 30px;
    /* Removed fixed height */
}

.tour-selector-container {
    background-color: var(--color-black);
    border: 1px solid var(--color-grey-medium);
    border-radius: 6px;
    padding: 25px;
    /* *** Flex basis controls width, allow grow/shrink */
    flex: 1 1 300px; /* Grow, shrink, base width 300px */
    /* Removed fixed height, added min-height */
    min-height: 450px; /* Minimum height */
    display: flex; /* Use flex for internal layout */
    flex-direction: column;
}

.form-group {
    margin-bottom: 20px; /* Increased bottom margin */
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--color-grey-light);
    font-weight: bold;
}

.tour-dropdown {
    width: 100%;
    padding: 12px;
    background-color: var(--color-grey-medium); /* Slightly lighter background */
    border: 1px solid var(--color-grey-dark);
    color: var(--color-white);
    font-family: var(--font-primary);
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.tour-dropdown:focus {
    outline: none;
    border-color: var(--color-white);
    background-color: var(--color-grey-dark);
}

/* Make tour details scrollable and take remaining space */
.tour-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-grey-dark);
    flex-grow: 1; /* Allow details to take available space */
    overflow-y: auto; /* Allow scrolling if content exceeds height */
    min-height: 200px; /* Ensure it has some minimum height */
}

.tour-details h3 {
    color: var(--color-white);
    margin-bottom: 15px;
}

/* Removed tour-price class */

.tour-specs {
    margin-top: 15px;
    font-size: 0.95rem; /* Slightly larger */
    line-height: 1.7;
    color: var (--color-grey-light);
}

.tour-specs br {
    margin-bottom: 5px; /* Space out lines */
}

/* Map container */
.map-container {
    /* *** Flex basis controls width */
    flex: 2 1 500px; /* Grow x2, shrink, base width 500px */
    min-height: 500px; /* Ensure map has decent height */
    background-color: var(--color-black);
    border: 1px solid var(--color-grey-medium);
    position: relative;
    border-radius: 6px;
    overflow: hidden; /* Clip map tiles */
    width: 100%; /* Ensure full width */
    height: 500px; /* Explicit height */
}

#map {
    height: 100%; /* Make map fill container */
    width: 100%;
    background-color: var(--color-grey-medium); /* Background while loading */
    position: relative; /* Ensure proper stacking context */
    z-index: 5; /* Ensure map is above background but below loading overlay */
}

/* Mobile map placeholder - hidden by default */
.mobile-map-placeholder {
    display: none; /* Hidden on desktop */
    width: 100%;
    height: 0; /* No height by default */
}

/* Additional specific fix for mobile maps */
@media (max-width: 768px) {
    .map-container {
        height: 400px;
        min-height: 400px;
        width: 100% !important; /* Force full width */
        display: block; /* Ensure proper display */
    }
    
    #map {
        height: 400px !important; /* Force explicit height */
    }
}

/* --- Fleet Section --- */
.fleet-section {
     background-color: var(--color-black);
     text-align: center;
}
.fleet-gallery {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 30px; /* Increased gap */
    flex-wrap: wrap;
}
/* Use figure for better semantics */
.fleet-gallery figure {
    margin: 0;
    background-color: var(--color-grey-dark);
    padding: 10px;
    padding-top: 25px;
    border-radius: 6px;
    border: 1px solid var(--color-grey-medium);
    max-width: 320px;
    width: 100%; /* Take full width on mobile */
}
.fleet-gallery img {
    max-width: 70%; /* Changed from 100% to 70% as requested */
    height: auto;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    border-radius: 4px;
    margin: 0 auto; /* Center the image */
}
.fleet-gallery figure:hover img {
    filter: grayscale(0%);
}
.fleet-gallery figcaption {
    margin-top: 10px;
    color: var(--color-grey-light);
    font-weight: bold;
}
/* Add styling for the paragraph text inside figure */
.fleet-gallery figure p {
    line-height: 1.2; /* Reduced from default 1.6 to create less space between lines */
    margin-top: 8px;
}

/* --- Contact Section --- */
.contact-section {
     background-color: var(--color-grey-dark);
     text-align: center;
}
.contact-section strong {
    color: var(--color-white);
}
/* Make links more obvious */
.contact-section p a {
    color: var(--color-white);
    text-decoration: underline;
}
.contact-section p a:hover {
    color: var(--color-grey-light);
}

/* --- Footer --- */
.main-footer {
    background-color: var(--color-black);
    color: var(--color-grey-medium);
    text-align: center;
    padding: 30px 0; /* Increased padding */
    margin-top: 40px;
    border-top: 1px solid var(--color-grey-dark);
}

.main-footer p {
    margin-bottom: 0.5rem; /* Adjust spacing */
}

.main-footer a {
    color: var(--color-grey-light);
}
.main-footer a:hover {
    color: var(--color-white);
    text-decoration: underline;
}

/* --- Leaflet Overrides --- */
/* No longer needed if using show: false in JS */
/* .leaflet-control-container .leaflet-routing-container {
    display: none !important;
} */

/* Make map controls slightly darker to fit theme */
.leaflet-control-zoom a, .leaflet-control-attribution a {
    color: #ddd !important;
}
.leaflet-control-zoom, .leaflet-control-attribution {
    background: rgba(10, 10, 10, 0.7) !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4) !important;
    color: #ccc !important;
    border-radius: 5px !important;
}
.leaflet-bar a {
     background-color: rgba(50, 50, 50, 0.8) !important;
     color: white !important;
     border-bottom: 1px solid #444 !important;
}
.leaflet-bar a:hover {
    background-color: rgba(70, 70, 70, 0.9) !important;
}

/* --- Improved Responsiveness --- */
/* Large screens */
@media (min-width: 1200px) {
    .container {
        padding: 0 30px; /* Slightly more padding on larger screens */
    }
    
    .service-grid {
        grid-template-columns: repeat(4, 1fr); /* Show 4 services in a row on large screens */
    }
}

/* Medium-large screens */
@media (max-width: 1100px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr); /* Show 2 services in a row */
    }
    
    .value-items {
        grid-template-columns: repeat(2, 1fr); /* 2 value items per row */
    }
}

/* Medium screens (tablets) */
@media (max-width: 992px) {
    /* Adjust tour container layout for tablets */
    .tours-container {
        /* Stack elements vertically */
        flex-direction: column;
    }
    
    .tour-selector-container {
        flex-basis: auto; /* Reset flex basis */
        min-height: auto; /* Reset min-height */
        order: 1; /* Show selector first */
    }
    
    .map-container {
        flex-basis: auto; /* Reset flex basis */
        min-height: 400px; /* Adjust map height */
        order: 2; /* Map second */
    }
    
    h1 { font-size: 2.7rem; } /* Slightly reduce heading size */
    h2 { font-size: 2rem; }
    
    section {
        padding: 50px 0; /* Slightly reduce section padding */
    }
}

/* Small-medium screens */
@media (max-width: 768px) {
    :root {
        --header-height: 60px; /* Smaller header on mobile */
    }

    .logo-image{
        padding: 5px;
    }
    
    html {
        scroll-padding-top: var(--header-height);
    }

    h1 { font-size: 2.2rem; }
    .company-name-banner h1 { font-size: clamp(2rem, 7vw, 2.8rem); } /* Adjust clamp */
    .hero-content h2 { font-size: clamp(1.2rem, 4vw, 1.4rem); }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.3rem; }
    
    /* Show hamburger menu */
    .menu-toggle {
        display: block;
    }
    
    /* Header adjustments for mobile */
    .main-header .container {
        justify-content: flex-start; /* Logo at start, menu toggle at end */
        position: relative; /* For absolute positioning of nav */
        padding: 0 15px;
    }
    
    .logo {
        padding: 10px 0;
    }
    
    .logo a {
        font-size: 1.5rem; /* Smaller logo text */
    }
    
    /* Mobile navigation styles */
    .main-nav {
        position: fixed;
        top: -100vh; /* Start offscreen from top */
        right: 0;
        left: 0; /* Full width */
        width: 100%;
        height: auto;
        max-height: 90vh; /* Limit height to 90% of viewport */
        background-color: rgba(0, 0, 0, 0.95);
        z-index: 2000;
        /* padding: 70px 0 20px 0; */
        transition: top 0.3s ease; /* Transition from top instead of right */
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }
    
    .main-nav.open {
        top: 0; /* Slide down from top */
    }
    
    .main-nav ul {
        flex-direction: column;
        padding: 20px;
    }
    
    .main-nav li {
        margin: 15px 0;
        text-align: center;
    }
    
    .main-nav a {
        /* display: block; */
        padding: 10px;
        font-size: 1.1rem;
        border-bottom: 1px solid;
    }

    /* Other mobile adjustments */
    .value-items {
        grid-template-columns: 1fr; /* Stack value items */
        gap: 25px;
    }

    .service-grid {
        grid-template-columns: 1fr; /* Stack services */
        gap: 20px;
    }

    section {
        padding: 40px 0;
    }

    .company-name-banner {
        padding: 15px 20px; /* Adjust padding */
    }

    .fleet-gallery figure {
        max-width: 100%; /* Full width on mobile */
    }
    
    /* .btn {
        width: 100%;
    } */
}

/* Extra small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 15px; /* Reduce padding on small screens */
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.2rem; }
    
    .logo a {
        font-size: 1.3rem;
    }
    
    .company-name-banner {
        padding: 12px 15px; /* Further reduce padding */
    }
    
    .main-nav a {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .tours-container {
        gap: 20px; /* Reduce gap */
    }
    
    .tour-selector-container {
        padding: 15px;
    }
    
    .map-container {
        min-height: 300px; /* Smaller map on very small screens */
    }
    
    section {
        padding: 30px 0; /* Less vertical padding */
    }
    
    .value-item, .service-item {
        padding: 15px; /* Less padding in content boxes */
    }
}

/* Fix for touch devices */
@media (hover: none) {
    .main-nav a:hover {
        border-bottom-color: transparent; /* Remove hover effect on touch devices */
    }
    
    .main-nav a:active {
        border-bottom-color: var(--color-white); /* Apply on active instead */
    }
}

/* Dark mode preference support */
@media (prefers-color-scheme: dark) {
    /* Already dark-themed, but could add additional tweaks here if needed */
}

/* --- Improved Responsiveness --- */
/* For desktop and large screens - default layout with map on the right */
@media (min-width: 769px) {
    .tours-container {
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
    }
    
    .tour-selector-container {
        flex: 1 1 300px;
        min-height: 450px;
    }
    
    .map-container {
        flex: 2 1 500px;
        min-height: 500px;
    }
    
    /* Ensure placeholder is unused */
    .mobile-map-placeholder {
        display: none;
    }
}

/* For mobile screens - move map inside tour selector container */
@media (max-width: 768px) {
    /* Change tours container to stack vertically */
    .tours-container {
        flex-direction: column;
    }
    
    /* The main map container is visually hidden but keeps its DOM position for JavaScript */
    .map-container {
        opacity: 0;
        position: absolute;
        height: 0;
        overflow: hidden;
        pointer-events: none; /* Prevents interactions with the hidden map */
    }
    
    /* Show and size the placeholder */
    .mobile-map-placeholder {
        display: block;
        height: 300px;
        margin-bottom: 20px;
        background-color: var(--color-black);
        border: 1px solid var(--color-grey-medium);
        border-radius: 6px;
        overflow: hidden;
        position: relative;
    }
    
    /* Move the real map into the placeholder using absolute positioning */
    .mobile-map-placeholder #map-container {
        width: 100%;
        height: 300px;
        position: absolute;
        top: 0;
        left: 0;
        opacity: 1;
        pointer-events: auto; /* Re-enable interactions */
    }
    
    /* Ensure tour details comes after map in the flow */
    .tour-details {
        order: 3;
    }
}