/**
 * MG QUẢNG TRỊ - CORE DESIGN SYSTEM & MAIN STYLESHEET
 * Performance-driven, No Heavy CSS Frameworks, BEM Naming Convention
 */

/* ==========================================================================
   1. CSS VARIABLES (DESIGN SYSTEM)
   ========================================================================== */
:root {
    --mg-red: #d6001c;              /* MG Signature Crimson Red */
    --mg-red-dark: #b00017;
    --mg-red-light: #fff1f2;
    --mg-black: #121212;            /* Sporty Carbon Black */
    --mg-dark-slate: #1e1e1e;
    --mg-surface: #242424;
    --mg-gray-50: #f8fafc;
    --mg-gray-100: #f1f5f9;
    --mg-gray-200: #e2e8f0;
    --mg-gray-300: #cbd5e1;
    --mg-gray-500: #64748b;
    --mg-gray-700: #334155;
    --mg-gray-900: #0f172a;
    --mg-white: #ffffff;

    --mg-font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mg-font-body: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

    --mg-radius-sm: 4px;
    --mg-radius-md: 8px;
    --mg-radius-lg: 14px;
    --mg-radius-full: 9999px;

    --mg-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --mg-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --mg-shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --mg-shadow-red: 0 4px 16px rgba(214, 0, 28, 0.35);

    --mg-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --mg-container-width: 1240px;
}

/* ==========================================================================
   2. BASE RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--mg-font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--mg-gray-700);
    background-color: var(--mg-white);
    overflow-x: clip;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--mg-font-heading);
    font-weight: 700;
    color: var(--mg-black);
    line-height: 1.3;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--mg-transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
}

.mg-container {
    width: 100%;
    max-width: var(--mg-container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.text-center { text-align: center; }

/* ==========================================================================
   3. BUTTONS & UI COMPONENTS
   ========================================================================== */
.mg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: 0.938rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--mg-radius-sm);
    cursor: pointer;
    transition: var(--mg-transition);
    white-space: nowrap;
}

.mg-btn-primary {
    background-color: var(--mg-red);
    color: var(--mg-white);
    box-shadow: var(--mg-shadow-red);
}
.mg-btn-primary:hover {
    background-color: var(--mg-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 0, 28, 0.45);
}

.mg-btn-outline {
    background: transparent;
    color: var(--mg-black);
    border: 2px solid var(--mg-black);
}
.mg-btn-outline:hover {
    background: var(--mg-black);
    color: var(--mg-white);
    transform: translateY(-2px);
}

.mg-btn-white {
    background: var(--mg-white);
    color: var(--mg-black);
    box-shadow: var(--mg-shadow-md);
}
.mg-btn-white:hover {
    background: var(--mg-gray-100);
    transform: translateY(-2px);
}

.mg-btn-outline-white {
    background: transparent;
    color: var(--mg-white);
    border: 2px solid var(--mg-white);
}
.mg-btn-outline-white:hover {
    background: var(--mg-white);
    color: var(--mg-black);
}

.mg-btn-sm {
    padding: 8px 16px;
    font-size: 0.813rem;
}

.mg-btn-lg {
    padding: 15px 32px;
    font-size: 1rem;
}

.mg-btn-block {
    width: 100%;
}

.mg-btn-text {
    background: none;
    color: var(--mg-red);
    padding: 8px 12px;
}
.mg-btn-text:hover {
    text-decoration: underline;
}

/* ==========================================================================
   4. TOPBAR & HEADER
   ========================================================================== */
.mg-topbar {
    background-color: var(--mg-black);
    color: var(--mg-gray-300);
    font-size: 0.813rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mg-topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mg-topbar-announcement {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mg-badge-flash {
    background-color: var(--mg-red);
    color: var(--mg-white);
    padding: 2px 6px;
    border-radius: var(--mg-radius-sm);
    font-size: 0.688rem;
    font-weight: 800;
}

.mg-topbar-contact {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mg-topbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mg-topbar-hotline strong {
    color: var(--mg-red);
    font-size: 0.875rem;
}

/* Header */
.mg-header {
    background: var(--mg-white);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--mg-shadow-sm);
    transition: background-color 0.25s ease, box-shadow 0.25s ease, height 0.25s ease;
}

.mg-header.is-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Hỗ trợ hiển thị khi có Admin Bar của WordPress */
.admin-bar .mg-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .mg-header {
        top: 46px;
    }
}

.mg-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.mg-logo-img {
    height: 50px;
    width: auto;
    max-width: 100%;
    display: block;
}

.mg-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.mg-menu > .menu-item > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mg-font-heading);
    font-weight: 600;
    font-size: 0.938rem;
    color: var(--mg-black);
    position: relative;
    padding: 26px 0;
    transition: color 0.2s ease;
}

.mg-menu > .menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 18px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--mg-red);
    transition: var(--mg-transition);
}

.mg-menu > .menu-item > a:hover::after,
.mg-menu > .menu-item.current-menu-item > a::after {
    width: 100%;
}

.mg-menu > .menu-item:hover > a {
    color: var(--mg-red);
}

.mg-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mg-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    cursor: pointer;
}

.mg-mobile-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--mg-black);
    border-radius: 2px;
    transition: var(--mg-transition);
}

