/* ==========================================================================
   TodoEléctricos - Global Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-secondary: #10b981;
    --color-dark: #1f2937;
    --color-gray: #6b7280;
    --color-light: #f3f4f6;
    --color-white: #ffffff;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

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

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--color-dark);
    line-height: 1.6;
    background: var(--color-light);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

main {
    min-height: calc(100vh - 200px);
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.header {
    background: var(--color-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    gap: 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--color-primary);
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav a {
    color: var(--color-gray);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav a:hover,
.nav a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Nav dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
    display: flex; align-items: center; gap: 0.3rem;
    color: var(--color-gray); font-weight: 500;
    padding: 0.5rem 0; border-bottom: 2px solid transparent;
    background: none; border-top: none; border-left: none; border-right: none;
    cursor: pointer; font-size: inherit; font-family: inherit;
    transition: all 0.2s;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.nav-dropdown-trigger svg { transition: transform 0.2s; }
.nav-dropdown-trigger.open svg { transform: rotate(180deg); }

.nav-dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: white; border: 1px solid #e5e7eb;
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    min-width: 230px; overflow: hidden; z-index: 200;
}

.nav-dropdown-menu a.nav-dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem; color: var(--color-dark);
    font-size: 0.875rem; font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
}

.nav-dropdown-menu a.nav-dropdown-item:last-child { border-bottom: none; }

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-dark);
}

.mobile-nav {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 0.5rem 0 1rem;
    box-shadow: var(--shadow-md);
}

.mobile-nav-item {
    display: block;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-dark);
    border-bottom: 1px solid #f3f4f6;
}

.mobile-nav-item:hover,
.mobile-nav-item.active { color: var(--color-primary); background: #f0f7ff; }

.mobile-nav-group-label {
    padding: 0.5rem 1.5rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.mobile-nav-sub {
    padding-left: 2rem;
    font-size: 0.9rem;
    color: var(--color-gray);
}

.mobile-nav-enter { transition: opacity 0.15s ease, transform 0.15s ease; }
.mobile-nav-enter-start { opacity: 0; transform: translateY(-6px); }
.mobile-nav-enter-end   { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-menu-btn { display: block; }
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
#popularBrands {
    -webkit-filter: grayscale(100%);
    filter: grayscale(100%);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    background: var(--color-dark);
    color: var(--color-white);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--color-white);
}

.footer a {
    color: #9ca3af;
    display: block;
    padding: 0.25rem 0;
}

.footer a:hover {
    color: var(--color-white);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: var(--color-white);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-dark);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: var(--color-light);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: #dbeafe;
    color: var(--color-primary);
}

.badge-success {
    background: #dcfce7;
    color: #16a34a;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

/* --------------------------------------------------------------------------
   Generated content (#edcontent)
   -------------------------------------------------------------------------- */
#edcontent p {
    margin: 1em 0;
}

#edcontent h2,
#edcontent h3 {
    line-height: 1.2em;
}

#edcontent h3 {
    margin-top: 2em;
}

#edcontent ul,
#edcontent ol {
    margin-left: 2em;
}

/* --------------------------------------------------------------------------
   Grid system
   -------------------------------------------------------------------------- */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Section spacing
   -------------------------------------------------------------------------- */
.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Utility classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-gray   { color: var(--color-gray); }
.text-sm     { font-size: 0.875rem; }
.text-lg     { font-size: 1.125rem; }
.text-xl     { font-size: 1.25rem; }
.font-bold   { font-weight: 700; }
.mt-1        { margin-top: 0.25rem; }
.mt-2        { margin-top: 0.5rem; }
.mt-4        { margin-top: 1rem; }
.mb-2        { margin-bottom: 0.5rem; }
.mb-4        { margin-bottom: 1rem; }

/* --------------------------------------------------------------------------
   Alpine.js utilities (brands/show)
   -------------------------------------------------------------------------- */
