/* --- CUSTOM RED THEME (#B42A24) --- */
.flatpickr-months { background: #B42A24; }
.flatpickr-months .flatpickr-month { color: #fff; }
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: #fff !important; color: #fff !important; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: rgba(255, 255, 255, 0.8) !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months { background: #B42A24; }
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month { color: #fff; }
.flatpickr-current-month .numInputWrapper span { border: none; }
.flatpickr-current-month .numInput { color: #fff; }
.flatpickr-current-month .numInput:hover,
.flatpickr-current-month .flatpickr-monthDropdown-months:hover { background: #9d2420; }
.flatpickr-weekdays { background: #B42A24; }
.flatpickr-weekdays span { color: rgba(255, 255, 255, 0.8); }
/* 1. The date the user clicks on */
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #B42A24 !important;
    border-color: #B42A24 !important;
    color: #fff !important;
}
/* 2. Today's date (with no background) */
.flatpickr-day.today {
    border-color: #B42A24 !important;
    color: #B42A24 !important;
    background: transparent !important; 
}
/* 3. How "today" and other dates look on hover */
.flatpickr-day:hover {
    background: #fde9e8 !important;
}
.flatpickr-day.today:hover {
    background: #fde9e8 !important;
    border-color: #B42A24 !important;
    color: #B42A24 !important;
}
/* --- END OF CUSTOM THEME --- */

/* --- FLATPICKR Z-INDEX FIX --- */
.flatpickr-calendar { 
    z-index: 100002 !important; 
}

/*
 * Britway Plugin CSS (v10.4 - Voucher Layout Update)
 */

#britway-container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px 30px;
    box-sizing: border-box;

    /* --- FIX: Allow dropdown to spill out --- */
    overflow: visible !important; 
    position: relative; /* Required for z-index to work */
    z-index: 50; 
}

#britway-container h2 { font-size: 1.5em; margin-top: 0; margin-bottom: 20px; }
#britway-container h3 { 
    font-size: 1.4em; 
    margin-top: 25px; 
    margin-bottom: 15px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 10px; 
    text-align: center; 
}

/* --- Booking Summary --- */
#britway-summary { border-top: 1px solid #eee; padding-top: 10px; margin-top: 20px; }
#britway-summary h3 { margin-top: 10px; }
#britway-summary-map { width: 100%; height: 300px; background: #eee; margin-bottom: 15px; border-radius: 4px; }

/* Price Summary Box */
#britway-price-summary { border: 1px solid #e0e0e0; border-radius: 5px; background: #f9f9f9; padding: 20px; text-align: center; }
#britway-price-summary > div:first-child { font-size: 1.1em; color: #555; margin-bottom: 5px; }
#britway-price-display {
    font-weight: bold;
    color: #111;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
span.britway-sale-tag {
    font-size: 1.0em;
    color: #B42A24;
    font-weight: bold;
}
#britway-price-original {
    font-size: 1.6em;
    color: #777;
    text-decoration: line-through;
    font-weight: normal;
}
#britway-price-sale {
    font-size: 2.2em;
}
/* When not on sale, add margin back to center the price */
#britway-price-display:not(.is-sale) #britway-price-sale {
    margin-top: 15px; 
}
#britway-price-summary > div:last-child { color: #555; font-size: 1.1em; }
#britway-price-distance { font-weight: bold; margin-right: 10px; }
#britway-price-duration { font-weight: bold; }

/* --- Form Styles --- */
.britway-form .britway-location-wrapper,
.britway-form .britway-datetime-wrapper,
.britway-form .britway-vehicle-wrapper,
.britway-form .britway-extras-wrapper,
.britway-form .britway-voucher-wrapper {
    margin-bottom: 15px;
}
/* --- FIX: Lift the dropdown above the footer --- */
.britway-form .britway-vehicle-wrapper {
    position: relative;
    z-index: 1001 !important; /* Force it to float above the footer */
}
.britway-form label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    font-size: 0.9em; 
    color: #444;
}
.britway-form input[type="text"],
.britway-form select {
    width: 100%;
    padding: 8px 10px; 
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 15px;
}
.britway-form input[type="text"]:focus,
.britway-form select:focus {
    border-color: #B42A24;
    box-shadow: 0 0 5px rgba(180, 42, 36, 0.3);
    outline: none;
}
.britway-form select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' fill='%23555'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 30px;
    cursor: pointer;
}

