/*
Theme Name: Car Listings Theme
Description: Tema para un sitio de compraventa de coches de segunda mano con diseño premium.
Version: 1.2.0
Author: Juan A.
Text Domain: car-listings-theme
*/

/* Global Reset & Variables */
:root {
    --primary-color: #007cba;
    --primary-hover: #006799;
    --secondary-color: #1a202c;
    --text-color: #2d3748;
    --text-muted: #718096;
    --light-bg: #f7fafc;
    --white: #ffffff;
    --border-color: #edf2f7;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --container-width: 1200px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding img {
    max-height: 50px;
    width: auto;
    display: block;
}

.site-title {
    margin: 0;
}

.site-title a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title a svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 35px;
}

.main-navigation a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s;
    padding: 10px 0;
    position: relative;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.main-navigation a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: var(--secondary-color);
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
}

.menu-toggle svg {
    display: block;
    width: 32px;
    height: 32px;
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        order: 2;
    }

    .site-branding {
        order: 1;
    }

    .main-navigation {
        order: 3;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.4s ease-in-out;
        box-shadow: var(--shadow-lg);
    }

    .main-navigation.toggled {
        max-height: 400px;
        padding: 20px 0;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 0 20px;
    }

    .main-navigation li {
        border-bottom: 1px solid var(--border-color);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        display: block;
        padding: 15px 0;
    }

    .main-navigation a::after {
        display: none;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    padding: 120px 20px 180px;
    text-align: center;
    color: var(--white);
}

.hero-content h1 {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 24px;
    opacity: 0.9;
    margin-bottom: 40px;
}

/* Search Form - Premium Pill Style */
.clm-search-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--white);
    padding: 10px;
    border-radius: 100px;
    box-shadow: var(--shadow-lg);
}

.clm-search-hero {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    margin-top: -40px;
}

.clm-search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
}

.clm-search-fields {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}

.clm-field {
    padding: 5px 20px;
    border-right: 1px solid var(--border-color);
    text-align: left;
}

.clm-field:last-child {
    border-right: none;
}

.clm-field label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.clm-select, .clm-input {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    height: 30px !important;
    font-weight: 600 !important;
    color: var(--secondary-color) !important;
    font-size: 14px !important;
    cursor: pointer;
}

.clm-select:focus, .clm-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.clm-btn-search {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 100px;
    padding: 0 35px;
    height: 54px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px 0 rgba(0,124,186,0.39);
    transition: all 0.3s ease;
}

.clm-btn-search:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,124,186,0.23);
}

.clm-btn-reset {
    width: 54px;
    height: 54px;
    background: var(--light-bg);
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
}

.clm-btn-reset:hover {
    background: #edf2f7;
    color: var(--secondary-color);
}

/*--------------------------------------------------------------
# Archive & Grid
--------------------------------------------------------------*/

.car-search-section {
    padding: 60px 0;
}
.car-archive-header {
    text-align: center;
    padding: 60px 0 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    margin-bottom: 40px;
    border-radius: 20px;
}

.car-archive-header .page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.car-item {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.car-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary-color);
}

