/* ==========================================================================
   1. PREMIUM DEALERSHIP DESIGN TOKENS
   ========================================================================== */
:root {
    --color-bg-deep: #0a0a0a;       
    --color-panel: #141414;         
    --color-panel-light: #1f1f1f;   
    --color-text-main: #ffffff;
    --color-text-muted: #a3a3a3;
    --color-accent: #fecb00;        
    --color-border: #262626;        
    --font-main: 'Montserrat', sans-serif;
    --max-width: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background-color: var(--color-bg-deep);
    color: var(--color-text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ==========================================================================
   2. DYNAMIC HEADER ENGINE
   ========================================================================== */
.main-header {
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-scrolled {
    background-color: rgba(5, 5, 5, 0.98);
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 50px;
}

/* THE MASSIVE OVERHANGING LOGO */
.logo-image-wrapper {
    position: absolute;
    top: 0.5rem;
    left: 50%; /* Centered on mobile */
    transform: translateX(-50%); /* Centered on mobile */
    width: 140px; /* Increased mobile size */
    z-index: 105;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.9));
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.logo { width: 100%; height: auto; display: block; object-fit: contain; }

/* Hide large logo on scroll */
.header-scrolled .logo-image-wrapper {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -15px) scale(0.9);
}

/* SLEEK CHROME TEXT SWAP */
.chrome-text-logo {
    display: none; /* Hidden by default */
    position: absolute; /* Centered on mobile */
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 1px;
    background: linear-gradient(to bottom, #ffffff 0%, #9ca3af 45%, #000000 50%, #e5e5e5 55%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0px 2px 2px rgba(0,0,0,0.8));
}

/* Reveal chrome text on scroll */
.header-scrolled .chrome-text-logo {
    display: block;
    animation: fadeInTextMobile 0.4s forwards;
}

@keyframes fadeInTextMobile {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeInText {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RIGHT SIDE: Nav & Buttons */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto; /* Push far right on mobile */
}

.desktop-nav { display: none; gap: 2.5rem; }
.desktop-nav a { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; transition: color 0.2s; }
.desktop-nav a:hover { color: var(--color-accent); }

.btn-header-call {
    display: flex; align-items: center; gap: 0.5rem;
    background-color: var(--color-panel-light); border: 1px solid var(--color-border);
    padding: 0.6rem 0.8rem; border-radius: 4px; font-weight: 600; font-size: 0.9rem;
    transition: background-color 0.2s;
    /* Pin the phone button to the left edge on mobile */
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 106;
}
.btn-header-call:hover { background-color: #2a2a2a; }
.btn-header-call .number { display: none; }

/* The new vibrant green action icon */
.btn-header-call .icon, .mobile-call-btn .icon {
    color: #10b981; 
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
}

.mobile-menu-toggle { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; display: block; }

/* MOBILE SLIDE-OUT DRAWER */
.mobile-menu-drawer {
    position: fixed; top: 0; right: -100%; width: 80%; max-width: 320px;
    height: 100vh; background-color: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(15px); border-left: 1px solid var(--color-border);
    z-index: 200; padding: 2rem 1.5rem; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.8);
}
.mobile-menu-drawer.active { right: 0; }

.mobile-menu-close {
    background: none; border: none; color: white; font-size: 1.8rem;
    cursor: pointer; position: absolute; top: 1.5rem; right: 1.5rem;
}

.mobile-nav { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 4rem; }
.mobile-nav a {
    font-size: 1.25rem; font-weight: 800; text-transform: uppercase;
    color: var(--color-text-main); border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem; transition: color 0.2s;
}
.mobile-nav a:hover { color: var(--color-accent); }

.mobile-call-btn {
    margin-top: 1rem; text-align: center; border: 1px solid #10b981 !important;
    border-radius: 6px; padding: 1.25rem !important; color: #10b981 !important;
    background: rgba(16, 185, 129, 0.05); display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}

/* ==========================================================================
   3. HERO CANVAS
   ========================================================================== */
.hero-canvas {
    position: relative;
    padding: 6rem 1.5rem 5rem 1.5rem;
    background: url('/assets/jjautos-bg-image.avif') center/cover no-repeat;
    border-bottom: 1px solid var(--color-border);
}

.bg-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.7) 100%); z-index: 1;
}