/* --- Split Date/Time Styles --- */
.britway-datetime-wrapper {
    display: flex;
    flex-direction: column; 
    gap: 0;
    flex-wrap: wrap; 
}
.britway-date-group {
    width: 100%;
    margin-bottom: 15px;
}
.britway-time-group {
    width: 100%;
}
@media (min-width: 400px) {
    .britway-datetime-wrapper { 
        flex-direction: row; 
        gap: 15px;
    }
    .britway-date-group { 
        flex: 1; 
        margin-bottom: 0;
    }
    .britway-time-group { 
        flex: 1; 
    }
}
#britway-pickup-date-input { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24' fill='%23777'%3E%3Cpath d='M17 3h-1V1h-2v2H10V1H8v2H7c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H7V9h10v12zm0-14H7V5h10v2z'/%3E%3C/svg%3E") no-repeat 98% center; background-size: 20px; padding-right: 35px; cursor: pointer; }
.britway-time-split-inputs { display: flex; align-items: center; gap: 8px; }

.britway-time-split-inputs select {
    flex: 1; 
    padding: 8px 10px;
    padding-right: 30px;
}
.britway-time-split-inputs select option[value=""] {
    color: #999;
}
.britway-time-split-inputs span { font-size: 1.2em; font-weight: bold; color: #777; }

/* --- Location Inputs with Icons --- */
.britway-location-wrapper { 
    position: relative; 
}
.britway-input-icon-wrapper {
    position: relative;
}
.britway-location-icon-svg {
    position: absolute;
    left: 10px;
    z-index: 2;
    color: #888;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
}
.britway-geolocate-btn,
.britway-clear-input {
    position: absolute;
    right: 8px;
    z-index: 2;
    color: #888;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 5px;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    outline: none;
    box-shadow: none;
}
.britway-geolocate-btn:hover,
.britway-clear-input:hover {
    color: #888; 
    background: transparent;
}
.britway-geolocate-btn:focus,
.britway-clear-input:focus {
    outline: none !important;
    box-shadow: none !important;
}
.britway-form input[type="text"].britway-search-box {
    padding-left: 40px; 
    padding-right: 40px; 
}

/* Suggestions Box */
.britway-suggestions { 
    display: none; 
    position: absolute; 
    width: 100%; 
    background: #fff; 
    border: 1px solid #ccc; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
    z-index: 100002 !important; 
    max-height: 250px; 
    overflow-y: auto; 
}
.britway-suggestions p { margin: 0; padding: 8px 12px; font-size: 0.9em; color: #777; background: #f9f9f9; font-weight: bold; }
.britway-suggestions ul { list-style: none; margin: 0; padding: 0; }
.britway-suggestions li { 
    padding: 10px 12px; 
    cursor: pointer; 
    font-size: 0.85em; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.britway-suggestions li:hover { background: #f0f0f0; }

.britway-suggestion-icon {
    font-size: 1.2em;
    opacity: 0.7;
    margin-left: 10px; 
}

/* Optional Extras */
.britway-extras-list label { font-weight: normal; display: block; margin-bottom: 5px; }
.britway-extras-list input[type="checkbox"] { margin-right: 8px; }

/* "Get Quote" button */
#britway-get-quote { margin-top: 10px; width: 100%; text-align: center; padding: 12px; background: #c00; border: none; color: #fff; font-size: 1.1em; font-weight: bold; border-radius: 4px; }
#britway-get-quote:hover { background: #a00; }
#britway-get-quote:disabled { background: #999; }

/* --- NEW: Voucher styles (v10.4) --- */
.britway-voucher-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px 20px;
    margin-top: 15px;
    margin-bottom: 15px; /* Space before Price Summary */
    text-align: left;
}

.britway-voucher-wrapper label {
    font-size: 1em; 
    color: #333;
    margin-bottom: 8px; 
    display: block; 
    font-weight: 600; 
}

.britway-voucher-inner { 
    display: flex; 
    gap: 10px;
}

#britway-voucher {
    flex-grow: 1; 
}

#britway-apply-voucher {
    padding: 8px 14px;
    font-size: 0.9em;
    background: #555;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0; 
}
#britway-apply-voucher:hover { background: #333; }
#britway-apply-voucher:disabled { background: #999; cursor: default; }

/* "Remove" button style */
#britway-remove-voucher {
    padding: 8px 14px;
    font-size: 1.2em;
    line-height: 1;
    background: #c00;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}
#britway-remove-voucher:hover { background: #a00; }
#britway-remove-voucher:disabled { background: #999; cursor: default; }

#britway-voucher-message {
    margin-top: 8px;
    text-align: center;
    font-size: 0.95em;
}