/* ==========================================================================
   5. MOBILE DRAWER NAVIGATION
   ========================================================================== */
.mg-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    transition: visibility 0.3s ease;
}

.mg-drawer.is-active {
    display: block;
    visibility: visible;
    pointer-events: auto;
}

.mg-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mg-drawer.is-active .mg-drawer-overlay {
    opacity: 1;
}

.mg-drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 88%;
    max-width: 400px;
    height: 100%;
    background: var(--mg-white);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: -4px 0 25px rgba(0,0,0,0.18);
}

.mg-drawer.is-active .mg-drawer-content {
    transform: translateX(0);
}

.mg-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--mg-gray-200);
}

.mg-drawer-logo img {
    height: 38px;
    width: auto;
    max-width: 100%;
    display: block;
}

.mg-drawer-close {
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: var(--mg-black);
    cursor: pointer;
}

.mg-drawer-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mg-mobile-menu-list li {
    border-bottom: 1px solid var(--mg-gray-100);
}

.mg-mobile-menu-list a {
    display: block;
    padding: 14px 0;
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: 1.063rem;
    color: var(--mg-black);
}

.mg-drawer-hotline {
    font-size: 0.938rem;
    margin-bottom: 8px;
}

.mg-drawer-hotline a {
    color: var(--mg-red);
    font-weight: 800;
    font-size: 1.125rem;
    display: block;
}

.mg-drawer-addr {
    font-size: 0.813rem;
    color: var(--mg-gray-500);
    margin-bottom: 20px;
}

/* ==========================================================================
   6. CINEMATIC FULL-BLEED AUTOMOTIVE HERO SLIDER (CHUẨN MGMOTOR.VN)
   ========================================================================== */
.mg-cinema-hero {
    position: relative;
    background: #090a0f;
    overflow: hidden;
    color: var(--mg-white);
    width: 100%;
}

.mg-hero-slides-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1920 / 840;
    max-height: 720px;
    min-height: 520px;
    background: #0b0c10;
    overflow: hidden;
}

@media (max-width: 991px) {
    .mg-hero-slides-wrapper {
        aspect-ratio: 16 / 9;
        min-height: 420px;
    }
}

@media (max-width: 768px) {
    .mg-hero-slides-wrapper {
        aspect-ratio: 9 / 14;
        max-height: 640px;
        min-height: 440px;
    }
}

.mg-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    z-index: 1;
}

.mg-hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.mg-hero-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

.mg-hero-picture {
    display: block;
    width: 100%;
    height: 100%;
}

.mg-hero-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}

.mg-hero-slide.is-active .mg-hero-banner-img {
    transform: scale(1.03);
}

/* Nút CTA Nổi Bật Trên Banner (Phong Cách MGMOTOR.VN) */
.mg-hero-slide-action {
    position: absolute;
    bottom: 50px;
    left: 80px;
    z-index: 5;
    pointer-events: auto;
}

@media (max-width: 991px) {
    .mg-hero-slide-action {
        bottom: 45px;
        left: 40px;
    }
}

@media (max-width: 768px) {
    .mg-hero-slide-action {
        bottom: 50px;
        left: 50%;
        transform: translateX(-50%);
        width: -webkit-max-content;
        width: -moz-max-content;
        width: max-content;
    }
}

.mg-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 18, 20, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    padding: 10px 24px;
    border-radius: var(--mg-radius-full);
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: 0.813rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.mg-banner-btn svg {
    color: var(--mg-red);
    transition: transform 0.3s ease;
}

.mg-hero-slide-link:hover .mg-banner-btn {
    background: var(--mg-red);
    border-color: var(--mg-red);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(225, 0, 18, 0.5);
}

.mg-hero-slide-link:hover .mg-banner-btn svg {
    color: #ffffff;
    transform: scale(1.15);
}