[x-cloak] { display: none !important; }
.transition  { transition-property: all; }
.ease-out    { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.duration-200 { transition-duration: 200ms; }
.opacity-0   { opacity: 0; }
.opacity-100 { opacity: 1; }
.transform   { transform: translateX(var(--tw-translate-x, 0)) translateY(var(--tw-translate-y, 0)); }
.-translate-y-2 { --tw-translate-y: -0.5rem; }
.translate-y-0  { --tw-translate-y: 0; }

/* --------------------------------------------------------------------------
   Home - news grid
   -------------------------------------------------------------------------- */
.news-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
    align-items: start;
}
.news-secondary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.news-secondary-card {
    text-decoration: none;
    display: flex;
    gap: 1rem;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: box-shadow .2s;
}
.news-secondary-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.13); }
.news-secondary-card img,
.news-secondary-card .news-thumb-placeholder {
    width: 120px;
    min-width: 120px;
    height: 90px;
    object-fit: cover;
    flex-shrink: 0;
}
.news-secondary-card .news-thumb-placeholder {
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}
.news-secondary-body {
    padding: 0.75rem 1rem 0.75rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 640px) {
    .news-grid { grid-template-columns: 1fr; }
    .news-secondary-card img,
    .news-secondary-card .news-thumb-placeholder {
        width: 90px;
        min-width: 90px;
        height: 80px;
    }
}

/* --------------------------------------------------------------------------
   Cars index - search, filters, grid
   -------------------------------------------------------------------------- */
.search-container { position: relative; width: 100%; max-width: 600px; margin: 0 auto; }
.search-input {
    width: 100%; padding: 1rem 1.25rem; padding-left: 3rem;
    font-size: 1rem; border: 2px solid #e5e7eb; border-radius: 12px;
    background: white; transition: all 0.2s;
}
.search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #9ca3af; pointer-events: none; }
.search-suggestions {
    position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.5rem;
    background: white; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: hidden; z-index: 100; display: none;
}
.search-suggestions.active { display: block; }
.suggestion-item {
    display: flex; align-items: center; padding: 0.875rem 1.25rem; gap: 0.75rem;
    text-decoration: none; color: var(--color-dark); transition: background 0.15s;
}
.suggestion-item:hover { background: #f3f4f6; }
.suggestion-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.suggestion-icon.brand { background: #dbeafe; color: #2563eb; }
.suggestion-icon.model { background: #f0fdf4; color: #16a34a; }
.suggestion-label { flex: 1; font-weight: 500; }
.suggestion-meta { font-size: 0.75rem; color: #9ca3af; }

.filter-toggle { display: none; }
@media (max-width: 768px) {
    .filter-toggle {
        display: flex; align-items: center; justify-content: center; gap: 0.5rem;
        width: 100%; padding: 0.75rem; background: white; border: 1px solid #e5e7eb;
        border-radius: 8px; font-weight: 500; cursor: pointer; margin-bottom: 1rem;
    }
    .filters-sidebar { display: none; width: 100% !important; margin-bottom: 1rem; }
    .filters-sidebar.open { display: block; }
    .car-grid { grid-template-columns: 1fr !important; }
    .results-layout { flex-direction: column !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .car-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

.active-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.filter-pill {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.375rem 0.75rem; background: #dbeafe; color: #1e40af;
    border-radius: 20px; font-size: 0.8125rem; font-weight: 500;
}
.filter-pill button { background: none; border: none; cursor: pointer; padding: 0; color: #1e40af; line-height: 1; }
.filter-pill button:hover { color: #1e3a8a; }

/* --------------------------------------------------------------------------
   Static pages
   -------------------------------------------------------------------------- */
.static-page-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);
}
.static-page-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 2rem 0 1rem;
}
.static-page-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-dark);
    margin: 1.5rem 0 0.75rem;
}
.static-page-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #374151;
}
.static-page-content ul,
.static-page-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
    line-height: 1.7;
}
.static-page-content li {
    margin-bottom: 0.5rem;
    color: #374151;
}
.static-page-content a {
    color: var(--color-primary);
    text-decoration: underline;
}
.static-page-content a:hover { color: var(--color-primary-dark); }
.static-page-content strong { font-weight: 600; color: var(--color-dark); }
.static-page-content em { color: var(--color-gray); font-size: 0.875rem; }
@media (max-width: 768px) {
    .static-page-content h1 { font-size: 1.5rem; }
    .static-page-content h2 { font-size: 1.25rem; }
    .static-page-content h3 { font-size: 1.125rem; }
}

/* --------------------------------------------------------------------------
   Comparator index
   -------------------------------------------------------------------------- */
.comparator-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 992px) { .comparator-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px)  { .comparator-grid { grid-template-columns: 1fr; } }
.hover-bg:hover { background: #f3f4f6; }

/* --------------------------------------------------------------------------
   Calculators - shared components
   -------------------------------------------------------------------------- */
.car-suggest-wrap { position: relative; }
.car-suggest-input {
    width: 100%; padding: 0.75rem 2.5rem 0.75rem 0.875rem;
    border: 1.5px solid #e5e7eb; border-radius: var(--radius);
    font-size: 0.9rem; background: white; color: var(--color-dark);
    outline: none; transition: border-color 0.15s;
}
.car-suggest-input:focus { border-color: var(--color-primary); }
.car-suggest-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: white; border: 1px solid #e5e7eb; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; max-height: 320px; overflow-y: auto;
}
.car-suggest-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; cursor: pointer; border: none; background: none;
    width: 100%; text-align: left; transition: background 0.1s;
}
.car-suggest-item:hover { background: #f3f4f6; }
.car-suggest-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }
/* tiempo-carga: avatar inicial de marca */
.car-suggest-avatar {
    width: 34px; height: 34px; border-radius: 8px;
    background: #eff6ff; display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: var(--color-primary); flex-shrink: 0;
}
/* ahorro-electrico: nombre y marca del modelo */
.car-suggest-item-name { font-size: 0.875rem; font-weight: 500; color: var(--color-dark); }
.car-suggest-item-make { font-size: 0.75rem; color: var(--color-gray); }
.car-suggest-clear {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #9ca3af; cursor: pointer; padding: 0.25rem; line-height: 1;
}