.car-thumbnail {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.car-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.car-item:hover .car-thumbnail img {
    transform: scale(1.05);
}

.car-content-wrapper {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.car-item .entry-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.car-item .entry-title a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.car-item .entry-title a:hover {
    color: var(--primary-color);
}

.car-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.car-meta-info {
    display: flex;
    gap: 15px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.car-meta-info span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.car-meta-info .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    margin: 60px 0 80px;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination .page-numbers:hover:not(.current) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--light-bg);
}

.pagination .page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* Featured Cars Section */
.featured-cars {
    padding: 120px 0;
    background: var(--white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0;
}

/* Single Car Page */
.site-main {
    padding: 60px 0;
    background-color: #fcfcfc;
}

.car-single-container {
    padding: 60px 0;
}

.car-single-container .entry-header {
    margin-bottom: 40px;
}

.car-single-container .entry-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 10px;
    line-height: 1.1;
}

.car-location-tag {
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.car-main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
}

.car-gallery {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.car-main-image {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-lg);
    cursor: zoom-in;
    background: #000;
}

.car-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.car-gallery-item {
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.car-gallery-item:hover {
    opacity: 0.8;
}

.car-gallery-item.active {
    border-color: var(--primary-color);
}

.car-gallery-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.car-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

.entry-content-section {
    margin-top: 50px;
}

.entry-content-section h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 25px;
}

.description-text {
    font-size: 18px;
    color: var(--text-color);
    line-height: 1.8;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.tech-item {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tech-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.tech-value {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--secondary-color);
}

.equipment-group {
    margin-bottom: 35px;
}

.equipment-group h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.equipment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.equipment-list li {
    font-size: 15px;
    color: var(--text-color);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.equipment-bullet-icon {
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.car-location-details {
    margin-top: 60px;
    padding: 40px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.car-map-container {
    border-radius: 15px;
    overflow: hidden;
    margin-top: 25px;
}

.car-map-container iframe {
    width: 100% !important;
    display: block;
}

.car-info-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-box {
    background: var(--white);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
}

.sidebar-box.dark {
    background: var(--secondary-color);
    color: var(--white);
}

.sidebar-box.dark h4 {
    color: var(--white);
}

.car-price-box .price-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.car-price-box .price-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    margin-top: 5px;
}

.car-specs-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.car-specs-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.car-specs-list li span:first-child {
    color: var(--text-muted);
}

.clm-request-info {
    display: block;
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 18px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s;
}

.clm-request-info:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px 0 rgba(0,124,186,0.3);
}

.benefits-list {
    padding: 0;
    list-style: none;
    font-size: 14px;
    opacity: 0.9;
}

.benefits-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.benefits-list li .dashicons {
    color: #48bb78;
}

/* Archive Page */
.car-archive-header {
    background: var(--white);
    padding: 80px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.car-archive-header h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 15px;
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
.site-footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 60px 0 20px;
    font-size: 15px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h3, 
.footer-widget h4,
.footer-widget .widget-title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget h3::after, 
.footer-widget h4::after,
.footer-widget .widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-widget p {
    color: #b0b0b0;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget ul li {
    margin-bottom: 12px;
}

.footer-widget ul li a {
    color: #b0b0b0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-widget ul li a:hover {
    color: var(--primary-color);
}

.site-info {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    color: #777;
    font-size: 14px;
}

@media (max-width: 992px) {
    .footer-widgets {
        grid-template-columns: 1fr 1fr;
    }
    .footer-col-1 {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .footer-widgets {
        grid-template-columns: 1fr;
    }
    .footer-col-1 {
        grid-column: span 1;
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .clm-search-container {
        border-radius: 20px;
        margin: -40px 20px 0;
    }
    .clm-search-fields {
        grid-template-columns: repeat(3, 1fr);
    }
    .clm-field {
        border-bottom: 1px solid var(--border-color);
        padding: 15px;
    }
    .clm-field:nth-child(3) {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: 40px; }
    .clm-search-wrapper { flex-direction: column; }
    .clm-search-fields { grid-template-columns: 1fr; width: 100%; }
    .clm-field { border-right: none; }
    .clm-btn-search { width: 100%; }
}

/* Lightbox Modal */
.clt-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clt-lightbox.active {
    display: flex;
    opacity: 1;
}

.clt-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.clt-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.clt-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: var(--white);
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.clt-lightbox-close:hover {
    color: var(--primary-color);
}

.clt-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    line-height: 1;
    padding-bottom: 5px;
}

.clt-lightbox-nav:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-50%) scale(1.1);
}

.clt-lightbox-nav.prev {
    left: -80px;
}

.clt-lightbox-nav.next {
    right: -80px;
}

@media (max-width: 1200px) {
    .clt-lightbox-nav.prev { left: 10px; }
    .clt-lightbox-nav.next { right: 10px; }
    .clt-lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 30px;
        background: rgba(0, 0, 0, 0.5);
    }
}

body.lightbox-open {
    overflow: hidden;
}

/* Accordion Styles */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 20px 0;
    margin: 0 !important;
    transition: color 0.3s ease;
    font-size: 20px;
    font-weight: 700;
}

.accordion-section.active .accordion-header {
    border-bottom: 1px solid var(--border-color);
}

.accordion-header:hover {
    color: var(--primary-color);
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-section.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease;
    padding: 0;
}

.accordion-section.active .accordion-content {
    max-height: 2000px; /* Large enough for content */
    padding-top: 30px;
    padding-bottom: 30px;
}

.car-tech-sheet.accordion-section,
.car-extra-equipment.accordion-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 25px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .car-main-content { grid-template-columns: 1fr; gap: 30px; }
    .car-info-sidebar { position: static; }
    .car-single-container { padding: 30px 0; }
    .car-single-container .entry-title { font-size: 32px; }
    .car-gallery { padding: 15px; }
    .tech-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; }
    .equipment-list { grid-template-columns: 1fr; }
    .car-location-details { padding: 20px; }
}

@media (max-width: 480px) {
    .car-gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .car-gallery-item img { height: 70px; }
    .tech-grid { grid-template-columns: 1fr; }
}

/* Placeholder Image */
.no-image-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f3f4f6;
    display: block;
    min-height: 250px;
}

.car-thumbnail .no-image-placeholder {
    aspect-ratio: 4 / 3;
}

.car-main-image .no-image-placeholder {
    aspect-ratio: 4 / 3;
    border-radius: 12px;
}