.hero-wrapper {
    position: relative; z-index: 2; max-width: var(--max-width); margin: 0 auto;
    display: flex; flex-direction: column; gap: 3rem;
}

.trust-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background-color: var(--color-panel); border: 1px solid var(--color-border);
    padding: 0.5rem 1rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; margin-bottom: 1.5rem;
}
.trust-badge .stars { color: var(--color-accent); }

.hero-brand-block h1 { font-size: 2.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 1rem; letter-spacing: -1px; }
.hero-brand-block .highlight { color: var(--color-accent); }
.hero-subtitle { font-size: 1.1rem; line-height: 1.6; color: var(--color-text-muted); margin-bottom: 2rem; }

.btn-primary {
    display: inline-flex; justify-content: center;
    background-color: #ffffff; color: #000000; padding: 1rem 2rem;
    font-weight: 800; font-size: 0.9rem; border-radius: 4px; letter-spacing: 1px; transition: background-color 0.2s;
}
.btn-primary:hover { background-color: var(--color-accent); }

/* Estimator */
.solid-estimator-card {
    background-color: var(--color-panel); border: 1px solid var(--color-border);
    border-radius: 8px; padding: 2rem 1.5rem; box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}
.card-header h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 0.25rem; }
.card-header p { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 1.5rem; }