.calc-page { background: var(--color-bg); padding: 2rem 0 4rem; }
.calc-hero { text-align: center; margin-bottom: 2.5rem; }
.calc-hero h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; color: var(--color-dark); margin-bottom: 0.75rem; }
.calc-hero p { color: var(--color-gray); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

.calc-grid { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .calc-grid-responsive { grid-template-columns: 1fr !important; } }

.calc-card {
    background: white; border-radius: var(--radius-lg); border: 1px solid #e5e7eb;
    box-shadow: var(--shadow); overflow: hidden;
}
.calc-card-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid #f3f4f6;
    display: flex; align-items: center; gap: 0.75rem;
}
.calc-card-header-icon {
    width: 2rem; height: 2rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0;
}
.calc-card-header-icon.green { background: #dcfce7; }
.calc-card-header-icon.blue  { background: #dbeafe; }
.calc-card-body { padding: 1.5rem; }

.input-group { margin-bottom: 1.25rem; }
.input-group:last-child { margin-bottom: 0; }
.input-label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; font-weight: 600; color: var(--color-dark);
    margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.input-label span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--color-gray); font-size: 0.875rem; }

.number-input {
    width: 100%; padding: 0.6rem 0.875rem;
    border: 1.5px solid #e5e7eb; border-radius: var(--radius);
    font-size: 0.95rem; color: var(--color-dark); background: white;
    outline: none; transition: border-color 0.15s;
}
.number-input:focus { border-color: var(--color-primary); }

.range-wrap { display: flex; align-items: center; gap: 0.75rem; }
.range-wrap input[type=range] { flex: 1; accent-color: var(--color-primary); }
.range-val { min-width: 60px; text-align: right; font-size: 0.9rem; font-weight: 600; color: var(--color-primary); }

/* --------------------------------------------------------------------------
   Calculator - tiempo de carga (specific)
   -------------------------------------------------------------------------- */
