/* --- THEME: RED & BLACK --- */
:root {
    --bg-body: #050505;       /* Pitch Black */
    --bg-panel: #111111;      /* Dark Grey */
    --bg-card: #1a1a1a;
    --accent: #e60000;        /* RACING RED */
    --text-main: #ffffff;
    --text-muted: #999999;
    --border: #333333;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body { 
    font-family: 'Space Grotesk', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4 { text-transform: uppercase; letter-spacing: -1px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- UTILITIES --- */
.container { max-width: 96%; margin: auto; padding: 0 20px; }
.flex { display: flex; align-items: center; }
.flex-between { justify-content: space-between; }

/* LAYOUT */
.grid-layout { display: grid; grid-template-columns: 320px 1fr; gap: 30px; }

/* BUTTONS */
.btn { 
    background: var(--accent); color: white; padding: 12px 30px; 
    font-weight: 700; border: none; cursor: pointer; text-transform: uppercase;
    clip-path: polygon(10% 0, 100% 0, 100% 80%, 90% 100%, 0 100%, 0 20%);
    transition: 0.2s; display: inline-block; text-align: center;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0px white; background: #ff1a1a; }

.btn-outline { 
    background: transparent; color: var(--accent); border: 1px solid var(--accent); 
    padding: 10px 25px; font-weight: 600; cursor: pointer; text-transform: uppercase;
    display: inline-block; text-align: center;
}
.btn-outline:hover { background: var(--accent); color: white; }

/* --- TICKER TAPE --- */
.ticker-wrap {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 35px;
    background-color: var(--accent); color: white; 
    z-index: 999; border-top: 2px solid white;
    overflow: hidden; display: flex;
}

.ticker {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: tickerScroll 40s linear infinite;
}

.ticker-item {
    padding: 0 3rem;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0; 
}

@keyframes tickerScroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* --- HEADER --- */
header { 
    padding: 15px 0; 
    border-bottom: none; 
    display: grid;
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    position: relative;
}

.menu-tab {
    justify-self: start;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    transition: 0.3s;
}
.menu-tab:hover { color: var(--accent); }

.logo { 
    grid-column: 2; 
    text-align: center; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
    max-width: 100%;
}

.header-contact {
    grid-column: 3;
    justify-self: end;
    color: var(--accent);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    margin-right: -10px;
}
.header-contact i { margin-right: 8px; }
.header-contact:hover { color: white; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

/* --- OVERLAY MENU --- */
.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); 
    backdrop-filter: blur(5px);
    z-index: 2500;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.4s;
}
.menu-overlay.open { opacity: 1; pointer-events: all; }
.menu-link {
    font-size: 3rem; font-weight: 800; color: white; margin: 10px 0;
    text-transform: uppercase; position: relative;
}
.menu-link:hover { color: var(--accent); letter-spacing: 2px; }

.menu-close {
    position: absolute; top: 30px; right: 30px; font-size: 3rem; 
    color: var(--accent); cursor: pointer; 
    border: none; background: transparent; 
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.menu-close:hover { transform: scale(1.2); color: white; }

/* --- AI CHAT WIDGET --- */
.chat-widget-btn {
    position: fixed; bottom: 50px; right: 30px; 
    width: 60px; height: 60px; background: var(--accent); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; cursor: pointer; z-index: 1500;
    box-shadow: 0 0 20px rgba(230, 0, 0, 0.4);
    transition: 0.3s;
    animation: pulseGlow 2s infinite; 
}
.chat-widget-btn:hover { transform: scale(1.1); box-shadow: 0 0 30px rgba(230, 0, 0, 0.6); animation: none; }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(230, 0, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(230, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 0, 0, 0); }
}

.chat-tooltip {
    position: fixed; bottom: 65px; right: 100px;
    background: white; color: black; padding: 8px 12px;
    border-radius: 20px; font-size: 0.9rem; font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); z-index: 1499;
    animation: bounce 2s infinite; pointer-events: none;
}
.chat-tooltip::after {
    content: ''; position: absolute; right: -6px; top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 8px; border-style: solid;
    border-color: transparent transparent transparent white;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(0);}
    40% {transform: translateX(-5px);}
    60% {transform: translateX(-3px);}
}

