/* ============================================
   AEROVISION PARTNERS - MODERN DESIGN SYSTEM
   Complete redesign from scratch
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --navy: #243b5a;
    --navy-dark: #1f334e;
    --navy-darker: #152336;
    --red: #d60000;
    --red-dark: #bf0000;
    
    /* Neutrals */
    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-navy: 0 10px 25px -5px rgba(36, 59, 90, 0.3);
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1em;
}

a {
    text-decoration: none;
    transition: all var(--transition-base);
    color: inherit;
}

/* Ensure red text color is applied to links and buttons */
a.text-red-600,
button.text-red-600 {
    color: #dc2626 !important;
}

a.text-red-600:hover,
button.text-red-600:hover {
    color: #991b1b !important;
}

/* Ensure SVG icons inherit red color */
a.text-red-600 svg,
button.text-red-600 svg {
    color: #dc2626 !important;
}

a.text-red-600:hover svg,
button.text-red-600:hover svg {
    color: #991b1b !important;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.flex { display: flex; }
.grid { display: grid; }
.block { display: block; }
.inline { display: inline; }
.hidden { display: none; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.fixed { position: fixed; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.list-none { list-style:none; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.space-x-2 > * + * { margin-left: var(--space-xs); }
.space-x-4 > * + * { margin-left: var(--space-sm); }
.space-x-6 > * + * { margin-left: var(--space-md); }
.space-x-8 > * + * { margin-left: var(--space-lg); }
.space-y-4 > * + * { margin-top: var(--space-sm); }
.space-y-6 > * + * { margin-top: var(--space-md); }
.space-y-8 > * + * { margin-top: var(--space-lg); }
.space-y-10 > * + * { margin-top: 2.5rem; }
.space-y-12 > * + * { margin-top: var(--space-xl); }

/* Grid System */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gap-4 { gap: var(--space-sm); }
.gap-6 { gap: var(--space-md); }
.gap-8 { gap: var(--space-lg); }
.gap-10 { gap: 2.5rem; }
.gap-12 { gap: var(--space-xl); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:block { display: block; }
    .md\:inline { display: inline; }
}

/* ============================================
   Car Search Form — responsive 2-row layout
   Mobile (<640px):  single column — every field takes the full width.
   Tablet (>=640px): 2-column grid with per-field spans so compact
                     fields (e.g. "Edad") pair up instead of wasting a row.
   Desktop (>=1024px): original single-row 5-column layout.
   ============================================ */
.car-search-row {
    display: grid;
    grid-template-columns: 1fr;   /* mobile: one field per row, full width */
    gap: 1rem;
    align-items: end;
}
.car-search-row > * { min-width: 0; }


/* Mobile (<640px): reorder fields into the corrected logical sequence.
   The two .car-search-row grids are collapsed with display:contents so all
   fields become flex items of the form and can be interleaved across rows:
   Pick-up Location → Pick Date&Time → Drop-off Location → Return Date&Time
   → Rental Plan → CDP → PC → Age → Search.
   Scoped to mobile only; tablet/desktop layouts below are unaffected. */
@media (max-width: 639px) {
    #car-search-form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    #car-search-form .car-search-row { display: contents; }

    #car-search-form .cf-ploc      { order: 1; }
    #car-search-form .cf-pdatetime { order: 2; }
    #car-search-form .cf-dloc      { order: 3; }
    #car-search-form .cf-ddatetime { order: 4; }
    #car-search-form .cf-rental    { order: 5; }
    #car-search-form .cf-cdp       { order: 6; }
    #car-search-form .cf-promo     { order: 7; }
    #car-search-form .cf-age       { order: 8; }
    #car-search-form .cf-search    { order: 9; }
}

/* Tablet: 2-column grid with pairing */
@media (min-width: 640px) {
    .car-search-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    /* Wide fields need the full row (radios / rental-plan text) */
    .cf-location,
    .cf-rental { grid-column: 1 / -1; }
    /* Compact fields take one column, pairing up side-by-side */
    .cf-datetime,
    .cf-age,
    .cf-cdp,
    .cf-promo,
    .cf-search { grid-column: span 1; }
}

/* Desktop: restore the single-row 5-column layout */
@media (min-width: 1024px) {
    .car-search-row {
        grid-template-columns: 1.4fr 1.2fr 0.7fr 0.7fr 0.5fr;
    }
    .cf-location,
    .cf-datetime,
    .cf-age,
    .cf-cdp,
    .cf-promo,
    .cf-search { grid-column: auto; }
    .cf-rental { grid-column: span 2; }
}

/* ============================================
   Landing info cards (CKEditor content)
   Mobile & tablet: one card per row (prevents horizontal overflow when
   editor content is long). Desktop: N columns from --card-count.
   ============================================ */
.landing-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.landing-cards-grid > * { min-width: 0; }

/* Long unbreakable strings/URLs from the editor must not push width */
.landing-card-content { overflow-wrap: anywhere; word-break: break-word; }
.landing-card-content img { max-width: 100%; height: auto; }

@media (min-width: 1024px) {
    .landing-cards-grid {
        grid-template-columns: repeat(var(--card-count, 1), minmax(0, 1fr));
    }
}

/* ============================================
   Results page — search summary bar
   Mobile & tablet: info stacks one item per row, action button below.
   Desktop (>=1024px): info in 3 columns with the button beside it.
   ============================================ */
.results-summary-bar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.results-summary-info {
    display: grid;
    grid-template-columns: 1fr;   /* one info block per row */
    gap: 1rem;
    width: 100%;
}
.results-summary-action .btn-primary { width: 100%; }

@media (min-width: 1024px) {
    .results-summary-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .results-summary-info {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem;
    }
    .results-summary-action .btn-primary { width: auto; }
}


/* Spacing */
.p-2 { padding: var(--space-xs); }
.p-4 { padding: var(--space-sm); }
.p-6 { padding: var(--space-md); }
.p-8 { padding: var(--space-lg); }
.p-10 { padding: 2.5rem; }
.p-12 { padding: var(--space-xl); }
.px-2 { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-4 { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-6 { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-8 { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-10 { padding-left: 2.5rem; padding-right: 2.5rem; }
.py-2 { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-6 { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-8 { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-12 { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-16 { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.mb-2 { margin-bottom: var(--space-xs); }
.mb-4 { margin-bottom: var(--space-sm); }
.mb-6 { margin-bottom: var(--space-md); }
.mb-8 { margin-bottom: var(--space-lg); }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: var(--space-xl); }
.mt-2 { margin-top: var(--space-xs); }
.mt-4 { margin-top: var(--space-sm); }
.mt-6 { margin-top: var(--space-md); }
.mt-8 { margin-top: var(--space-lg); }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Sizing */
.w-full { width: 100%; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }
.w-48 { width: 12rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-10 { height: 2.5rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.min-h-screen { min-height: 100vh; }
.min-h-500 { min-height: 500px; }
.max-w-md { max-width: 28rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-full { max-width: 100%; }
.max-w-\[120px\] { max-width: 120px; }
.max-w-\[150px\] { max-width: 150px; }
.max-w-\[126px\] { max-width: 126px; }
.max-w-\[154px\] { max-width: 154px; }
.max-w-\[196px\] { max-width: 196px; }
.max-w-\[220px\] { max-width: 220px; }
.h-11 { height: 2.75rem; }
.h-14 { height: 3.5rem; }
.h-22 { height: 5.5rem; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1.5rem; letter-spacing: 0.025em; }
.text-sm { font-size: 0.875rem; line-height: 1.5rem; letter-spacing: 0.01em; }
.text-base { font-size: 1rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; letter-spacing: -0.01em; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; letter-spacing: -0.02em; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; letter-spacing: -0.02em; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; letter-spacing: -0.025em; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.05em; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Colors */
.bg-white { background-color: var(--white); }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-gray-200 { background-color: var(--gray-200); }
.bg-gray-300 { background-color: var(--gray-300); }
.bg-gray-400 { background-color: var(--gray-400); }
.bg-gray-600 { background-color: var(--gray-600); }
.bg-gray-700 { background-color: var(--gray-700); }
.bg-gray-800 { background-color: var(--gray-800); }
.bg-gray-900 { background-color: var(--gray-900); }
.bg-black { background-color: #000000; }
.bg-green-100 { background-color: #dcfce7; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-red-100 { background-color: #fee2e2; }
.bg-brand-navy { background-color: var(--navy); }
.bg-brand-navy-dark { background-color: var(--navy-dark); }
.bg-brand-navy-darker { background-color: var(--navy-darker); }
.bg-brand-red { background-color: var(--red); }
.bg-brand-red-dark { background-color: var(--red-dark); }

.text-white { color: var(--white); }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-800 { color: var(--gray-800); }
.text-gray-900 { color: var(--gray-900); }
.text-red-600 { color: #dc2626; }
.text-red-800 { color: #991b1b; }
.text-green-800 { color: #166534; }
.text-yellow-800 { color: #854d0e; }
.text-brand-red { color: var(--red); }
.text-brand-red-dark { color: var(--red-dark); }
.text-brand-navy { color: var(--navy); }
.text-brand-navy-dark { color: var(--navy-dark); }

/* Borders */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }
.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-md); }
.rounded-xl { border-radius: var(--radius-lg); }
.rounded-2xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.rounded-t-lg { border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md); }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-navy { box-shadow: var(--shadow-navy); }

/* Positioning */
.top-0 { top: 0; }
.right-0 { right: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }

/* Background */
.bg-cover { background-size: cover; }
.bg-center { background-position: center; }
.bg-opacity-30 { opacity: 0.3; }
.bg-opacity-40 { opacity: 0.4; }

/* Transitions */
.transition { transition: all var(--transition-base); }
.transition-colors { transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base); }
.transition-all { transition: all var(--transition-base); }

/* Hover States */
.hover\:bg-gray-100:hover { background-color: var(--gray-100); }
.hover\:bg-gray-200:hover { background-color: var(--gray-200); }
.hover\:bg-gray-700:hover { background-color: var(--gray-700); }
.hover\:bg-brand-navy-dark:hover { background-color: var(--navy-dark); }
.hover\:bg-brand-red:hover { background-color: var(--red); }
.hover\:text-brand-red:hover { color: var(--red); }
.hover\:text-brand-navy:hover { color: var(--navy); }
.hover\:text-red-600:hover { color: var(--red); }
.hover\:text-red-800:hover { color: #991b1b; }
.hover\:text-gray-200:hover { color: var(--gray-200); }
.hover\:text-gray-900:hover { color: var(--gray-900); }
.hover\:text-gray-600:hover { color: var(--gray-600); }

/* Focus States */
.outline-none { outline: 2px solid transparent; outline-offset: 2px; }
*:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

/* Overflow */
.overflow-x-auto { overflow-x: auto; }
.whitespace-nowrap { white-space: nowrap; }

/* Underline */
.underline {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}

/* Transform */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.-translate-y-1\/2 { --tw-translate-y: -50%; }
.pointer-events-none { pointer-events: none; }
.pr-10 { padding-right: 2.5rem; }
.pl-12 { padding-left: 3rem; }
.pl-4 { padding-left: 1rem; }
.pr-4 { padding-right: 1rem; }
.left-4 { left: 1.125rem; }
.z-10 { z-index: 10; }

/* ============================================
   MODERN COMPONENTS
   ============================================ */

/* Modern Button */
.btn-primary {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: var(--white);
    font-weight: 600;
    padding: 1.125rem 2.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    min-height: 3.5rem;
    box-shadow: 0 10px 25px -5px rgba(214, 0, 0, 0.4);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

/* Button matching input field height */
.btn-primary.input-height {
    min-height: 2.835rem;
    padding: 0.91125rem 1.215rem;
    font-size: 0.81rem;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--red-dark) 0%, #a00000 100%);
    box-shadow: 0 15px 35px -5px rgba(214, 0, 0, 0.5);
    transform: translateY(-2px);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 10px 25px -5px rgba(214, 0, 0, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    font-weight: 600;
    padding: 1.125rem 2.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    border: 1px solid var(--gray-300);
    cursor: pointer;
    font-size: 1rem;
    min-height: 3.5rem;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.form-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 0 0 auto;
}

.form-actions .btn-primary {
    min-width: 16rem;
}

.form-actions .btn-secondary {
    min-width: 10rem;
}

@media (max-width: 640px) {
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        min-width: 0;
    }
}

/* ============================================
   FILTER FORM — Responsive filter/search bar
   Used on list pages (reservations, purchases, etc.)
   Auto-fit grid adapts from 1 col on mobile to many on desktop.
   ============================================ */
.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-form > * {
    min-width: 0;
}

.filter-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Search field takes 1 column width like the other fields */
.filter-form .filter-form-search {
    grid-column: span 1;
}

/* Action buttons container — flex row, fill cell, equal widths */
.filter-form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: end;
}

.filter-form-actions > .btn-primary {
    flex: 1 1 0;
    min-width: 0;
    height: 2.835rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* On very small screens, force single column so fields get full width */
@media (max-width: 479px) {
    .filter-form {
        grid-template-columns: 1fr;
    }
}

/* Modern Input Field */
.input-field {
    width: 100%;
    padding: 0.91125rem 1.215rem; /* Another 10% smaller: 1.0125rem * 0.9, 1.35rem * 0.9 */
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-base);
    font-size: 0.81rem; /* Another 10% smaller: 0.9rem * 0.9 */
    line-height: 1.5;
    background-color: var(--white);
    min-height: 2.835rem; /* Another 10% smaller: 3.15rem * 0.9 */
    box-shadow: var(--shadow-sm);
    color: var(--gray-900);
    font-family: var(--font-sans);
}

.input-field.pl-12 {
    padding-left: 2.835rem; /* Another 10% smaller: 3.15rem * 0.9 */
}

.input-field:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.input-field:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(214, 0, 0, 0.1), var(--shadow-md);
    background-color: var(--white);
}

.input-field::placeholder {
    color: var(--gray-400);
    opacity: 1;
}

/* Modern Select */
select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23525252'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.81rem center; /* Another 10% smaller: 0.9rem * 0.9 */
    background-size: 1.0125rem; /* Another 10% smaller: 1.125rem * 0.9 */
    padding-right: 2.43rem; /* Another 10% smaller: 2.7rem * 0.9 */
    cursor: pointer;
}

select.input-field:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d60000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-position: right 0.81rem center; /* Another 10% smaller: 0.9rem * 0.9 */
    background-size: 1.0125rem; /* Another 10% smaller: 1.125rem * 0.9 */
}

/* Date Input */
input[type="date"].input-field {
    position: relative;
    cursor: pointer;
}

input[type="date"].input-field::-webkit-calendar-picker-indicator {
    opacity: 1;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
    background: transparent;
}

input[type="date"].input-field::-webkit-inner-spin-button,
input[type="date"].input-field::-webkit-clear-button {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

/* Firefox date picker */
input[type="date"].input-field::-moz-calendar-picker-indicator {
    opacity: 1;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

/* Make entire date field clickable */
input[type="date"].input-field {
    cursor: pointer;
}

/* ── iOS Safari fix ── */
@supports (-webkit-touch-callout: none) {
    input[type="date"].input-field {
        -webkit-appearance: none;
        appearance: none;
    }
    input[type="date"].input-field::-webkit-calendar-picker-indicator {
        position: static;
        width: auto;
        height: auto;
        margin-left: auto;   /* keep the calendar icon at the right edge */
    }
    input[type="date"].input-field::-webkit-inner-spin-button,
    input[type="date"].input-field::-webkit-clear-button {
        position: static;
        width: auto;
        height: auto;
        display: none;
    }
    input[type="date"].input-field::-webkit-datetime-edit {
        color: var(--gray-900);
    }
}


/* Modern Card */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(36, 59, 90, 0.85) 0%, rgba(31, 51, 78, 0.75) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

/* Search Card */
.search-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    padding: 2.43rem; /* Another 10% smaller: 2.7rem * 0.9 */
    backdrop-filter: blur(10px);
}

/* Navigation */
.nav-link {
    position: relative;
    padding: var(--space-sm) var(--space-md);
    transition: all var(--transition-base);
    border-radius: var(--radius-sm);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red) 0%, var(--red-dark) 100%);
    transition: width var(--transition-base);
    box-shadow: 0 2px 8px rgba(214, 0, 0, 0.4);
}

.nav-link:hover {
    color: var(--white);
    background: rgba(214, 0, 0, 0.1);
}

.nav-link:hover::after {
    width: calc(100% - 2rem);
}

/* Metric Card */
.metric-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--red) 0%, var(--red-dark) 100%);
    transform: scaleY(1);
    transition: transform var(--transition-base);
    box-shadow: 2px 0 8px rgba(214, 0, 0, 0.3);
}

.metric-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: var(--gray-300);
}

.metric-card:hover::before {
    width: 6px;
    box-shadow: 3px 0 12px rgba(214, 0, 0, 0.4);
}

.metric-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: var(--space-md); padding-right: var(--space-md); }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: var(--space-lg); padding-right: var(--space-lg); }
}

/* Smooth Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Header Buttons - No Borders */
header button,
header form button {
    border: none !important;
    outline: none;
    background: transparent;
}

header button:focus,
header form button:focus {
    outline: none;
    box-shadow: none;
}

/* Radio Buttons */
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--red);
    cursor: pointer;
}

/* Table Action Buttons - Remove Default Styles (but keep styled buttons visible) */
table button:not(.btn-primary),
td button:not(.btn-primary) {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
}

/* Ensure styled buttons inside tables keep their background (cart Update/Remove, etc.) */
table button.btn-primary,
td button.btn-primary,
table form button.btn-primary,
td form button.btn-primary,
form button.btn-primary {
    background: #d60000 !important;
    background-color: #d60000 !important;
    background-image: linear-gradient(135deg, #d60000 0%, #bf0000 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    display: inline-block !important;
    font-weight: 600 !important;
    padding: 0.375rem 0.75rem !important;
    min-height: auto !important;
    box-shadow: 0 4px 6px -1px rgba(214, 0, 0, 0.3) !important;
    overflow: visible !important;
    position: relative !important;
}

/* Remove ::before overlay on table buttons */
table button.btn-primary::before,
td button.btn-primary::before,
table form button.btn-primary::before,
td form button.btn-primary::before,
form button.btn-primary::before {
    display: none !important;
}

table button.btn-primary:hover,
td button.btn-primary:hover,
table form button.btn-primary:hover,
td form button.btn-primary:hover,
form button.btn-primary:hover {
    background: #bf0000 !important;
    background-color: #bf0000 !important;
    background-image: linear-gradient(135deg, #bf0000 0%, #a00000 100%) !important;
    box-shadow: 0 6px 8px -1px rgba(214, 0, 0, 0.4) !important;
}

table button:disabled,
td button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

table button:focus,
td button:focus {
    outline: none !important;
    box-shadow: none !important;
}


/* Header Responsive */
.header-desktop-nav {
    display: none;
}

.header-hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
}

/* Mobile nav backdrop */
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    opacity: 0;
    transition: opacity 300ms ease;
}

.mobile-nav-backdrop.is-open {
    display: block;
    opacity: 1;
}

/* Mobile slide-in panel */
.header-mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 78vw;
    max-width: 360px;
    height: 100dvh;
    background: var(--white);
    z-index: 101;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.header-mobile-menu.is-open {
    transform: translateX(0);
}

/* Panel close button */
.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1.5rem 1.5rem 1rem;
}

.mobile-menu-close button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0.25rem;
    line-height: 0;
}

/* Primary nav items — large uppercase bold */
.mobile-nav-primary {
    padding: 0.5rem 0;
    flex: 1;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: color var(--transition-base);
    text-decoration: none;
}

.mobile-nav-item:hover {
    color: var(--red);
}

.mobile-nav-item-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: color var(--transition-base);
}

.mobile-nav-item-toggle:hover {
    color: var(--red);
}

.mobile-nav-item-toggle .toggle-icon {
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;
    transition: transform 250ms ease;
    color: var(--gray-500);
}

.mobile-nav-item-toggle.expanded .toggle-icon {
    transform: rotate(45deg);
    color: var(--red);
}

/* Sub-items */
.mobile-nav-subitems {
    display: none;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.mobile-nav-subitems.is-open {
    display: block;
}

.mobile-nav-subitem {
    display: block;
    padding: 0.75rem 2.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-100);
    transition: color var(--transition-base), background-color var(--transition-base);
    text-decoration: none;
}

.mobile-nav-subitem:last-child {
    border-bottom: none;
}

.mobile-nav-subitem:hover {
    color: var(--red);
    background: var(--gray-100);
}

/* Secondary nav items — smaller, regular weight */
.mobile-nav-secondary {
    padding: 1.5rem 1.75rem 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-nav-secondary-item {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--gray-600);
    cursor: pointer;
    transition: color var(--transition-base);
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    padding: 0;
}

.mobile-nav-secondary-item:hover {
    color: var(--gray-900);
}

@media (min-width: 768px) {
    .header-desktop-nav {
        display: flex;
        align-items: center;
    }

    .header-hamburger-btn {
        display: none;
    }

    .header-mobile-menu,
    .mobile-nav-backdrop {
        display: none !important;
    }
}


/* Car Result Card — Responsive Layout (mobile only, desktop uses inline styles) */
@media (max-width: 820px) {
    /* Wrap so image+info stay in row 1, suppliers wrap to row 2 */
    .car-listing-columns {
        flex-wrap: wrap !important;
    }

    /* Image: smaller, stays in row 1 */
    .car-col-image {
        width: 110px !important;
        border-radius: 4px 0 0 0 !important;
        padding: 12px !important;
    }

    /* Info: fills remaining space in row 1 next to image */
    .car-col-info {
        flex: 1 !important;
        min-width: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e5e5 !important;
        padding: 12px !important;
    }

    /* Suppliers: full width, wraps to row 2 */
    .car-col-suppliers {
		flex: 0 0 100% !important;
        width: 100% !important;
        padding: 12px !important;
        border-top: 1px solid #e5e5e5 !important;
    }

    /* Supplier row: allow prices to wrap if needed */
    .supplier-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
}


/* Location Suggestions Dropdown */
#ploc-suggestions,
#dloc-suggestions {
    position: absolute;
    z-index: 50;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 15rem;
    overflow-y: auto;
    width: 100%;
    display: none;
}

#ploc-suggestions:not(.hidden),
#dloc-suggestions:not(.hidden) {
    display: block;
}

#ploc-suggestions > div,
#dloc-suggestions > div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color var(--transition-base);
    color: var(--gray-900);
}

#ploc-suggestions > div:last-child,
#dloc-suggestions > div:last-child {
    border-bottom: none;
}

#ploc-suggestions > div:hover,
#dloc-suggestions > div:hover,
#ploc-suggestions > div.bg-gray-100,
#dloc-suggestions > div.bg-gray-100 {
    background-color: var(--gray-100);
}