/* Nút Điều Hướng Trái / Phải (Slider Arrows) */
.mg-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(18, 18, 22, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.mg-slider-arrow.arrow-prev { left: 40px; }
.mg-slider-arrow.arrow-next { right: 40px; }

.mg-slider-arrow:hover {
    background: var(--mg-red);
    border-color: var(--mg-red);
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 24px rgba(225, 0, 18, 0.55);
}

@media (max-width: 991px) {
    .mg-slider-arrow {
        width: 40px;
        height: 40px;
    }
    .mg-slider-arrow.arrow-prev { left: 16px; }
    .mg-slider-arrow.arrow-next { right: 16px; }
}

@media (max-width: 576px) {
    .mg-slider-arrow {
        display: none;
    }
}

/* Thanh Phân Trang Tiến Độ (Line Pagination Chuẩn MGMOTOR.VN) */
.mg-slider-line-pagination {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 92%;
    padding: 6px 16px;
    border-radius: var(--mg-radius-full);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-line-item {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 6px 4px;
    outline: none;
}

.line-track {
    width: 38px;
    height: 3.5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: width 0.3s ease, background-color 0.3s ease;
}

@keyframes mgLineProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.line-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: var(--mg-red);
    border-radius: 4px;
}

.pagination-line-item.is-active .line-track {
    width: 55px;
    background: rgba(255, 255, 255, 0.45);
}

.pagination-line-item.is-active .line-fill {
    animation: mgLineProgress 5.5s linear forwards;
}

.mg-hero-slider-section:hover .pagination-line-item.is-active .line-fill {
    animation-play-state: paused;
}

.line-name {
    font-family: var(--mg-font-heading);
    font-size: 0.688rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.pagination-line-item.is-active .line-name {
    color: #ffffff;
}

.pagination-line-item:hover .line-name {
    color: #ffffff;
}

@media (max-width: 768px) {
    .line-name {
        display: none;
    }
    .mg-slider-line-pagination {
        gap: 8px;
        bottom: 14px;
        padding: 5px 12px;
    }
    .line-track {
        width: 20px;
        height: 3px;
    }
    .pagination-line-item.is-active .line-track {
        width: 32px;
    }
}

/* ==========================================================================
   6.1 QUICK ASSURANCE & SERVICE TICKER BAR
   ========================================================================== */
.mg-assurance-bar {
    background: #0f1218;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 22px 0;
    color: var(--mg-white);
}

.mg-assurance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: center;
}

.assurance-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.assurance-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--mg-radius-sm);
    background: rgba(214, 0, 28, 0.15);
    border: 1px solid rgba(214, 0, 28, 0.4);
    color: var(--mg-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assurance-text {
    display: flex;
    flex-direction: column;
}

.assurance-text strong {
    font-family: var(--mg-font-heading);
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--mg-white);
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.assurance-text span {
    font-size: 0.75rem;
    color: var(--mg-gray-400);
    line-height: 1.3;
}

/* ==========================================================================
   7. SECTION HEADERS & LINEUP TABS
   ========================================================================== */
.mg-section {
    padding: 80px 0;
}

.mg-section-header {
    margin-bottom: 50px;
}

.mg-section-subtitle {
    display: block;
    font-family: var(--mg-font-heading);
    font-weight: 800;
    font-size: 0.813rem;
    color: var(--mg-red);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.mg-section-title {
    font-size: 2.125rem;
    font-weight: 800;
    color: var(--mg-black);
    text-transform: uppercase;
}

.mg-title-divider {
    width: 60px;
    height: 3px;
    background-color: var(--mg-red);
    margin: 14px auto 16px;
    border-radius: 2px;
}

.mg-section-desc {
    font-size: 1rem;
    color: var(--mg-gray-500);
    max-width: 640px;
    margin: 0 auto;
}

/* Tabs */
.mg-filter-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.mg-tab-btn {
    padding: 10px 22px;
    background: var(--mg-gray-100);
    color: var(--mg-gray-700);
    border-radius: var(--mg-radius-full);
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--mg-transition);
}

.mg-tab-btn:hover {
    background: var(--mg-gray-200);
}

.mg-tab-btn.is-active {
    background: var(--mg-red);
    color: var(--mg-white);
    box-shadow: var(--mg-shadow-red);
}

/* ==========================================================================
   8. CAR GRID & STUDIO PODIUM SHOWROOM CARDS (CHUẨN MGMOTOR.VN)
   ========================================================================== */
.mg-showroom-lineup {
    background: #f8fafc;
    padding: 85px 0 95px;
}

.mg-car-grid,
.mg-podium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: stretch;
    padding: 10px 4px 20px;
}

.mg-car-card {
    background: var(--mg-white);
    border: 1px solid var(--mg-gray-200);
    border-radius: var(--mg-radius-md);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--mg-transition);
}

/* Studio Podium Showroom Card */
.mg-podium-card {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    background: var(--mg-white);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.mg-podium-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    border-color: rgba(214, 0, 28, 0.35);
}

.mg-card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px 0;
    height: 42px;
    box-sizing: border-box;
    z-index: 3;
}

.mg-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mg-card-category-tag {
    font-family: var(--mg-font-heading);
    font-size: 0.688rem;
    font-weight: 800;
    color: var(--mg-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--mg-gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.mg-badge {
    padding: 4px 8px;
    border-radius: var(--mg-radius-sm);
    font-family: var(--mg-font-heading);
    font-size: 0.688rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.badge-ev {
    background: #0284c7;
    color: #ffffff;
}

.badge-promo {
    background: var(--mg-red);
    color: #ffffff;
}

/* Studio Stage Podium Media - Clean studio floor without double fake smudge shadow */
.mg-card-media-stage {
    position: relative;
    padding: 18px 16px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 70%, rgba(241, 245, 251, 0.95) 0%, rgba(255, 255, 255, 0) 72%);
    height: 200px;
    box-sizing: border-box;
    overflow: hidden;
}

.mg-card-car-render {
    max-height: 165px;
    width: 90%;
    max-width: 320px;
    object-fit: contain;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
}

.mg-podium-card:hover .mg-card-car-render {
    transform: scale(1.05) translateY(-3px);
}

.mg-card-body {
    padding: 14px 20px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
}

.mg-card-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 48px;
    box-sizing: border-box;
}

.mg-card-title-group {
    flex: 1;
    min-width: 0;
}

.mg-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--mg-black);
    line-height: 1.25;
    margin: 0;
}

