/* CSS Variables for Premium Vintage Theme */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --text-primary: #f0ebd8;
    --text-secondary: #c4bca6;
    --accent: #d4af37; /* Gold */
    --accent-hover: #b8982f;
    --border: #333;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; }
a { color: var(--text-primary); text-decoration: none; transition: var(--transition); display: inline-block;}
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }

/* Mobile Menu & Headings */
.main-header {
    background: rgba(10, 10, 10, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.logo img { height: 50px; object-fit: contain; }
.main-nav { display: flex; gap: 2rem; }
.main-nav a { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 2px; padding: 15px 0;}
.main-nav a:hover, .main-nav a.active { color: var(--accent); }

.menu-toggle { display: none; background: none; border: none; font-size: 1.8rem; color: var(--accent); }
.hamburger::before { content: "☰"; }

.btn {
    display: inline-block;
    padding: 14px 28px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
}
.btn:hover, .btn-primary { background: var(--accent); color: var(--bg-primary); }
.btn-primary:hover { background: var(--accent-hover); }

/* Hero */
.hero {
    height: 80vh;
    min-height: 500px;
    background-image: linear-gradient(rgba(10, 10, 10, 0.7), rgba(10, 10, 10, 0.9)), url('https://images.unsplash.com/photo-1549646875-1262d4e6df5b?q=80&w=2000');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 2rem 5%;
}
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; color: var(--accent); }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; color: var(--text-secondary); max-width: 600px; margin-inline: auto; }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Sections */
.section { padding: 4rem 0; }
.section-title {
    text-align: center; font-size: 2.2rem; margin-bottom: 3rem;
    color: var(--accent); position: relative; padding-bottom: 1rem;
}
.section-title::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%); width: 60px; height: 2px; background: var(--accent);
}

/* History / Reviews */
.history-container { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.history-metrics { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.metric-box { 
    background: rgba(255, 255, 255, 0.03); 
    padding: 2rem; 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 4px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}
.metric-box h3 { font-size: 3rem; color: var(--accent); font-family: var(--font-heading); }
.metric-box p { color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; }

.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.review-card { 
    background: rgba(18, 18, 18, 0.7); 
    padding: 2rem; 
    border: 1px solid rgba(255,255,255,0.05); 
    backdrop-filter: blur(10px);
    border-radius: 4px;
}
.review-card .stars { color: var(--accent); font-size: 1.5rem; margin-bottom: 1rem; }
.review-card p { font-style: italic; color: var(--text-primary); margin-bottom: 1.5rem; font-size: 1.05rem; }
.review-card h4 { color: var(--text-secondary); font-size: 0.9rem; text-transform: uppercase; }

/* Car Cards */
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }
.car-card { background-color: var(--bg-secondary); border: 1px solid var(--border); overflow: hidden; cursor: pointer; }
.car-card-img-wrapper { height: 220px; overflow: hidden; }
.car-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.car-card:hover img { transform: scale(1.05); }
.car-card-content { padding: 1.5rem; }
.car-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.car-card .price { color: var(--accent); font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }
.car-card .metrics { display: flex; gap: 0.8rem; font-size: 0.85rem; color: var(--text-secondary); border-top: 1px solid var(--border); padding-top: 1rem; }

/* Car Details */
.car-details-wrapper { display: flex; min-height: calc(100vh - 80px); }
.car-details-visual { width: 50%; position: sticky; top: 80px; height: calc(100vh - 80px); }
.car-details-visual .main-image { width: 100%; height: 100%; object-fit: cover; }
.car-details-info { width: 50%; padding: 4rem; background-color: var(--bg-primary); }
.car-header h2 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.car-header .price { font-size: 2rem; color: var(--accent); margin-bottom: 2rem; }
.car-actions { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.action-btn { flex: 1; min-width: 200px; }

.photo-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 2rem; }
.gallery-thumb { height: 100px; width: 100%; object-fit: cover; border: 2px solid transparent; cursor: pointer; transition: 0.2s; }
.gallery-thumb:hover { border-color: var(--accent); }

.specs-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
.specs-table th, .specs-table td { padding: 1.2rem 0; border-bottom: 1px solid var(--border); text-align: left; }
.specs-table th { color: var(--text-secondary); font-weight: 400; width: 40%; }

.mobile-sticky-cta { display: none; }

/* Admin Panel */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;}
.admin-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
.admin-table th { background: var(--bg-secondary); color: var(--accent); }
.admin-modal-content { background: var(--bg-primary); max-width: 800px; margin: 0 auto; padding: 2rem; border: 1px solid var(--accent); position: relative; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text-primary); font-size: 2rem; cursor: pointer; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); }
.form-input { width: 100%; padding: 15px; background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-primary); font-family: var(--font-body); font-size: 1rem; }
.form-input:focus { outline: none; border-color: var(--accent); }
.financing-form-container { max-width: 800px; margin: 0 auto; background: var(--bg-secondary); padding: 3rem; border: 1px solid var(--border); }

