/* ══════════════════════════════════════════════
   AutoLogic Bangladesh — Global Styles
   ══════════════════════════════════════════════ */

/* Variables */
:root {
    --primary: #3754a4;
    --primary-light: #4a6bc7;
    --primary-dark: #2a4185;
    --secondary: #1d3557;
    --dark: #0f172a;
    --dark-alt: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(55, 84, 164, 0.15);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ─── Double Layer Header ──────────────────── */
.main-header {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    transition: box-shadow 0.3s ease;
}
.car-selector-bar ~ .main-header {
    position: absolute;
    top: auto;
}
.main-header.is-sticky {
    position: fixed;
    top: 0;
}

.header-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

/* Top Layer */
.header-top { background: #ffffff; padding: 0.7rem 0; border-bottom: 1px solid #f1f5f9; }
.top-container { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.logo img { height: 48px; width: auto; object-fit: contain; display: block; border-radius: 4px; }

.header-search { flex: 1; max-width: 550px; }
.header-search form {
    display: flex; background: white; border: 1.5px solid var(--border);
    border-radius: 50px; overflow: hidden; height: 42px;
    transition: border-color 0.2s;
}
.header-search form:focus-within { border-color: var(--primary); }
.search-input-wrapper { flex: 1; display: flex; align-items: center; padding-left: 1rem; }
.search-input-wrapper .search-icon { color: var(--gray); margin-right: 0.5rem; font-size: 0.85rem; }
.search-input-wrapper input {
    border: none; outline: none; width: 100%; font-family: inherit; font-size: 0.9rem;
    background: transparent;
}
.btn-find {
    background: var(--primary); color: white; border: none;
    padding: 0 1.5rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 0.5rem;
    font-family: inherit; font-size: 0.85rem; transition: background 0.2s;
}
.btn-find:hover { background: var(--primary-dark); }

.header-contact { display: flex; align-items: center; }
.contact-text { display: flex; flex-direction: column; }
.contact-text small { font-size: 0.7rem; color: var(--gray-light); }
.contact-text span { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.5px; }

.top-actions { display: flex; gap: 1.25rem; align-items: center; }
.top-actions a { color: var(--dark); font-size: 1.15rem; position: relative; }
.top-actions a:hover { color: var(--primary); }
.sign-in-btn { font-size: 0.9rem !important; font-weight: 500; display: flex; align-items: center; gap: 0.4rem; }
.cart-count {
    position: absolute; top: -8px; right: -10px; background: var(--primary); color: white;
    font-size: 0.65rem; width: 18px; height: 18px; display: flex; align-items: center;
    justify-content: center; border-radius: 50%; font-weight: bold;
}

/* Bottom Layer */
.header-bottom { background: #ffffff; border-bottom: 2.5px solid var(--primary); }
.bottom-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.main-nav { display: none; }
@media (min-width: 992px) { .main-nav { display: block; } }
.nav-links { display: flex; gap: 2rem; }
.nav-links > li > a {
    font-weight: 600; font-size: 0.85rem; padding: 0.9rem 0; display: block;
    color: var(--dark); position: relative; text-transform: uppercase; letter-spacing: 0.3px;
}
.nav-links > li > a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2.5px;
    background: var(--primary); transition: width 0.3s ease;
}
.nav-links > li > a:hover::after, .nav-links > li > a.active::after { width: 100%; }
.nav-links > li > a:hover, .nav-links > li > a.active { color: var(--primary); }

.btn-track {
    background: var(--primary); color: white; padding: 0.5rem 1.2rem;
    border-radius: 6px; font-weight: 600; font-size: 0.82rem;
    display: flex; align-items: center; gap: 0.5rem; transition: background 0.2s;
}
.btn-track:hover { background: var(--primary-dark); }

/* ─── Mega Menu (Premium Rebuild) ────────── */
.bottom-container { position: relative; } /* Added relative parent */

.mega-dropdown { position: static; } /* Removed relative to allow full-width menu */

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 1px;
    transform: translateY(20px);
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 0 0 16px 16px;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 30px 60px -12px rgba(50, 50, 93, 0.25), 0 18px 36px -18px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1000;
}

.mega-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(to right, #f8fafc, #ffffff);
}

.mega-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mega-body {
    display: grid;
    grid-template-columns: 1fr 300px;
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    background: #fff;
}

.mega-card {
    transition: transform 0.2s ease;
}

.mega-card:hover {
    transform: translateX(5px);
}

.mega-card h4 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mega-card ul li {
    margin-bottom: 0.6rem;
}

.mega-card ul li a {
    font-size: 0.88rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.mega-card ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.mega-card ul li a i {
    font-size: 0.7rem;
    opacity: 0.5;
}

.mega-sidebar {
    background: #f8fafc;
    padding: 2rem;
    border-left: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.promo-card {
    padding: 1.5rem;
    border-radius: 12px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.dark-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.red-card {
    background: linear-gradient(135deg, var(--primary) 0%, #2a4185 100%);
}

.promo-card h5 {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.promo-card h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.promo-card .btn-white {
    background: #fff;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    width: 100%;
}

/* ─── Hero Section ─────────────────────────── */
.hero {
    min-height: 100vh; position: relative; display: flex; align-items: center;
    justify-content: center; padding: 160px 0 80px;
    background: url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&q=80&w=1920') no-repeat center center/cover;
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0.5) 100%);
}
.hero-content {
    position: relative; z-index: 10; max-width: 1320px; width: 100%; padding: 0 2rem;
}
.hero-badge {
    display: inline-block; background: rgba(55,84,164,0.08); color: var(--primary);
    padding: 0.5rem 1.25rem; border-radius: 50px; font-size: 0.88rem;
    font-weight: 600; margin-bottom: 1.5rem; border: 1px solid rgba(55,84,164,0.12);
}
.hero h1 {
    font-size: 3.5rem; line-height: 1.12; margin-bottom: 1.25rem;
    font-weight: 800; color: var(--dark); max-width: 600px;
}
.hero p { font-size: 1.1rem; color: var(--gray); max-width: 520px; margin-bottom: 2rem; line-height: 1.7; }
.hero-ctas { display: flex; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }

/* Vehicle Finder Panel */
.vehicle-finder {
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    padding: 1.5rem; max-width: 820px; box-shadow: var(--shadow-md);
}
.vehicle-finder form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.vehicle-finder .input-group { flex: 1; min-width: 140px; }
.vehicle-finder .input-group label {
    display: block; font-size: 0.78rem; font-weight: 600; color: var(--gray);
    margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.vehicle-finder .input-group select {
    width: 100%; padding: 0.85rem 1rem; background: #fff; border: 1.5px solid var(--border);
    color: var(--dark); border-radius: var(--radius); font-family: inherit;
    font-size: 0.92rem; cursor: pointer; transition: border-color 0.2s;
}
.vehicle-finder .input-group select:focus { outline: none; border-color: var(--primary); }

/* ─── CTA Banner ───────────────────────────── */
.cta-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 5rem 0; text-align: center; color: #fff; position: relative; overflow: hidden;
}
.cta-banner::before {
    content: ''; position: absolute; top: -50%; right: -10%; width: 500px; height: 500px;
    background: rgba(255,255,255,0.05); border-radius: 50%;
}
.cta-content { position: relative; z-index: 2; }
.cta-content h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.cta-content p { font-size: 1.1rem; color: rgba(255,255,255,0.8); margin-bottom: 2rem; }
.cta-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ─── Responsive ───────────────────────────── */
@media (max-width: 1200px) {
    .header-contact { display: none; }
}
@media (max-width: 991px) {
    .header-search { display: none; }
    .header-bottom .header-track { display: none; }
}
@media (max-width: 768px) {
    .hero { padding: 140px 0 60px; min-height: auto; }
    .hero h1 { font-size: 2.25rem; }
    .hero-ctas { flex-direction: column; }
    .hero-ctas .btn { width: 100%; }
    .vehicle-finder form { flex-direction: column; }
    .vehicle-finder .btn { width: 100%; }
    .cta-content h2 { font-size: 1.75rem; }
    .cta-actions { flex-direction: column; align-items: center; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 1.85rem; }
    .top-actions .sign-in-btn span { display: none; }
}