.mg-card-title a {
    color: var(--mg-black);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mg-card-title a:hover {
    color: var(--mg-red);
}

.mg-card-price-row {
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}

.mg-card-price-row .price-prefix {
    display: block;
    font-size: 0.625rem;
    color: var(--mg-gray-500);
    text-transform: uppercase;
    line-height: 1.2;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.mg-card-price-row .price-value {
    font-family: var(--mg-font-heading);
    font-size: 1.125rem;
    font-weight: 900;
    color: var(--mg-red);
    line-height: 1.2;
}

/* Color Swatches */
.mg-card-color-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 18px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.mg-card-color-swatches .color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    transition: transform 0.2s ease;
}

.mg-card-color-swatches .color-dot:hover {
    transform: scale(1.3);
}

.mg-card-color-swatches .color-more {
    font-size: 0.688rem;
    font-weight: 700;
    color: var(--mg-gray-500);
    margin-left: 2px;
}

/* Specs Ticker (Strict 3-column equal split, no overflow, no label wrapping) */
.mg-card-specs-ticker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--mg-radius-sm);
    padding: 8px 6px;
    margin-bottom: 12px;
    min-height: 48px;
    box-sizing: border-box;
}

.mg-card-specs-ticker .spec-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    min-width: 0;
    padding: 0 4px;
}

.mg-card-specs-ticker .spec-col:not(:last-child) {
    border-right: 1px solid #e2e8f0;
}

.mg-card-specs-ticker .spec-label {
    font-size: 0.688rem;
    color: var(--mg-gray-500);
    text-transform: uppercase;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.mg-card-specs-ticker .spec-data {
    font-family: var(--mg-font-heading);
    font-size: 0.813rem;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gift Badge (Cố định 38px height, 1 line với ellipsis) */
.mg-card-gift-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.775rem;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--mg-radius-sm);
    padding: 7px 10px;
    margin-bottom: 14px;
    height: 38px;
    box-sizing: border-box;
    overflow: hidden;
}

.mg-card-gift-badge.is-default {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

.mg-card-gift-badge svg {
    color: #d97706;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.mg-card-gift-badge.is-default svg {
    color: #64748b;
}

.mg-card-gift-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    flex: 1;
}

/* Card Action Buttons (Anchor to bottom) */
.mg-card-action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
}

.mg-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: var(--mg-radius-sm);
    font-family: var(--mg-font-heading);
    font-size: 0.813rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--mg-transition);
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    text-decoration: none;
}

.mg-btn-action.btn-explore {
    background: #111827;
    color: #ffffff;
    border: 1.5px solid #111827;
}

.mg-btn-action.btn-explore:hover {
    background: var(--mg-red);
    border-color: var(--mg-red);
    box-shadow: var(--mg-shadow-red);
    transform: translateY(-2px);
}

.mg-btn-action.btn-explore svg {
    transition: transform 0.2s ease;
}

.mg-btn-action.btn-explore:hover svg {
    transform: translateX(3px);
}

.mg-btn-action.btn-drive {
    background: transparent;
    color: var(--mg-red);
    border: 1.5px solid var(--mg-red);
}

.mg-btn-action.btn-drive:hover {
    background: var(--mg-red);
    color: #ffffff;
    box-shadow: var(--mg-shadow-red);
    transform: translateY(-2px);
}

/* ==========================================================================
   8.1 BRITISH HERITAGE & RACING DNA STORY BLOCK (CHUẨN MGMOTOR.VN)
   ========================================================================== */
.mg-heritage-section {
    position: relative;
    background: #0b0d12;
    color: var(--mg-white);
    padding: 95px 0 100px;
    overflow: hidden;
}

.mg-heritage-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 50%, rgba(214, 0, 28, 0.16) 0%, transparent 60%);
    pointer-events: none;
}

.mg-heritage-container {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.mg-heritage-narrative {
    max-width: 620px;
}

.mg-badge-outline {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid rgba(214, 0, 28, 0.6);
    color: #ff4b60;
    font-family: var(--mg-font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    border-radius: var(--mg-radius-sm);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.mg-heritage-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--mg-white);
    margin-bottom: 16px;
}

.mg-heritage-title .text-red {
    color: var(--mg-red);
}

.mg-title-divider.left {
    margin: 14px 0 22px;
}

.mg-heritage-text {
    font-size: 1rem;
    color: var(--mg-gray-300);
    line-height: 1.7;
    margin-bottom: 30px;
}

.mg-heritage-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 35px;
}

.mg-heritage-stats .stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 14px;
    border-radius: var(--mg-radius-sm);
    text-align: center;
    backdrop-filter: blur(8px);
}

.mg-heritage-stats .stat-card .stat-num {
    display: block;
    font-family: var(--mg-font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--mg-red);
    line-height: 1.1;
    margin-bottom: 6px;
}

.mg-heritage-stats .stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--mg-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mg-heritage-actions {
    display: flex;
    gap: 14px;
}