/* Footer */
.main-footer { background: #050505; padding: 4rem 0 2rem; border-top: 1px solid var(--border); }
.footer-container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-container h3, .footer-container h4 { color: var(--accent); margin-bottom: 1rem; }
.footer-links a { display: block; margin-bottom: 0.8rem; color: var(--text-secondary); }
.footer-links a:hover { color: var(--accent); }

/* Mobile Optimizations (Strict Mobile-First Emphasis) */
@media (max-width: 900px) {
    .header-actions { display: none; }
    .main-nav { 
        display: none; flex-direction: column; position: absolute; top: 80px; left: 0; width: 100%; 
        background: rgba(10, 10, 10, 0.98); border-bottom: 1px solid var(--border); padding: 1rem; 
    }
    .menu-toggle { display: block; }

    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    .hero-ctas { flex-direction: column; width: 100%; }
    .hero-ctas .btn { width: 100%; }
    
    .history-container { grid-template-columns: 1fr; gap: 2rem;}
    .history-metrics { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
    @media (max-width: 500px) { .history-metrics { grid-template-columns: 1fr; } }
    .section-title::after { left: 0; transform: none; }
    .history-content .section-title { text-align: left; }
    .section-title { text-align: left; }

    /* Car Details Mobile Flow */
    .car-details-wrapper { flex-direction: column; }
    .car-details-visual { width: 100%; height: 40vh; position: relative; top: 0; }
    .car-details-info { width: 100%; padding: 2rem 5%; padding-bottom: 100px; /* Space for sticky CTA */ }
    .car-header h2 { font-size: 2rem; }
    
    .car-actions { display: none; } /* Hide main actions, show sticky */

    /* Sticky Action Bar on Mobile */
    .mobile-sticky-cta {
         display: flex;
         position: fixed;
         bottom: 0;
         left: 0;
         width: 100%;
         background: rgba(18, 18, 18, 0.85);
         border-top: 1px solid rgba(212, 175, 55, 0.3);
         padding: 15px;
         justify-content: space-between;
         align-items: center;
         z-index: 9999;
         box-shadow: 0 -5px 30px rgba(0,0,0,0.8);
         backdrop-filter: blur(20px);
         -webkit-backdrop-filter: blur(20px);
    }
    .mobile-sticky-cta .price { font-family: var(--font-heading); font-size: 1.5rem; color: var(--accent); font-weight: 700; margin: 0; }
    .mobile-sticky-cta .btn { padding: 12px 24px; }
    
    .footer-container { grid-template-columns: 1fr; gap: 2rem; }
    
    .admin-form-grid { grid-template-columns: 1fr; }
    .financing-form-container { padding: 1.5rem; }
}

/* Lightbox Gallery */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); display: none; justify-content: center; align-items: center; z-index: 10000;
}
.lightbox-content { max-width: 90%; max-height: 90vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 20px; right: 30px; color: white; font-size: 3rem; cursor: pointer; border: none; background: none;}
.lightbox-prev, .lightbox-next {
    position: absolute; top: 50%; transform: translateY(-50%); font-size: 3rem; color: white; cursor: pointer; user-select: none; background: none; border: none; padding: 20px;
}
.lightbox-prev:hover, .lightbox-next:hover, .lightbox-close:hover { color: var(--accent); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Loan Calculator */
.loan-calc-container {
    background: rgba(18, 18, 18, 0.6); 
    border: 1px solid rgba(255,255,255,0.05); 
    padding: 2rem; 
    margin-top: 3rem; 
    border-top: 3px solid var(--accent);
    backdrop-filter: blur(12px);
    border-radius: 4px;
}
.loan-calc-container h3 { margin-bottom: 1.5rem; color: var(--accent); }
.loan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem;}
.loan-result { text-align: center; padding: 1.5rem; background: rgba(10, 10, 10, 0.8); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 4px;}
.loan-result .monthly-payment { font-size: 2.5rem; color: var(--accent); font-family: var(--font-heading); margin-top: 0.5rem; }
.loan-summary { display: flex; justify-content: space-around; margin-top: 1rem; font-size: 0.85rem; color: var(--text-secondary); }

/* Rating Bars */
.rating-section { margin-top: 2.5rem; background: rgba(255,255,255,0.02); padding: 1.5rem; border: 1px solid rgba(255,255,255,0.05); border-radius: 4px;}
.rating-item { margin-bottom: 1rem; }
.rating-header { display: flex; justify-content: space-between; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; color: var(--text-secondary);}
.rating-bar-bg { width: 100%; height: 6px; background: #222; border-radius: 3px; overflow: hidden; }
.rating-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0; transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); }

/* Animations */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Map Container */
.map-container { width: 100%; height: 400px; border: 1px solid var(--border); margin-top: 3rem; }
.map-container iframe { width: 100%; height: 100%; border: none; }

/* -------------------
   FLOATING CTA
------------------- */
.floating-cta {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366; /* Vibrant Green */
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.2);
}

.floating-cta:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: #128C7E; /* Darker green on hover */
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 0 20px rgba(18, 140, 126, 0.6);
}

@media (max-width: 768px) {
    .floating-cta {
        bottom: 80px; /* Above the mobile sticky CTA if present */
        right: 20px;
        padding: 12px 20px;
    }
    .floating-cta .site-phone-text {
        font-size: 1.1rem;
    }
}