#britway-voucher-message.error { background: #fbeaea; border: 1px solid #c00; color: #c00; padding: 10px; border-radius: 3px;}
#britway-voucher-message.success { background: #eafbea; border: 1px solid #00c000; color: #007700; padding: 10px; border-radius: 3px;}

/* Book Now Button */
#britway-add-to-cart { width: 100%; padding: 12px; background: #111; border: none; color: #fff; font-size: 1.1em; font-weight: bold; border-radius: 4px; }
#britway-add-to-cart:hover { background: #333; }
#britway-add-to-cart:disabled { background: #999; }

/* --- Inline Validation Errors --- */
.britway-error-message {
    display: none;
    color: #B42A24;
    font-size: 0.9em;
    margin-top: 8px;
    flex-basis: 100%; 
}
.britway-form input.britway-field-error,
.britway-form select.britway-field-error {
    border-color: #B42A24 !important;
    box-shadow: 0 0 5px rgba(180, 42, 36, 0.3) !important;
}
.britway-datetime-wrapper.britway-field-error {
    border: 1px solid #B42A24;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(180, 42, 36, 0.3) !important;
    padding: 5px;
    margin: -5px;
}

/* Messages */
#britway-message { margin-top: 10px; padding: 10px; border-radius: 3px; }
#britway-message.error { background: #fbeaea; border: 1px solid #c00; color: #c00; }
#britway-message.success { background: #eafbea; border: 1px solid #00c000; color: #007700; }

/* --- "Change Details" Button --- */
#britway-edit-quote {
    width: 100%;
    text-align: center;
    padding: 12px;
    background: #f0f0f0; 
    border: 1px solid #ccc; 
    color: #555; 
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box; 
}
#britway-edit-quote:hover {
    background: #e0e0e0; 
    border-color: #bbb;
    color: #333;
}

/* --- NEW: Google Places Dropdown Styling (Floating Card v10.5) --- */
.pac-container {
    z-index: 100003 !important; 
    background-color: #fff !important;
    border: 1px solid #ccc !important; /* Restore border */
    border-top: 1px solid #ccc !important; /* Ensure top border is visible */
    border-radius: 4px !important; /* Round all corners */
    margin-top: 5px !important; /* Add a small gap */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important; /* nicer shadow */
}

/* Fix for the items inside */
.pac-item {
    padding: 10px 12px;
    cursor: pointer;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    line-height: 1.4; /* Better spacing for text */
}
.pac-item:first-child { border-top: none; }
.pac-item:hover { background: #f0f0f0; }
.pac-icon {
    margin-right: 10px; 
    margin-top: 1px; 
    flex-shrink: 0; 
}
.pac-item-query { font-weight: bold; }

@media (max-width: 600px) {
    #britway-container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Make Google dropdown match on mobile */
    .pac-container {
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
    }
}

/* --- Summary Details (v2 - Compact) --- */
#britway-summary-details {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 0 15px; 
    margin-bottom: 15px; /* Reduced margin now that voucher is below */
}

#britway-summary-details ul { list-style: none; margin: 0; padding: 0; }

#britway-summary-details li {
    padding: 8px 0; 
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    font-size: 0.95em; 
    gap: 15px; 
}

#britway-summary-details li:last-child { border-bottom: none; }

#britway-summary-details li strong {
    color: #555;
    white-space: nowrap; 
}

#britway-summary-details li span {
    color: #111;
    font-weight: 600;
    text-align: right;
    flex-basis: 70%; 
}

/* ==========================================================================
   WOOCOMMERCE CHECKOUT & ORDER STYLING (Layout Only - No Colors)
   ========================================================================== */

/* --- 1. Cart & Checkout Items (The List) --- */
strong.britway-title {
    font-size: 1.1em;
    display: block;
    margin-bottom: 8px;
    /* No Color - inherits theme default */
}