.mg-heritage-visual .heritage-card-box {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.heritage-pill-feature {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 22px;
    border-radius: var(--mg-radius-md);
    backdrop-filter: blur(10px);
    transition: var(--mg-transition);
}

.heritage-pill-feature:hover {
    background: rgba(214, 0, 28, 0.08);
    border-color: rgba(214, 0, 28, 0.35);
    transform: translateX(6px);
}

.heritage-pill-feature .feat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--mg-radius-sm);
    background: rgba(214, 0, 28, 0.15);
    border: 1px solid rgba(214, 0, 28, 0.35);
    color: var(--mg-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.heritage-pill-feature .feat-desc strong {
    display: block;
    font-family: var(--mg-font-heading);
    font-size: 0.938rem;
    font-weight: 800;
    color: var(--mg-white);
    margin-bottom: 4px;
}

.heritage-pill-feature .feat-desc p {
    font-size: 0.813rem;
    color: var(--mg-gray-400);
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   9. MG CARE CARDS
   ========================================================================== */
.mg-care-section {
    background: var(--mg-gray-50);
}

.mg-care-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.mg-care-card {
    background: var(--mg-white);
    padding: 30px 24px;
    border-radius: var(--mg-radius-md);
    box-shadow: var(--mg-shadow-sm);
    border: 1px solid var(--mg-gray-200);
    transition: var(--mg-transition);
}

.mg-care-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mg-shadow-md);
    border-color: var(--mg-red);
}

.care-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--mg-radius-md);
    background: var(--mg-red-light);
    color: var(--mg-red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.care-title {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.care-desc {
    font-size: 0.875rem;
    color: var(--mg-gray-500);
    line-height: 1.6;
}

/* ==========================================================================
   10. LOCATION CARD
   ========================================================================== */
.mg-location-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    background: var(--mg-white);
    border-radius: var(--mg-radius-md);
    overflow: hidden;
    box-shadow: var(--mg-shadow-md);
    border: 1px solid var(--mg-gray-200);
}

.mg-location-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mg-location-tag {
    font-family: var(--mg-font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--mg-red);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.mg-location-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.mg-location-details {
    margin-bottom: 30px;
}

.mg-location-details li {
    margin-bottom: 14px;
    font-size: 0.938rem;
}

.mg-location-details strong {
    display: block;
    color: var(--mg-black);
    font-size: 0.813rem;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.mg-hl-big {
    font-size: 1.375rem;
    font-weight: 900;
    color: var(--mg-red);
}

.mg-location-map iframe {
    width: 100%;
    height: 100%;
    min-height: 380px;
    border: none;
}

/* ==========================================================================
   11. FOOTER
   ========================================================================== */
.mg-footer {
    background: var(--mg-black);
    color: var(--mg-gray-300);
    padding: 70px 0 0;
}

.mg-footer-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-bottom: 60px;
}

.mg-footer-logo img {
    filter: brightness(0) invert(1);
    height: 48px;
    width: auto;
    max-width: 100%;
    margin-bottom: 18px;
    display: block;
}

.mg-footer-about {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--mg-gray-300);
    margin-bottom: 20px;
}

.mg-footer-contacts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.mg-footer-contacts svg {
    color: var(--mg-red);
    flex-shrink: 0;
    margin-top: 3px;
}

.mg-link-hotline {
    color: var(--mg-red);
    font-size: 1rem;
}

.mg-footer-social {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--mg-radius-sm);
    background: var(--mg-dark-slate);
    color: var(--mg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--mg-transition);
}

.social-icon:hover {
    background: var(--mg-red);
    transform: translateY(-2px);
}

.mg-footer-title {
    color: var(--mg-white);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.mg-footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--mg-red);
}

.mg-footer-menu li {
    margin-bottom: 10px;
}

.mg-footer-menu a {
    font-size: 0.875rem;
    color: var(--mg-gray-300);
}

.mg-footer-menu a:hover {
    color: var(--mg-white);
    padding-left: 5px;
}

.mg-footer-hours {
    font-size: 0.875rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

.mg-footer-cta-box {
    background: var(--mg-dark-slate);
    padding: 16px;
    border-radius: var(--mg-radius-sm);
    margin-top: 20px;
}

.mg-footer-cta-box p {
    font-size: 0.813rem;
    margin-bottom: 10px;
}

.mg-copyright-bar {
    background: #090909;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.813rem;
    color: var(--mg-gray-500);
}

.mg-copyright-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mg-copyright-dev a {
    color: var(--mg-red);
}

/* ==========================================================================
   12. BREADCRUMBS
   ========================================================================== */
.mg-breadcrumbs {
    background: var(--mg-gray-50);
    padding: 12px 0;
    border-bottom: 1px solid var(--mg-gray-200);
    font-size: 0.813rem;
}

.mg-breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mg-breadcrumb-item::after {
    content: '/';
    margin-left: 8px;
    color: var(--mg-gray-300);
}

.mg-breadcrumb-item:last-child::after {
    display: none;
}

.mg-breadcrumb-item.active {
    color: var(--mg-red);
    font-weight: 700;
}

/* ==========================================================================
   13. MODAL POPUP (TEST DRIVE / QUOTE)
   ========================================================================== */
.mg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: var(--mg-transition);
}