.charge-preset {
    padding: 0.875rem 0.5rem; border-radius: var(--radius); border: 1.5px solid #e5e7eb;
    background: white; cursor: pointer; text-align: center; transition: all 0.15s;
    display: flex; flex-direction: column; gap: 0.2rem;
}
.charge-preset:hover { border-color: var(--color-primary); background: #f8faff; }
.charge-preset.active { border-color: var(--color-primary); background: #eff6ff; }
.charge-preset .preset-range { font-size: 0.9rem; font-weight: 700; color: var(--color-dark); }
.charge-preset.active .preset-range { color: var(--color-primary); }
.charge-preset .preset-label { font-size: 0.7rem; color: var(--color-gray); }
.charge-preset.active .preset-label { color: #3b82f6; }

.charger-card {
    display: flex; align-items: center; gap: 0.875rem;
    padding: 0.875rem 1rem; border-radius: var(--radius);
    border: 1.5px solid #e5e7eb; background: white; cursor: pointer;
    text-align: left; transition: all 0.15s; width: 100%;
}
.charger-card:hover { border-color: #93c5fd; background: #f8faff; }
.charger-card.active-ac { border-color: var(--color-primary); background: #eff6ff; }
.charger-card.active-dc { border-color: #059669; background: #ecfdf5; }
.charger-icon {
    width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.charger-icon.ac { background: #dbeafe; }
.charger-icon.dc { background: #d1fae5; }
.charger-card.active-ac .charger-icon.ac { background: #bfdbfe; }
.charger-card.active-dc .charger-icon.dc { background: #a7f3d0; }
.charger-kw { font-size: 1.1rem; font-weight: 800; line-height: 1; color: var(--color-dark); }
.charger-card.active-ac .charger-kw { color: var(--color-primary); }
.charger-card.active-dc .charger-kw { color: #059669; }
.charger-desc { font-size: 0.75rem; color: var(--color-gray); margin-top: 0.15rem; }

.tip-box {
    padding: 0.875rem 1.125rem; border-radius: var(--radius);
    font-size: 0.875rem; line-height: 1.6; display: flex; gap: 0.625rem; align-items: flex-start;
}
.tip-box.tip-warning { background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; }
.tip-box.tip-success { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; }
.tip-box.tip-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* --------------------------------------------------------------------------
   Calculator - ahorro eléctrico (specific)
   -------------------------------------------------------------------------- */
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 500px) { .result-grid { grid-template-columns: 1fr; } }

.result-box { border-radius: var(--radius); padding: 1.25rem; text-align: center; border: 2px solid transparent; }
.result-box.electric { background: #f0fdf4; border-color: #bbf7d0; }
.result-box.gasoline { background: #fff7ed; border-color: #fed7aa; }
.result-box.saving   { background: #eff6ff; border-color: #bfdbfe; }

.result-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.result-label.electric { color: #15803d; }
.result-label.gasoline { color: #c2410c; }
.result-label.saving   { color: #1d4ed8; }

.result-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; }
.result-value.electric { color: #16a34a; }
.result-value.gasoline { color: #ea580c; }
.result-value.saving   { color: #2563eb; }

.result-sub { font-size: 0.75rem; color: var(--color-gray); margin-top: 0.25rem; }

.saving-banner {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white; border-radius: var(--radius); padding: 1.25rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; margin-top: 1rem;
}
.saving-banner-text  { font-size: 0.9rem; opacity: 0.9; }
.saving-banner-value { font-size: 2rem; font-weight: 800; white-space: nowrap; }

.maint-section { margin-top: 1.5rem; }
.maint-title {
    font-size: 0.85rem; font-weight: 700; color: var(--color-dark);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.maint-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .maint-grid { grid-template-columns: 1fr; } }

.maint-box { border-radius: var(--radius); padding: 1rem; border: 1px solid #e5e7eb; }
.maint-box.electric { background: #f0fdf4; }
.maint-box.gasoline { background: #fff7ed; }
.maint-box-title { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.75rem; }
.maint-box-title.electric { color: #15803d; }
.maint-box-title.gasoline { color: #c2410c; }
.maint-item {
    display: flex; justify-content: space-between;
    font-size: 0.8rem; padding: 0.3rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    color: var(--color-dark);
}
.maint-item:last-child { border-bottom: none; font-weight: 700; }
.maint-item.not-applicable { color: #9ca3af; }
.maint-total {
    margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 2px solid rgba(0,0,0,0.1);
    display: flex; justify-content: space-between;
    font-weight: 800; font-size: 1rem;
}
.maint-total.electric { color: #16a34a; }
.maint-total.gasoline { color: #ea580c; }

.total-5y { margin-top: 1.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid #e5e7eb; }
.total-5y-header { background: #1f2937; color: white; padding: 0.875rem 1.25rem; font-weight: 700; font-size: 0.9rem; }
.total-5y-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.875rem 1.25rem; border-bottom: 1px solid #f3f4f6; font-size: 0.9rem;
}
.total-5y-row:last-child { border-bottom: none; }
.total-5y-row.total { background: #eff6ff; font-weight: 800; font-size: 1rem; color: #1d4ed8; }
.total-5y-row .label { color: var(--color-dark); }
.total-5y-row .ev    { color: #16a34a; font-weight: 600; }
.total-5y-row .gas   { color: #ea580c; font-weight: 600; }

.car-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 2rem; padding: 0.4rem 0.875rem;
    font-size: 0.8rem; font-weight: 600; color: #15803d; margin-bottom: 1rem;
}

.disclaimer {
    margin-top: 2rem; padding: 1rem 1.25rem;
    background: #f9fafb; border-radius: var(--radius);
    border: 1px solid #e5e7eb; font-size: 0.78rem; color: var(--color-gray); line-height: 1.6;
}

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--color-gray); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

.faq-section { margin-top: 3rem; }
.faq-section h2 { font-size: 1.5rem; font-weight: 700; color: var(--color-dark); margin-bottom: 1.5rem; }
.faq-item { border: 1px solid #e5e7eb; border-radius: var(--radius); margin-bottom: 0.75rem; overflow: hidden; }
.faq-question {
    width: 100%; padding: 1rem 1.25rem; background: white;
    border: none; text-align: left; cursor: pointer; font-size: 0.9rem;
    font-weight: 600; color: var(--color-dark);
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-question:hover { background: #f9fafb; }
.faq-answer { padding: 0 1.25rem 1rem; font-size: 0.875rem; color: var(--color-gray); line-height: 1.7; }

/* --------------------------------------------------------------------------
   Car detail (cars/show)
   -------------------------------------------------------------------------- */
.car-detail-grid { grid-template-columns: 1fr 400px; }
.lead-form-desktop { display: block; }

.mobile-cta-container {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 1rem;
    background: white;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.mobile-lead-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}
.mobile-lead-modal.active { display: flex; }

.mobile-lead-modal-content {
    background: white;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.gallery-main-img {
    width: 100% !important;
    max-width: 100% !important;
    height: 420px !important;
    object-fit: cover;
    display: block;
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    max-width: 100%;
}

.gallery-thumb-btn {
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    width: 84px;
    height: 60px;
    display: block;
    line-height: 0;
}

.gallery-thumb-img {
    width: 80px;
    height: 56px;
    max-width: none;
    object-fit: cover;
    display: block;
}

.key-spec-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 0.75rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    flex: 1 1 auto;
    min-width: 160px;
}
.key-spec-label { display: block; font-size: 0.75rem; color: var(--color-gray); line-height: 1; }
.key-spec-value { display: block; font-size: 1rem; font-weight: 700; color: var(--color-dark); line-height: 1.3; }

.versions-table { width: 100%; border-collapse: collapse; }
.versions-table th {
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray);
    border-bottom: 2px solid #e5e7eb;
}
.versions-table td { border-bottom: 1px solid #f3f4f6; }
.versions-table tbody tr:hover { background: #f9fafb; }

.spec-category-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.specs-grid { display: grid; gap: 0; }

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.spec-row dt { color: var(--color-gray); font-size: 0.9375rem; }
.spec-row dd { font-weight: 600; font-size: 0.9375rem; color: var(--color-dark); }

@media (max-width: 968px) {
    .car-detail-grid { grid-template-columns: 1fr !important; }
    .lead-form-desktop { display: none; }
    .mobile-cta-container { display: block; }
    section.section { padding-bottom: 100px; }
    .pros-cons-grid { grid-template-columns: 1fr !important; }
    .key-specs-bar { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 0.5rem; }
    .key-spec-chip { min-width: 150px; flex-shrink: 0; }
    .gallery-main-img { height: 250px !important; }
    .versions-table { font-size: 0.8125rem; }
    .versions-table th,
    .versions-table td { padding: 0.625rem 0.5rem !important; }
}

.thumbnail-active { border-color: var(--color-primary) !important; }

.lead-form input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lead-form-success {
    background: #f0fdf4;
    color: #166534;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.lead-form-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: var(--radius);
}