/* Fix the definition list layout so it lines up nicely */
.woocommerce-checkout .product-name dl.variation,
.woocommerce-cart .product-name dl.variation,
.woocommerce-order-received .product-name dl.variation {
    /* Removed border-left and padding-left to remove the gray line */
    margin-top: 8px;
}

/* Labels (e.g. "Pickup From:") */
.woocommerce-checkout .product-name dl.variation dt,
.woocommerce-cart .product-name dl.variation dt,
.woocommerce-order-received .product-name dl.variation dt {
    float: none;
    clear: both;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Values (e.g. "Heathrow") */
.woocommerce-checkout .product-name dl.variation dd,
.woocommerce-cart .product-name dl.variation dd,
.woocommerce-order-received .product-name dl.variation dd {
    float: none;
    margin-bottom: 10px;
    color: #555;
    font-style: normal;
    font-size: 1em;
}

/* Remove extra paragraphs */
.woocommerce-checkout .product-name dl.variation dd p,
.woocommerce-cart .product-name dl.variation dd p,
.woocommerce-order-received .product-name dl.variation dd p {
    margin-bottom: 0;
}

/* --- Thank You Message Box (Green Style) --- */
.woocommerce-thankyou-order-received {
    background: #eafbea;         /* Light Green Background */
    border: 1px solid #00c000;   /* Green Border */
    color: #007700;              /* Dark Green Text */
    padding: 18px;               /* Spacing inside */
    border-radius: 4px;          /* Rounded Corners */
    margin-bottom: 25px;         /* Spacing below */
    text-align: center;          /* Center the text */
    font-weight: bold;           /* Make text bold */
    font-size: 1.0em;            /* Slightly larger text */
    clear: both;                 /* Ensure it sits on its own line */
    display: block;              /* Force it to fill width */
}

/* --- Mobile Dropdown Text Size Fix --- */
@media only screen and (max-width: 768px) {
    /* 1. Shrink the text inside the box */
    select#britway-vehicle {
        font-size: 13px !important; /* Standard is 16px, this makes it smaller */
        padding-left: 5px !important;
        padding-right: 20px !important; /* Reduce space to fit more text */
        line-height: 1.2 !important;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /* 2. Attempt to shrink the popup list (Works on some Androids, ignored by iPhones) */
    select#britway-vehicle option {
        font-size: 13px !important;
    }
}



/* --- CUSTOM IMAGE DROPDOWN STYLES --- */
.britway-custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
    margin-bottom: 15px;
    font-family: inherit;
}

.britway-custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* The box you click on */
.britway-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 500;
    color: #757575; /* Grey placeholder color */
    
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    min-height: 45px; /* Matches other inputs */
    box-sizing: border-box;
    transition: all 0.2s;
}
.britway-select-trigger.selected {
    color: #333;
}
.britway-select-trigger:hover {
    border-color: #aaa;
}

/* The Arrow Icon */
.britway-select-trigger .arrow {
    width: 0; 
    height: 0; 
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #555;
    margin-left: 10px;
}


/* The Dropdown List (OPENS DOWNWARDS - FIXED) */
.britway-custom-options {
    position: absolute;
    display: none;
    top: 100%;          /* Push it DOWN from the trigger */
    bottom: auto;       /* Reset bottom */
    left: 0;
    right: 0;
    border: 1px solid #ccc;
    border-top: none;   /* Remove top border so it blends with the box */
    background: #fff;
    z-index: 100005;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Shadow goes down */
    border-radius: 0 0 4px 4px; /* Round bottom corners */
    margin-top: 0;
}

.britway-custom-options.open {
    display: block;
}

/* Individual Option Items */
.britway-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.britway-option:last-child {
    border-bottom: none;
}

.britway-option:hover {
    background-color: #f5f5f5;
}

/* Car Image Styling - BIGGER VERSION */
.britway-car-img {
    width: 100px;       /* <-- CHANGED from 70px to 100px */
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.britway-car-img img {
    max-width: 100%;
    max-height: 100px;   /* <-- CHANGED from 40px to 60px */
    object-fit: contain;
}
/* Text Details */
.britway-car-details {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.britway-car-name {
    font-weight: bold;
    font-size: 17px;
    color: #222;
}

.britway-car-specs {
    font-size: 15px;
    color: #666;
    margin-top: 2px;
    font-weight: normal;
}