.mg-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.mg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.mg-modal-dialog {
    position: relative;
    z-index: 2;
    background: var(--mg-white);
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--mg-radius-md);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: mgModalZoom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes mgModalZoom {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.mg-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 18px;
    background: transparent;
    font-size: 32px;
    color: var(--mg-white);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.mg-modal-header {
    background: var(--mg-red);
    color: var(--mg-white);
    padding: 30px 30px 24px;
    text-align: center;
}

.mg-modal-sub {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.mg-modal-title {
    color: var(--mg-white);
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.mg-modal-desc {
    font-size: 0.875rem;
    opacity: 0.92;
}

.mg-modal-body {
    padding: 30px;
}

.mg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.mg-form-group {
    margin-bottom: 18px;
}

.mg-form-group label {
    display: block;
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: 0.813rem;
    color: var(--mg-black);
    margin-bottom: 6px;
}

.mg-form-group .req {
    color: var(--mg-red);
}

.mg-input, .mg-select, .mg-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--mg-gray-300);
    border-radius: var(--mg-radius-sm);
    background: var(--mg-gray-50);
    font-size: 0.938rem;
    color: var(--mg-black);
    transition: var(--mg-transition);
}

.mg-input:focus, .mg-select:focus, .mg-textarea:focus {
    border-color: var(--mg-red);
    background: var(--mg-white);
    box-shadow: 0 0 0 3px rgba(214, 0, 28, 0.15);
}

.mg-textarea {
    resize: vertical;
}

.mg-form-alert {
    padding: 12px 16px;
    border-radius: var(--mg-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.mg-form-footer {
    text-align: center;
    margin-top: 20px;
}

.mg-hotline-quick {
    font-size: 0.875rem;
    margin-bottom: 6px;
}

.mg-hotline-quick .hotline-link {
    color: var(--mg-red);
    font-weight: 800;
}

.mg-privacy-note {
    font-size: 0.75rem;
    color: var(--mg-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* ==========================================================================
   14. QUICK CONTACT SPEED DIAL (DESKTOP)
   ========================================================================== */
.mg-quick-contact-bar {
    position: fixed;
    right: 28px;
    bottom: 35px;
    z-index: 999;
    width: 58px;
    height: 58px;
    border-radius: 50%;
}

/* Danh sách menu các nút bung mở (Định vị tuyệt đối phía trên nút trigger) */
.mg-qc-menu {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    width: max-content;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
    transform: translateY(16px) scale(0.92);
    transform-origin: bottom right;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.25s;
}

/* Cầu nối vô hình giúp rê chuột từ trigger lên menu không bị ngắt quãng */
.mg-qc-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 18px;
    display: block;
}

/* Chỉ hiển thị và nhận con trỏ chuột khi hover trực tiếp vào nút hoặc menu */
.mg-quick-contact-bar:hover .mg-qc-menu,
.mg-quick-contact-bar.is-active .mg-qc-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
    transform: translateY(0) scale(1);
}

/* Từng nút con dạng viên thuốc sang trọng */
.mg-qc-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--mg-white);
    padding: 6px 18px 6px 6px;
    border-radius: var(--mg-radius-full);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.25s ease;
    will-change: transform, opacity;
}

.mg-qc-btn:hover {
    transform: translateX(-6px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Hiệu ứng trượt xuất hiện tuần tự */
.mg-quick-contact-bar .qc-testdrive { transition-delay: 0.02s; }
.mg-quick-contact-bar .qc-zalo      { transition-delay: 0.05s; }
.mg-quick-contact-bar .qc-hotline   { transition-delay: 0.08s; }

.qc-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-white);
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.qc-hotline .qc-icon   { background: linear-gradient(135deg, #22c55e, #15803d); }
.qc-zalo .qc-icon      { background: linear-gradient(135deg, #0088ff, #0055d4); }
.qc-testdrive .qc-icon { background: linear-gradient(135deg, #ea0022, #b00017); }

.qc-zalo-txt {
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.qc-label {
    font-family: var(--mg-font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--mg-black);
    letter-spacing: 0.2px;
}

/* Nút Trigger tròn chính (FAB) - Kích thước chuẩn 58x58px */
.mg-qc-trigger {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ea0022 0%, #b00017 100%);
    border: none;
    outline: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(234, 0, 34, 0.42), 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-white);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s ease;
}

.mg-qc-trigger:hover,
.mg-quick-contact-bar.is-active .mg-qc-trigger {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(234, 0, 34, 0.58);
}

/* Đổi icon mượt mà khi hover/mở */
.qc-trigger-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.qc-icon-open {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.qc-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.mg-quick-contact-bar:hover .qc-icon-open,
.mg-quick-contact-bar.is-active .qc-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.mg-quick-contact-bar:hover .qc-icon-close,
.mg-quick-contact-bar.is-active .qc-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Hiệu ứng rung chuông nhẹ khi ở trạng thái nghỉ */
@keyframes qcPhoneWiggle {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-12deg); }
    20%, 40% { transform: rotate(12deg); }
    50%      { transform: rotate(0deg); }
}

.qc-icon-open svg {
    animation: qcPhoneWiggle 3.5s ease-in-out infinite;
}

.mg-quick-contact-bar:hover .qc-icon-open svg,
.mg-quick-contact-bar.is-active .qc-icon-open svg {
    animation: none;
}

/* Sóng xung kích lan tỏa (Pulse Wave Rings) - Tuyệt đối không nhận tương tác chuột */
.qc-pulse-wave {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(234, 0, 34, 0.6);
    pointer-events: none !important;
    animation: qcPulseWave 2.4s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.qc-pulse-wave.ring-2 {
    animation-delay: 1.2s;
}

@keyframes qcPulseWave {
    0% {
        transform: scale(0.95);
        opacity: 0.85;
    }
    100% {
        transform: scale(1.68);
        opacity: 0;
    }
}

.mg-quick-contact-bar:hover .qc-pulse-wave,
.mg-quick-contact-bar.is-active .qc-pulse-wave {
    opacity: 0;
    animation: none;
}


/* ==========================================================================
   MEGA MENU & SUBMENU DÒNG XE MG (AUTOMOTIVE MEGA DROPDOWN)
   ========================================================================== */

/* Badge số lượng xe trên menu */
.mg-menu-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mg-red);
    color: #ffffff;
    font-size: 0.688rem;
    font-weight: 800;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 10px;
    letter-spacing: 0;
    transform: translateY(-1px);
}

/* Chevron Icon */
.mg-menu-chevron {
    transition: transform 0.25s ease;
    color: var(--mg-gray-500);
}

.mg-has-megamenu:hover .mg-menu-chevron,
.mg-has-megamenu.is-active .mg-menu-chevron {
    transform: rotate(180deg);
    color: var(--mg-red);
}

/* Khối Mega Menu Container */
.mg-megamenu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #f1f5f9;
    border-bottom: 3px solid var(--mg-red);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.25s;
}

/* Cầu nối hover vô hình giữa thanh menu và dropdown */
.mg-megamenu-bridge {
    position: absolute;
    top: -24px;
    left: 0;
    right: 0;
    height: 24px;
    background: transparent;
}

/* Hiển thị Mega Menu khi Hover hoặc Active */
.mg-has-megamenu.is-active .mg-megamenu-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.mg-megamenu-inner {
    padding: 24px 20px 20px;
}

/* Reset các thẻ link bên trong Mega Menu để không kế thừa underline của menu cấp 1 */
.mg-megamenu-dropdown a::after {
    display: none !important;
}

/* Top bar: Tabs phân khúc xe */
.mg-megamenu-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef2f6;
}

.mg-megamenu-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mg-mm-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-family: var(--mg-font-heading);
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--mg-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mg-mm-tab:hover {
    background: #edf2f7;
    color: var(--mg-black);
    border-color: #cbd5e1;
}

.mg-mm-tab.is-active {
    background: var(--mg-red);
    border-color: var(--mg-red);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(214, 0, 28, 0.28);
}

.mg-mm-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.688rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

.mg-mm-tab.is-active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.mg-mm-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mg-font-heading);
    font-size: 0.813rem;
    font-weight: 700;
    color: var(--mg-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    white-space: nowrap;
}

.mg-mm-view-all:hover {
    color: var(--mg-red-dark);
    transform: translateX(2px);
}

/* Lưới Cards Dòng Xe Mega Menu */
.mg-megamenu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px 2px;
}

@media (max-width: 1200px) {
    .mg-megamenu-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.mg-megamenu-grid::-webkit-scrollbar {
    width: 5px;
}

.mg-megamenu-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.mg-megamenu-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.mg-megamenu-grid::-webkit-scrollbar-thumb:hover {
    background: var(--mg-red);
}

/* Card Xe Trong Mega Menu */
.mg-mm-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    padding: 12px 14px 10px;
    position: relative;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.mg-mm-card:hover {
    transform: translateY(-4px);
    border-color: #cbd5e1;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

/* Badge */
.mg-mm-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    line-height: 1.2;
    z-index: 2;
    letter-spacing: 0.4px;
}

.mg-mm-badge.is-ev {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.mg-mm-badge.is-hot {
    background: var(--mg-red);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(214, 0, 28, 0.3);
}

.mg-mm-badge.is-new {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

/* Ảnh xe */
.mg-mm-thumb {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 6px;
    overflow: hidden;
}

.mg-mm-thumb img {
    max-height: 82px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
}

.mg-mm-card:hover .mg-mm-thumb img {
    transform: scale(1.06);
}

/* Info */
.mg-mm-info {
    margin-top: 4px;
}

.mg-mm-meta {
    margin-bottom: 2px;
}

.mg-mm-cat {
    font-size: 0.688rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

.mg-mm-title {
    font-family: var(--mg-font-heading);
    font-size: 0.938rem;
    font-weight: 800;
    color: var(--mg-black);
    margin: 2px 0 6px;
    line-height: 1.25;
    transition: color 0.2s ease;
}

.mg-mm-card:hover .mg-mm-title {
    color: var(--mg-red);
}

.mg-mm-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.mg-mm-price-label {
    color: #64748b;
    font-size: 0.75rem;
}

.mg-mm-price {
    font-family: var(--mg-font-heading);
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--mg-red);
}

/* Action CTA */
.mg-mm-action {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #f1f5f9;
    display: flex;
    justify-content: flex-end;
}

.mg-mm-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    transition: color 0.2s, transform 0.2s;
}

.mg-mm-card:hover .mg-mm-cta {
    color: var(--mg-red);
    transform: translateX(3px);
}

/* Footer Mega Menu */
.mg-megamenu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    padding: 12px 18px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.mg-mm-quicklinks {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.mg-mm-ql-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mg-font-heading);
    font-size: 0.813rem;
    font-weight: 700;
    color: var(--mg-gray-800);
    text-decoration: none;
    transition: color 0.2s;
}

.mg-mm-ql-item svg {
    color: var(--mg-red);
    flex-shrink: 0;
}

.mg-mm-ql-item:hover {
    color: var(--mg-red);
}

.mg-mm-cta-box .mg-btn {
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.813rem;
}

/* ==========================================================================
   MOBILE DRAWER CARS ACCORDION SUBMENU
   ========================================================================== */
.mg-mobile-has-submenu {
    border-bottom: 1px solid var(--mg-gray-100);
}

.mg-mobile-parent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--mg-font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--mg-black);
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

.mg-mobile-parent-row:hover,
.mg-mobile-parent-row:active,
.mg-mobile-has-submenu.is-expanded .mg-mobile-parent-row {
    color: var(--mg-red);
}

.mg-mobile-parent-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mg-m-count-badge {
    background: var(--mg-red);
    color: #ffffff;
    font-size: 0.688rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.2;
}

.mg-mobile-sub-toggle-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mg-gray-700);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    flex-shrink: 0;
}

