/*
Theme Name: Vehicle Market
Theme URI: https://vehicle-market.alpharesearch.net
Author: Vehicle Market
Description: Professional car marketplace theme
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: vehicle-market
*/

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0f172a;
    --secondary: #1e40af;
    --accent: #3b82f6;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --radius: 12px;
    --font: 'Inter', sans-serif;
}

body {
    font-family: var(--font);
    background: var(--light);
    color: var(--primary);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* ===========================
   HEADER
=========================== */
.site-header {
    background: var(--primary);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo img { height: 40px; }

.logo-text {
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.main-nav { display: flex; align-items: center; gap: 2rem; }

.main-nav a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.header-actions { display: flex; align-items: center; gap: 1rem; }

.btn-sell {
    background: var(--accent);
    color: var(--white) !important;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-sell:hover { background: #2563eb; }

.lang-switcher {
    position: relative;
    cursor: pointer;
}

.lang-switcher select {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* ===========================
   HERO / SEARCH
=========================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #1e3a5f 100%);
    padding: 5rem 2rem;
    text-align: center;
    color: var(--white);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero h1 span { color: var(--accent); }

.hero p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 2.5rem;
}

.search-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 1rem;
    align-items: end;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.search-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-field select,
.search-field input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--primary);
    background: var(--white);
    appearance: none;
}

.btn-search {
    background: var(--secondary);
    color: var(--white);
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-search:hover { background: #1d4ed8; }

/* ===========================
   STATS BAR
=========================== */
.stats-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
}

.stats-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.stat-item { text-align: center; }

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.2rem;
}

/* ===========================
   CATEGORIES
=========================== */
.categories-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

.section-subtitle {
    color: var(--gray);
    margin-bottom: 2rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s;
    cursor: pointer;
}

.category-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.category-icon { font-size: 3rem; margin-bottom: 1rem; }

.category-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card p { color: var(--gray); font-size: 0.9rem; }

/* ===========================
   CARS GRID
=========================== */
.cars-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.car-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.car-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.car-card:hover .car-image img { transform: scale(1.05); }

.car-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--secondary);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.car-badge.damaged { background: #dc2626; }
.car-badge.second-hand { background: #16a34a; }
.car-badge.demolition { background: #d97706; }

.car-info { padding: 1.2rem; }

.car-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.car-specs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.car-spec {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.car-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.car-actions {
    display: flex;
    gap: 0.8rem;
}

.btn-details {
    flex: 1;
    background: var(--primary);
    color: var(--white);
    padding: 0.6rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-details:hover { background: #1e293b; }

.btn-whatsapp {
    background: #25d366;
    color: var(--white);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-whatsapp:hover { background: #128c7e; }

/* ===========================
   FILTERS SIDEBAR
=========================== */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.filters-sidebar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.filter-group { margin-bottom: 1.5rem; }

.filter-group h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    margin-bottom: 0.8rem;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--primary);
}

.price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.btn-filter {
    width: 100%;
    background: var(--secondary);
    color: var(--white);
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-filter:hover { background: #1d4ed8; }

.btn-reset {
    width: 100%;
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--border);
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

/* ===========================
   CAR DETAIL PAGE
=========================== */
.car-detail {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

.gallery-main {
    border-radius: var(--radius);
    overflow: hidden;
    height: 450px;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.gallery-thumb {
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.gallery-thumb.active { border-color: var(--accent); }

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-detail-info {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.detail-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.detail-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-spec {
    background: var(--light);
    padding: 0.8rem;
    border-radius: 8px;
}

.detail-spec-label {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-spec-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.2rem;
}

.btn-whatsapp-large {
    width: 100%;
    background: #25d366;
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-whatsapp-large:hover { background: #128c7e; }

.btn-offer {
    width: 100%;
    background: var(--secondary);
    color: var(--white);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-offer:hover { background: #1d4ed8; }

/* ===========================
   FOOTER
=========================== */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo-text {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: block;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #25d366;
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.footer-whatsapp:hover { background: #128c7e; }

.footer-col h4 {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.2rem;
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 0.6rem; }

.footer-col ul li a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 1024px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .filters-sidebar { position: static; }
    .car-detail { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .search-box { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: 1fr; }
    .cars-grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
    .stats-inner { gap: 2rem; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* ===== VM MODERN PATCH ===== */
html, body {
    overflow-x: hidden;
}

.catalog-layout,
.catalog-main,
.cars-grid,
.car-detail,
.car-card,
.car-info {
    min-width: 0;
}

.archive-topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.lang-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lang-link {
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.lang-link:hover,
.lang-link.current {
    color: #fff;
    border-color: #3b82f6;
    background: rgba(59,130,246,0.18);
}

.catalog-main .cars-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.car-title,
.car-price,
.detail-price,
.detail-spec-value {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.car-price {
    font-size: 1.1rem;
    line-height: 1.25;
}

.detail-price {
    font-size: 1.8rem;
    line-height: 1.2;
}

.vm-pagination {
    margin: 2rem 0 3rem;
}

.vm-pagination ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.vm-pagination a,
.vm-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 0 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.vm-pagination .current {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-box {
    width: 100%;
}

@media (max-width: 1100px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .catalog-main .cars-grid {
        grid-template-columns: 1fr;
    }

    .car-detail {
        grid-template-columns: 1fr;
    }
}
/* ===== END VM MODERN PATCH ===== */

/* ===== LIVE STABLE PATCH ===== */
html, body {
    overflow-x: hidden;
}

.site-header {
    padding: 0 1.5rem;
}

.header-inner {
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav {
    flex-wrap: wrap;
}

.header-actions .btn-sell,
.btn-search,
.btn-filter,
.btn-reset,
.btn-details,
.btn-whatsapp,
.btn-whatsapp-large,
.btn-offer {
    min-height: 46px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
}

.btn-details,
.btn-whatsapp {
    padding: 0.8rem 1rem;
}

.btn-whatsapp-large,
.btn-offer {
    font-size: 1rem;
    min-height: 52px;
}

.catalog-layout,
.catalog-main,
.cars-grid,
.car-detail,
.car-card,
.car-info,
.search-box {
    min-width: 0;
    width: 100%;
}

.catalog-main {
    width: 100%;
}

.archive-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.vm-pagination {
    margin: 2rem 0 3rem;
}

.vm-pagination ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.vm-pagination a,
.vm-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-weight: 700;
}

.vm-pagination .current {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}

.car-title,
.car-price,
.detail-price,
.detail-spec-value {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.car-price {
    font-size: 1.15rem;
    line-height: 1.3;
}

.detail-price {
    font-size: 1.8rem;
    line-height: 1.2;
}

.car-specs {
    gap: 0.6rem;
}

.car-spec {
    font-size: 0.82rem;
}

.gallery-main {
    background: #fff;
}

.gallery-thumb {
    border: 2px solid transparent;
}

.gallery-thumb.active {
    border-color: var(--accent);
}

@media (max-width: 1100px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .search-box {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .cars-grid,
    .catalog-main .cars-grid {
        grid-template-columns: 1fr;
    }

    .car-detail {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}
/* ===== END LIVE STABLE PATCH ===== */
