/**
 * Styles pour les cartes véhicules - Version Full PHP
 * Optimisé pour SEO et performance
 */

/* Filtres sidebar */
.audi-filters-php {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    position: sticky;
    top: 100px;
}

.audi-filters-php .filter-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.audi-filters-php .form-select {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.audi-filters-php .form-select:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Carte véhicule */
.vehicle-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.vehicle-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vehicle-card-link:hover {
    color: inherit;
}

/* Image */
.vehicle-card-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f5f5f5;
}

.vehicle-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.vehicle-card-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #999;
    font-size: 0.875rem;
}

/* Badge promo */
.vehicle-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-promo {
    background: #e53935;
    color: #fff;
}

.badge-vd {
    background: #1a1a1a;
    color: #fff;
    font-size: 0.65rem;
}

/* Body */
.vehicle-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vehicle-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Specs */
.vehicle-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.vehicle-card-specs .spec-item {
    font-size: 0.75rem;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Prix */
.vehicle-card-price {
    margin-top: auto;
    margin-bottom: 1rem;
}

.vehicle-card-price .price-old {
    display: block;
    font-size: 0.875rem;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.vehicle-card-price .price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
}

.vehicle-card:has(.price-old) .price-current {
    color: #e53935;
}

/* CTA */
.vehicle-card-cta {
    display: block;
    text-align: center;
    padding: 0.75rem 1rem;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.2s;
}

.vehicle-card:hover .vehicle-card-cta {
    background: #333;
}

/* Results bar */
.audi-results-bar {
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 991px) {
    .audi-filters-php {
        position: static;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767px) {
    .vehicle-card-title {
        font-size: 0.9375rem;
    }
    
    .vehicle-card-price .price-current {
        font-size: 1.125rem;
    }
}

/* ========================================
   PAGE DÉTAIL VÉHICULE - Full PHP
   ======================================== */

.vehicle-detail-php {
    padding: 2rem 0;
}

/* ========================================
   SLIDER GALERIE - Style identique au JS
   ======================================== */

.audi-slider-gallery {
    position: relative;
    width: 100%;
    height: clamp(400px, 50vh, 600px);
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.audi-slider-main {
    position: relative;
    width: 100%;
    height: 100%;
}

.audi-slider-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
}

.audi-slider-viewport:active {
    cursor: grabbing;
}

.audi-slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.audi-slider-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
}

.audi-slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Compteur */
.audi-slider-counter {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* Contrôles */
.audi-viewer-controls {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.audi-viewer-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

.audi-viewer-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.audi-viewer-btn:active {
    transform: translateY(0);
}

.audi-viewer-btn span {
    font-size: 20px;
    line-height: 1;
    font-weight: 300;
}

/* Miniatures améliorées */
.vehicle-gallery-thumb-more {
    width: 80px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.vehicle-gallery-thumb-more:hover {
    background: rgba(0,0,0,0.85);
}

/* Responsive slider */
@media (max-width: 1199.98px) {
    .audi-slider-gallery {
        height: 320px;
        border-radius: 8px;
    }
    
    .audi-slider-slide img {
        object-fit: cover;
        object-position: center;
        background: #f8f9fa;
    }
}

@media (max-width: 767.98px) {
    .audi-slider-gallery {
        height: 260px;
        border-radius: 4px;
    }

    .audi-vehicle-single .col-12.col-lg-5.d-flex.flex-column.gap-3 > .d-flex.flex-column {
        order: 10;
    }
    .audi-vehicle-single .col-12.col-lg-5.d-flex.flex-column.gap-3 > .audi-price {
        order: 20;
    }
    .audi-vehicle-single .col-12.col-lg-5.d-flex.flex-column.gap-3 > .audi-choices {
        order: 30;
    }
    .audi-vehicle-single .col-12.col-lg-5.d-flex.flex-column.gap-3 > .audi-features {
        order: 40;
    }
    .audi-vehicle-single .col-12.col-lg-5.d-flex.flex-column.gap-3 > .audi-equip {
        order: 50;
    }
    .audi-vehicle-single .col-12.col-lg-5.d-flex.flex-column.gap-3 > .audi-availability-badge {
        order: 60;
    }
    
    .audi-slider-counter {
        bottom: 12px;
        left: 12px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .audi-viewer-controls {
        right: 12px;
        bottom: 12px;
        gap: 8px;
    }
    
    .audi-viewer-btn {
        width: 38px;
        height: 38px;
    }
    
    .audi-viewer-btn span {
        font-size: 18px;
    }
    
    .vehicle-gallery-thumbs {
        gap: 6px;
    }
    
    .vehicle-gallery-thumb {
        width: 60px;
        height: 45px;
    }
    
    .vehicle-gallery-thumb-more {
        width: 60px;
        height: 45px;
        font-size: 12px;
    }
}

/* Fullscreen */
.audi-slider-gallery:fullscreen,
.audi-slider-gallery:-webkit-full-screen,
.audi-slider-gallery.is-fullscreen {
    background: #000 !important;
    border-radius: 0;
    height: 100vh !important;
    width: 100vw !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

.audi-slider-gallery:fullscreen .audi-slider-main,
.audi-slider-gallery:-webkit-full-screen .audi-slider-main,
.audi-slider-gallery.is-fullscreen .audi-slider-main,
.audi-slider-gallery:fullscreen .audi-slider-viewport,
.audi-slider-gallery:-webkit-full-screen .audi-slider-viewport,
.audi-slider-gallery.is-fullscreen .audi-slider-viewport,
.audi-slider-gallery:fullscreen .audi-slider-track,
.audi-slider-gallery:-webkit-full-screen .audi-slider-track,
.audi-slider-gallery.is-fullscreen .audi-slider-track,
.audi-slider-gallery:fullscreen .audi-slider-slide,
.audi-slider-gallery:-webkit-full-screen .audi-slider-slide,
.audi-slider-gallery.is-fullscreen .audi-slider-slide {
    background: #000 !important;
}

.audi-slider-gallery:fullscreen .audi-slider-slide img,
.audi-slider-gallery:-webkit-full-screen .audi-slider-slide img,
.audi-slider-gallery.is-fullscreen .audi-slider-slide img {
    object-fit: contain !important;
    max-height: 100vh !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: pinch-zoom pan-x pan-y !important;
}

.audi-slider-gallery:fullscreen .audi-slider-counter,
.audi-slider-gallery:-webkit-full-screen .audi-slider-counter,
.audi-slider-gallery.is-fullscreen .audi-slider-counter {
    background: rgba(255,255,255,0.9);
    color: #000;
}

.audi-slider-gallery:fullscreen .audi-viewer-btn,
.audi-slider-gallery:-webkit-full-screen .audi-viewer-btn,
.audi-slider-gallery.is-fullscreen .audi-viewer-btn {
    width: 52px;
    height: 52px;
    z-index: 10000;
}

/* Bouton fermer visible en is-fullscreen */
.audi-slider-gallery.is-fullscreen .audi-slider-main {
    height: 100vh !important;
    width: 100vw !important;
}

.audi-slider-gallery.is-fullscreen .audi-slider-viewport {
    height: 100% !important;
}

.audi-slider-gallery.is-fullscreen .audi-viewer-controls {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 10001 !important;
}

/* Breadcrumb */
.vehicle-breadcrumb {
    margin-bottom: 1.5rem;
}

.vehicle-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.vehicle-breadcrumb a:hover {
    color: #000;
    text-decoration: underline;
}

.vehicle-breadcrumb .separator {
    margin: 0 0.5rem;
    color: #ccc;
}

/* Galerie */
.vehicle-gallery {
    position: relative;
    margin-bottom: 1.5rem;
}

.vehicle-gallery-main {
    aspect-ratio: 16/10;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 1rem;
}

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

.vehicle-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.vehicle-gallery-thumb {
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.vehicle-gallery-thumb:hover,
.vehicle-gallery-thumb.active {
    border-color: #000;
}

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

/* Infos véhicule */
.vehicle-info-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.vehicle-main-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.5rem 0;
}

.vehicle-subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Prix détail */
.vehicle-price-block {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.vehicle-price-block .price-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.vehicle-price-block .price-old {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
}

.vehicle-price-block .price-main {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
}

.vehicle-price-block .price-saving {
    display: inline-block;
    background: #e53935;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Specs grid */
.vehicle-specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.vehicle-spec-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vehicle-spec-item .spec-icon {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.vehicle-spec-item .spec-content {
    flex: 1;
}

.vehicle-spec-item .spec-label {
    font-size: 0.75rem;
    color: #999;
    display: block;
}

.vehicle-spec-item .spec-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* CTA buttons */
.vehicle-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vehicle-cta-buttons .btn {
    padding: 1rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
}

.vehicle-cta-buttons .btn-primary {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.vehicle-cta-buttons .btn-primary:hover {
    background: #333;
    border-color: #333;
}

/* Couleurs */
.vehicle-colors-section {
    margin-bottom: 1.5rem;
}

.vehicle-colors-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.vehicle-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vehicle-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.vehicle-color-swatch:hover,
.vehicle-color-swatch.active {
    transform: scale(1.1);
    border-color: #000;
}

/* Équipements */
.vehicle-equipments {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.vehicle-equipments h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.vehicle-equipments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.vehicle-equipment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #333;
}

.vehicle-equipment-item::before {
    content: "✓";
    color: #4caf50;
    font-weight: bold;
}

/* Responsive détail */
@media (max-width: 991px) {
    .vehicle-main-title {
        font-size: 1.5rem;
    }
    
    .vehicle-price-block .price-main {
        font-size: 1.75rem;
    }
    
    .vehicle-specs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .vehicle-gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
    }
}