.mg-mobile-has-submenu.is-expanded .mg-mobile-sub-toggle-icon {
    transform: rotate(180deg);
    color: var(--mg-red);
}

/* Mobile Accordion Content */
.mg-mobile-has-submenu .mg-mobile-car-submenu {
    list-style: none;
    padding: 0 0 10px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 2000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.mg-mobile-has-submenu:not(.is-expanded) .mg-mobile-car-submenu {
    max-height: 0;
    opacity: 0;
    padding-bottom: 0;
    pointer-events: none;
}

/* Item Xe Mobile */
.mg-mobile-car-item {
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #edf2f7;
    transition: background 0.2s, border-color 0.2s;
}

.mg-mobile-car-item:active {
    background: #edf2f7;
    border-color: #cbd5e1;
}

.mg-mobile-car-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 8px 10px !important;
    text-decoration: none;
    min-height: 52px;
}

.mg-m-car-thumb {
    width: 58px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    padding: 2px;
}

.mg-m-car-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mg-m-car-info {
    flex: 1;
    min-width: 0;
}

.mg-m-car-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.mg-m-car-title {
    font-family: var(--mg-font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--mg-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.mg-m-car-badge {
    font-size: 0.563rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    line-height: 1.2;
    text-transform: uppercase;
    flex-shrink: 0;
}

.mg-m-car-badge.is-ev {
    background: #10b981;
    color: #ffffff;
}

.mg-m-car-badge.is-hot {
    background: var(--mg-red);
    color: #ffffff;
}

.mg-m-car-badge.is-new {
    background: #0284c7;
    color: #ffffff;
}

.mg-m-car-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    margin-top: 2px;
    white-space: nowrap;
}

.mg-m-car-cat {
    color: #64748b;
}

.mg-m-car-dot {
    color: #cbd5e1;
}

.mg-m-car-price {
    color: var(--mg-red);
    font-weight: 700;
}

.mg-m-car-arrow {
    color: #94a3b8;
    flex-shrink: 0;
}

.mg-mobile-car-footer {
    margin-top: 4px;
}

.mg-mobile-viewall-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px !important;
    background: #ffffff;
    border: 1.5px dashed var(--mg-red);
    border-radius: 8px;
    color: var(--mg-red) !important;
    font-family: var(--mg-font-heading);
    font-size: 0.813rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.2s;
}