.chat-window {
    position: fixed; bottom: 120px; right: 30px;
    width: 350px; height: 500px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: none; flex-direction: column;
    z-index: 1500;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.chat-header {
    padding: 15px; background: #000; border-bottom: 1px solid var(--border);
    border-radius: 12px 12px 0 0; display: flex; justify-content: space-between; align-items: center;
}
.chat-header span { font-weight: bold; color: white; font-size: 0.9rem; }
.chat-header i { color: var(--accent); margin-right: 5px; }

.chat-body {
    flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px;
}
.msg {
    max-width: 80%; padding: 10px 15px; font-size: 0.85rem; line-height: 1.4; border-radius: 10px;
}
.msg-bot {
    align-self: flex-start; background: #222; color: #ddd; border-bottom-left-radius: 2px;
}
.msg-user {
    align-self: flex-end; background: var(--accent); color: white; border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 15px; border-top: 1px solid var(--border); background: #000;
    display: flex; gap: 10px; border-radius: 0 0 12px 12px;
}
.chat-input-field {
    flex: 1; background: #111; border: 1px solid #333; color: white; padding: 10px;
    border-radius: 4px; font-family: inherit; font-size: 0.9rem;
}
.chat-input-field:focus { outline: 1px solid var(--accent); }
.chat-send-btn {
    background: var(--accent); color: white; border: none; padding: 0 15px;
    cursor: pointer; border-radius: 4px; transition: 0.2s;
}
.chat-send-btn:hover { background: #ff1a1a; }

/* --- HERO SECTION --- */
.hero { 
    background: linear-gradient(to right, #050505 10%, rgba(5,5,5,0.7) 40%, rgba(5,5,5,0) 100%), 
                url('images/carmyboy.png') right center/cover no-repeat;
    
    display: flex; 
    align-items: center;
    min-height: 85vh; 
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero-text { 
    background: transparent; 
    border: none;
    padding: 0 0 0 8%;
    max-width: 650px; 
    z-index: 2;
    position: relative;
}

/* HERO TEXT ANIMATIONS */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.hero h1 { 
    font-size: 4.5rem; 
    line-height: 1; 
    margin-bottom: 25px; 
    color: white;
    text-transform: uppercase;
    opacity: 0; 
    animation: slideInLeft 0.8s ease-out forwards;
    animation-delay: 0.2s;
}

.hero h4 {
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 15px;
    font-weight: 700;
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards;
    animation-delay: 0s;
}

.hero p {
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards;
    animation-delay: 0.4s;
}

.hero .btn {
    opacity: 0;
    animation: slideInLeft 0.8s ease-out forwards;
    animation-delay: 0.6s;
}

/* --- FEATURES SECTION --- */
.features-section {
    background: #0a0a0a;
    border-bottom: 1px solid var(--border);
    padding: 50px 0;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: center;
}
.feature-card {
    background: var(--bg-panel);
    padding: 30px;
    border: 1px solid var(--border);
    transition: 0.3s;
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 5px 20px rgba(230, 0, 0, 0.1);
}
.feature-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 15px;
}
.feature-card h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 10px;
}
.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- SCROLL REVEAL --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- MAIN LAYOUT --- */
.main-section { padding: 60px 0; }

/* SIDEBAR FILTERS */
.sidebar { position: sticky; top: 20px; height: fit-content; }
.filter-box { background: var(--bg-panel); padding: 25px; border: 1px solid var(--border); margin-bottom: 30px; }
.filter-title { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; display: block; font-weight: bold; letter-spacing: 1px; }
.filter-input { 
    width: 100%; background: black; border: 1px solid var(--border); color: white; 
    padding: 12px; margin-bottom: 15px; font-family: inherit; 
}
.filter-input:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.range-slider { width: 100%; margin: 15px 0; accent-color: var(--accent); }

/* PROCESS BOX */
.process-box { background: var(--bg-panel); padding: 25px; border: 1px solid var(--border); border-top: 4px solid var(--accent); margin-bottom: 30px; }
.process-steps { display: flex; justify-content: space-between; text-align: center; margin: 20px 0; border-bottom: 1px dashed #333; padding-bottom: 20px; }
.step-icon { font-size: 1.2rem; color: var(--accent); margin-bottom: 5px; display: block; }
.step-text { font-size: 0.7rem; color: #ccc; text-transform: uppercase; letter-spacing: 1px; }

/* CAR GRID */
.car-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 25px; 
}

.car-card { 
    background: var(--bg-panel); border: 1px solid var(--border); transition: 0.3s; 
    position: relative; display: flex; flex-direction: column; cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}
.car-card.show {
    opacity: 1;
    transform: translateY(0);
}

.car-card:hover { 
    border-color: var(--accent); 
    transform: translateY(-5px); 
    box-shadow: 0 10px 30px rgba(230, 0, 0, 0.15); 
}

.car-img-wrap { height: 280px; overflow: hidden; position: relative; }

.car-img-wrap img { 
    width: 100%; height: 100%; object-fit: cover; transition: 0.5s; 
    filter: brightness(80%); 
}
.car-card:hover img { transform: scale(1.05); filter: brightness(100%); }

.status-tag { 
    position: absolute; top: 10px; right: 10px; background: var(--accent); color: white; 
    padding: 5px 10px; font-size: 0.7rem; font-weight: bold; z-index: 2;
}
.car-data { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.car-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 5px; color: white; }
.car-price { font-size: 1.8rem; color: var(--accent); font-weight: 700; margin-bottom: 15px; }
.car-specs { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 0.85rem; color: #666;
    margin-top: auto; border-top: 1px solid #222; padding-top: 15px;
}
.spec-icon { color: var(--accent); margin-right: 5px; }

/* DETAIL VIEW */
#detail-view { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.95); z-index: 2000; overflow-y: auto; backdrop-filter: blur(5px);
}
.detail-wrapper { 
    max-width: 1100px; margin: 40px auto; background: var(--bg-body); 
    border: 1px solid var(--border); min-height: 80vh; position: relative;
}
.close-btn { 
    position: absolute; top: 20px; right: 20px; font-size: 3rem; color: var(--accent); 
    cursor: pointer; z-index: 100; background: transparent; width: 50px; height: 50px;
    border: none; 
    display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.close-btn:hover { transform: scale(1.1); color: white; }

.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; }
.detail-gallery { background: black; height: 100%; display: flex; flex-direction: column; }
.main-img { width: 100%; height: 500px; object-fit: contain; background: #050505; }
.thumb-row { display: flex; gap: 10px; padding: 20px; overflow-x: auto; background: #000; }

.thumb-img { width: 80px; height: 60px; object-fit: cover; opacity: 1; cursor: pointer; border: 1px solid #333; }
.thumb-img.active { opacity: 1; border-color: var(--accent); }

.detail-content { padding: 50px; border-left: 1px solid var(--border); }
.spec-table { width: 100%; margin: 30px 0; border-collapse: collapse; }
.spec-table td { padding: 15px 0; border-bottom: 1px solid #222; color: #888; font-size: 0.9rem; }
.spec-table td:last-child { color: white; text-align: right; font-weight: bold; }

/* --- EMAIL SECTION --- */
.email-section { padding: 80px 0; border-top: 1px solid var(--border); background: #080808; }
.email-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }

.email-form { 
    background: var(--bg-panel); padding: 40px; 
    border: 1px solid var(--border); border-top: 4px solid var(--accent); 
}
.form-group { margin-bottom: 20px; }
.form-input { 
    width: 100%; background: black; border: 1px solid var(--border); 
    padding: 15px; color: white; font-family: inherit; font-size: 0.9rem;
}
.form-input:focus { border-color: var(--accent); outline: none; }
.form-textarea { height: 120px; resize: vertical; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 80px 0 100px; background: #020202; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 50px; }
.footer-col h3 { color: white; margin-bottom: 10px; }
.footer-col h4 { color: white; margin-bottom: 25px; font-size: 1rem; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 5px; }
.footer-links li { margin-bottom: 15px; color: #666; font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }

/* FOOTER MAP */
.footer-map-wrapper {
    height: 200px; width: 100%;
    border: 1px solid var(--border); border-radius: 4px; overflow: hidden;
    margin-top: 10px;
}
.footer-map-iframe {
    width: 100%; height: 100%; border: 0;
    filter: grayscale(100%) invert(92%) contrast(83%); /* Dark Mode Look */
    transition: 0.3s;
}
.footer-map-wrapper:hover .footer-map-iframe { filter: none; } 

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 900px) {
    header { 
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 10px;
        padding: 15px 0;
    }

    .menu-tab { 
        position: absolute;
        top: 25px;
        left: 0;
    }
    .menu-tab i { font-size: 1.5rem; }
    .menu-tab span { display: none; }

    .logo { margin: 0 auto; }
    
    .logo-img { height: 45px; } 

    .header-contact { 
        margin: 0;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .header-contact span { display: inline-block; margin-right: 5px; } 
    
    .grid-layout { grid-template-columns: 1fr; gap: 40px; }
    
    .hero {
        background: linear-gradient(to top, #050505 20%, rgba(5,5,5,0.6) 60%, rgba(5,5,5,0.4) 100%), 
                    url('images/carmyboy.png') 65% center/cover no-repeat;
        align-items: flex-end; 
        min-height: 70vh;
        text-align: left;
    }

    .hero-text {
        padding: 40px 20px;
        width: 100%;
        max-width: 100%;
        background: linear-gradient(to top, #050505 0%, transparent 100%);
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .hero h1 { font-size: 2.8rem; }
    .hero p { display: none; }
    
    .detail-grid { grid-template-columns: 1fr; }
    .email-grid { grid-template-columns: 1fr; }
    
    .btn, .btn-outline { width: 100%; display: block; margin-bottom: 10px; margin-top: 15px; }
    .chat-input-area { padding-bottom: 20px; } 

    .chat-window { width: 100%; height: 60vh; right: 0; bottom: 0; border-radius: 12px 12px 0 0; }
    .close-btn { top: 10px; right: 10px; background: rgba(0,0,0,0.5); border-radius: 50%; width: 40px; height: 40px; font-size: 2rem; }

    .sidebar { display: contents; }
    .filter-box { order: 1; }
    #stock { order: 2; }
    .process-box { order: 3; }

    .car-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .car-img-wrap { height: 140px; }
    .car-data { padding: 10px; }
    .car-title { 
        font-size: 0.8rem;
        margin-bottom: 2px; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; 
    }
    .car-price { font-size: 1rem; margin-bottom: 5px; }
    .car-specs { display: none; } 
    .status-tag { font-size: 0.6rem; padding: 2px 6px; }
}