.uk-licence-plate { display: flex; background-color: var(--color-accent); border-radius: 6px; overflow: hidden; border: 3px solid #000; margin-bottom: 1rem; }
.plate-eu-band { background-color: #003399; width: 40px; display: flex; align-items: center; justify-content: center; }
.gb-text { color: #fff; font-size: 0.7rem; font-weight: 800; }
.plate-input-field {
    flex-grow: 1; background: transparent; border: none; padding: 0.75rem;
    font-size: 1.6rem; font-weight: 900; color: #000; text-align: center;
    font-family: 'Impact', 'Arial Black', sans-serif; text-transform: uppercase;
}
.plate-input-field:focus { outline: none; }

.btn-calculate {
    width: 100%; padding: 1rem; background-color: #ffffff; color: #000;
    border: none; border-radius: 4px; font-weight: 800; font-size: 1rem; cursor: pointer; transition: background-color 0.2s;
}
.btn-calculate:hover { background-color: #e5e5e5; }

/* The New WhatsApp Specific Button Override */
.btn-whatsapp {
    background-color: #25D366; /* Official WhatsApp Green */
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    color: #ffffff;
}

.btn-whatsapp .wa-icon {
    flex-shrink: 0;
}

.secure-tags { display: flex; justify-content: space-between; margin-top: 1rem; font-size: 0.75rem; color: var(--color-text-muted); }

/* ==========================================================================
   4. STRUCTURED SERVICES MATRIX
   ========================================================================== */
.services-matrix-section { padding: 4rem 1.5rem; background-color: var(--color-bg-deep); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2rem; font-weight: 900; margin-bottom: 0.5rem; }
.section-header .highlight { color: var(--color-accent); }
.section-header p { color: var(--color-text-muted); font-size: 1rem; }

.matrix-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: var(--max-width); margin: 0 auto; }
.service-card {
    background-color: var(--color-panel); border: 1px solid var(--color-border); border-radius: 6px;
    padding: 1.5rem; display: flex; align-items: flex-start; transition: border-color 0.2s, background-color 0.2s;
}
.service-card:hover { border-color: #404040; background-color: var(--color-panel-light); }
.card-icon {
    font-size: 1.5rem; margin-right: 1.25rem; background-color: var(--color-bg-deep); border: 1px solid var(--color-border);
    height: 50px; width: 50px; display: flex; align-items: center; justify-content: center; border-radius: 4px; flex-shrink: 0;
}
.card-content h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.card-content p { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.5; }
.card-arrow { margin-left: auto; color: var(--color-text-muted); font-weight: bold; }
.service-card:hover .card-arrow { color: var(--color-accent); }

/* ==========================================================================
   5. MATTE DEALERSHIP FOOTER
   ========================================================================== */
.app-footer { background-color: var(--color-bg-deep); border-top: 1px solid var(--color-border); padding: 4rem 1.5rem 2rem 1.5rem; }
.footer-grid { display: flex; flex-direction: column; gap: 3rem; max-width: var(--max-width); margin: 0 auto; }
.footer-col h4 { font-size: 0.9rem; font-weight: 800; letter-spacing: 1px; color: var(--color-text-main); margin-bottom: 1.5rem; text-transform: uppercase; }

/* Massively Increased Footer Logo Height and Centered */
.footer-logo { height: 290px; width: auto; max-width: 100%; object-fit: contain; display: block; margin: 0 auto; }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.85rem; }
.footer-links a { color: var(--color-text-muted); font-size: 0.95rem; transition: color 0.2s, transform 0.2s; display: inline-block; }
.footer-links a:hover { color: var(--color-accent); transform: translateX(4px); }
.static-list li { color: var(--color-text-muted); font-size: 0.95rem; }

.hub-data { font-size: 1.25rem; color: var(--color-text-main); margin-bottom: 0.5rem; }
.hub-sub, .hub-hours { font-size: 0.95rem; line-height: 1.5; color: var(--color-text-muted); margin-bottom: 1rem; }

.footer-strip { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--color-border); font-size: 0.85rem; color: #737373; }
.strip-content { display: flex; flex-direction: column; gap: 1rem; max-width: var(--max-width); margin: 0 auto; }
.strip-legal a { color: #737373; transition: color 0.2s; }
.strip-legal a:hover { color: var(--color-accent); }

/* ==========================================================================
   6. DESKTOP GRID EXECUTION & NAVIGATION SLIDE
   ========================================================================== */
@media (min-width: 992px) {
    /* Header layout */
    .desktop-nav { display: flex; }
    .mobile-menu-toggle { display: none; }
    
    /* Reset absolute positioning so the phone button rejoins the nav flow on desktop */
    .btn-header-call { 
        position: relative; 
        left: auto; 
        top: auto; 
        transform: none; 
    }
    .btn-header-call .number { display: inline; }
    
    /* Reset Chrome Text to flow with nav on desktop */
    .chrome-text-logo { 
        position: relative; left: auto; transform: none; 
        font-size: 1.8rem; margin-left: 1rem; 
    }
    
    .header-scrolled .chrome-text-logo {
        animation: fadeInText 0.4s forwards;
    }

    /* The Massive Desktop Overhang (Reset to left side) */
    .logo-image-wrapper { 
        width: 220px; top: 0.5rem; left: 0; transform: none; 
    }
    
    .header-scrolled .logo-image-wrapper {
        transform: translateY(-15px) scale(0.9);
    }

    /* Push the Nav & Actions block away from the giant logo */
    .header-right { 
        margin-left: 240px; 
        transition: margin-left 0.4s ease; 
    }
    
    /* When scrolled, let the Nav slide left perfectly next to the Chrome text */
    .header-scrolled .header-right { margin-left: 2rem; }

    /* Hero layout */
    .hero-canvas { padding: 10rem 1.5rem 6rem 1.5rem; min-height: 80vh; display: flex; align-items: center; }
    .hero-wrapper { flex-direction: row; align-items: center; gap: 4rem; width: 100%; }
    
    .hero-brand-block { flex: 1.2; }
    .hero-brand-block h1 { font-size: 4rem; }
    .hero-subtitle { font-size: 1.2rem; max-width: 90%; }
    
    .hero-interface-block { flex: 0.8; max-width: 450px; }
    .solid-estimator-card { padding: 2.5rem 2rem; }
    .plate-input-field { font-size: 2rem; }

    /* Services Grid layout */
    .services-matrix-section { padding: 6rem 1.5rem; }
    .matrix-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

    /* Footer Grid */
    .app-footer { padding: 5rem 1.5rem 2rem 1.5rem; }
    .footer-grid { flex-direction: row; justify-content: space-between; gap: 2rem; }
    .footer-col { flex: 1; }
    .col-brand { flex: 1.5; }
    .strip-content { flex-direction: row; justify-content: space-between; align-items: center; }
}