.mg-mobile-viewall-btn:active {
    background: #fef2f2;
}

/* Shared forms and overlays. */
[hidden] { display: none !important; }
.mg-field-error { display: block; color: #b00017; font-size: .875rem; margin-top: 8px; }
.mg-input[aria-invalid="true"] { border-color: #b00017; }
.mg-lead-context { padding: 12px; background: #f1f5f9; color: #334155; border-radius: 8px; font-size: .875rem; }
.mg-finance-assumptions { font-size: .8rem; color: #475569; margin-top: 8px; line-height: 1.5; }
.mg-btn:disabled { opacity: .6; cursor: not-allowed; }
.mg-form-alert:focus { outline: 2px solid #d6001c; outline-offset: 3px; }
.mg-form-alert { overflow-wrap: anywhere; }
.mg-modal, .mg-drawer { pointer-events: none; }
.mg-modal.is-active, .mg-drawer.is-active { pointer-events: auto; }
.mg-car-card, .mg-calc-inputs, .mg-calc-results, .mg-form-group { min-width: 0; }

/* Content notices remain readable on narrow screens. */
.screen-reader-text { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.mg-policy-content, .mg-page-entry { max-width:850px; margin-inline:auto; line-height:1.8; overflow-wrap:anywhere; }
.mg-page-article { padding-block:40px 64px; }
.mg-policy-content h1, .mg-page-title { font-size:clamp(1.8rem,4vw,2.8rem); line-height:1.25; margin-bottom:24px; }
.mg-policy-content h2, .mg-page-entry h2 { font-size:1.35rem; line-height:1.4; margin:28px 0 12px; }
.mg-page-entry p, .mg-policy-content p { margin-bottom:16px; }
.mg-page-entry a, .mg-privacy-notice a, .mg-data-note a { color:#b00017; text-decoration:underline; }
.mg-privacy-notice, .mg-data-note { font-size:.85rem; line-height:1.65; color:#475569; margin:16px 0; overflow-wrap:anywhere; }
.mg-showroom-directory-card { border:1px solid #e2e8f0; border-radius:12px; padding:24px; margin-top:20px; }
.mg-footer .mg-data-note { color:#cbd5e1; }
.mg-footer .mg-data-note a { color:#fff; }
