/**
 * =====================================================
 * HF IMPORTS - Estilos Premium Detalle Vehículo
 * Versión 3.0 - Diseño Minimalista Negro y Blanco
 * =====================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===== VARIABLES ===== */
:root {
    /* Colores principales - Negro y Blanco */
    --hf-black: #000000;
    --hf-black-soft: #111111;
    --hf-black-light: #1a1a1a;
    --hf-white: #ffffff;
    --hf-white-soft: #f5f5f5;

    /* Escala de grises */
    --hf-gray-50: #fafafa;
    --hf-gray-100: #f4f4f5;
    --hf-gray-200: #e4e4e7;
    --hf-gray-300: #d4d4d8;
    --hf-gray-400: #a1a1aa;
    --hf-gray-500: #71717a;
    --hf-gray-600: #52525b;
    --hf-gray-700: #3f3f46;
    --hf-gray-800: #27272a;
    --hf-gray-900: #18181b;

    /* Acentos */
    --hf-accent: #dc2626;
    --hf-whatsapp: #25d366;
    --hf-blue: #2563eb;

    /* Sombras */
    --hf-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --hf-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --hf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --hf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Radios */
    --hf-radius: 12px;
    --hf-radius-lg: 16px;
    --hf-radius-xl: 20px;

    /* Transición */
    --hf-transition: all 0.3s ease;
}

/* ===== RESET ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--hf-gray-100);
    color: var(--hf-black);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER DEL VEHÍCULO - MINIMALISTA ===== */
.vehicle-header-minimal {
    background: var(--hf-white);
    border-radius: var(--hf-radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--hf-gray-200);
    box-shadow: var(--hf-shadow);
}

.vehicle-header-left {
    flex: 1;
    min-width: 0;
}

.vehicle-header-minimal h1 {
    font-size: clamp(16px, 2.5vw, 22px);
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--hf-black);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vehicle-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--hf-gray-500);
    flex-wrap: wrap;
}

.vehicle-meta .vehicle-sep {
    color: var(--hf-gray-300);
}

.vehicle-meta .vehicle-year {
    font-weight: 600;
    color: var(--hf-gray-700);
}

.vehicle-header-right {
    text-align: right;
    flex-shrink: 0;
}

.vehicle-price-main {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 800;
    color: var(--hf-black);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.vehicle-price-label {
    font-size: 11px;
    color: var(--hf-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Legacy support */
.vehicle-header {
    background: var(--hf-white);
    border-radius: var(--hf-radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border: 1px solid var(--hf-gray-200);
    box-shadow: var(--hf-shadow);
}

.vehicle-header h1 {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
    color: var(--hf-black);
}

.vehicle-header .matricula {
    font-size: 12px;
    color: var(--hf-gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.vehicle-price-box {
    text-align: right;
}

.vehicle-price {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 800;
    color: var(--hf-black);
    letter-spacing: -0.5px;
}

.vehicle-price-note {
    font-size: 11px;
    color: var(--hf-gray-500);
    margin-top: 2px;
}

/* ===== ALERTA ===== */
.price-alert {
    background: var(--hf-white);
    border: 1px solid var(--hf-gray-300);
    border-left: 4px solid var(--hf-accent);
    border-radius: var(--hf-radius);
    padding: 14px 18px;
    font-size: 13px;
    color: var(--hf-gray-700);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-alert i {
    font-size: 18px;
    color: var(--hf-accent);
}

/* ===== LAYOUT PRINCIPAL ===== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* ===== GALERÍA ===== */
.gallery {
    background: var(--hf-white);
    border-radius: var(--hf-radius-lg);
    overflow: hidden;
    box-shadow: var(--hf-shadow-lg);
    border: 1px solid var(--hf-gray-200);
}

.gallery-main {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
    background: var(--hf-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--hf-black);
}

.gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--hf-gray-50);
    border-top: 1px solid var(--hf-gray-200);
}

.gallery-thumbnails img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--hf-transition);
    opacity: 0.6;
}

.gallery-thumbnails img:hover,
.gallery-thumbnails img.active {
    opacity: 1;
    border-color: var(--hf-black);
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
}

@media (max-width: 1024px) {
    .sidebar {
        position: static;
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--hf-white);
    border-radius: var(--hf-radius);
    padding: 22px;
    box-shadow: var(--hf-shadow);
    border: 1px solid var(--hf-gray-200);
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--hf-gray-600);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-title i {
    color: var(--hf-black);
    font-size: 16px;
}

/* ===== ESPECIFICACIONES ===== */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.spec-item {
    background: var(--hf-gray-50);
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--hf-gray-200);
    transition: var(--hf-transition);
}

.spec-item:hover {
    border-color: var(--hf-black);
}

.spec-label {
    font-size: 10px;
    color: var(--hf-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 4px;
}

.spec-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--hf-black);
}

/* ===== PRECIOS POR REGIÓN ===== */
.region-card {
    background: var(--hf-gray-50);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid var(--hf-gray-200);
    position: relative;
}

.region-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--hf-black);
    border-radius: 10px 0 0 10px;
}

.region-name {
    font-weight: 700;
    color: var(--hf-gray-700);
    margin-bottom: 6px;
    font-size: 13px;
    padding-left: 10px;
}

.region-price {
    font-size: 26px;
    font-weight: 900;
    color: var(--hf-black);
    padding-left: 10px;
}

.region-note {
    font-size: 11px;
    color: var(--hf-gray-500);
    padding-left: 10px;
    margin-top: 4px;
}

/* Detalles desplegables */
.region-details {
    margin-top: 12px;
    background: var(--hf-white);
    border-radius: 6px;
    border: 1px solid var(--hf-gray-200);
    overflow: hidden;
    margin-left: 10px;
}

.region-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    background: var(--hf-gray-50);
    transition: var(--hf-transition);
}

.region-details summary:hover {
    background: var(--hf-gray-100);
}

.region-details summary::-webkit-details-marker {
    display: none;
}

.region-details .arrow {
    transition: transform 0.2s;
    color: var(--hf-black);
    font-weight: bold;
}

.region-details[open] .arrow {
    transform: rotate(90deg);
}

.region-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--hf-gray-100);
}

.region-line:last-child {
    border-bottom: none;
}

/* ===== BOTONES DE ACCIÓN ===== */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 22px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hf-transition);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--hf-black);
    color: var(--hf-white);
}

.btn-primary:hover {
    background: var(--hf-gray-800);
    transform: translateY(-2px);
}

.btn-whatsapp {
    background: var(--hf-whatsapp);
    color: var(--hf-white);
}

.btn-whatsapp:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-outline {
    background: var(--hf-white);
    border: 2px solid var(--hf-gray-300);
    color: var(--hf-gray-700);
}

.btn-outline:hover {
    border-color: var(--hf-black);
    color: var(--hf-black);
}

.btn i {
    font-size: 16px;
}

/* ===== INFO EMPRESA ===== */
.company-info {
    text-align: center;
    background: var(--hf-black);
    color: var(--hf-white);
    border-radius: var(--hf-radius);
    padding: 24px;
}

.company-info img {
    max-width: 120px;
    margin-bottom: 12px;
    filter: brightness(0) invert(1);
}

.company-info p {
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.company-info strong {
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

/* ===== ALERTAS ===== */
.alert-card {
    padding: 14px 18px;
    border-radius: var(--hf-radius);
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-card.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-card.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
}

/* ===== BANNER DE ANUNCIOS ===== */
.ad-banner {
    background: var(--hf-gray-100);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== VEHÍCULOS RELACIONADOS - CARRUSEL ===== */
.related-section {
    margin-top: 40px;
    padding-top: 30px;
}

.related-section h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--hf-black);
}

/* Carrusel container */
.related-carousel {
    position: relative;
    overflow: hidden;
}

.related-carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s ease;
    padding: 10px 0;
}

.related-card {
    flex: 0 0 calc(25% - 15px);
    min-width: 280px;
    background: var(--hf-white);
    border-radius: var(--hf-radius);
    overflow: hidden;
    box-shadow: var(--hf-shadow);
    text-decoration: none;
    color: inherit;
    transition: var(--hf-transition);
    border: 1px solid var(--hf-gray-200);
}

@media (max-width: 1200px) {
    .related-card {
        flex: 0 0 calc(33.333% - 14px);
    }
}

@media (max-width: 900px) {
    .related-card {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .related-card {
        flex: 0 0 calc(85%);
        min-width: 260px;
    }
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hf-shadow-xl);
    border-color: var(--hf-black);
}

.related-card img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    background: var(--hf-gray-100);
}

.related-card-body {
    padding: 16px;
}

.related-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--hf-black);
}

.related-card p {
    font-size: 12px;
    color: var(--hf-gray-500);
}

.related-card .price {
    font-size: 18px;
    font-weight: 800;
    color: var(--hf-black);
    margin-top: 8px;
}

/* Botones del carrusel */
.carousel-nav {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    background: var(--hf-black);
    color: var(--hf-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--hf-transition);
}

.carousel-btn:hover {
    background: var(--hf-gray-700);
}

.carousel-btn:disabled {
    background: var(--hf-gray-300);
    cursor: not-allowed;
}

/* ===== CAROUSEL MOBILE ===== */
.mobile-carousel {
    display: none;
    border-radius: var(--hf-radius);
    overflow: hidden;
    box-shadow: var(--hf-shadow-lg);
    position: relative;
    background: var(--hf-gray-100);
}

@media (max-width: 768px) {
    .gallery {
        display: none;
    }

    .mobile-carousel {
        display: block;
        width: 100%;
        margin: 0 -15px;
        width: calc(100% + 30px);
        border-radius: 0;
    }

    .carousel-container {
        position: relative;
        width: 100%;
        overflow: hidden;
    }

    .carousel-track {
        display: flex;
        transition: transform 0.3s ease;
    }

    /* Formato 16:9 para móvil - landscape */
    .carousel-slide {
        min-width: 100%;
        flex-shrink: 0;
        aspect-ratio: 16/9;
        background: var(--hf-black);
        max-height: 56.25vw;
        /* 16:9 ratio based on viewport width */
        overflow: hidden;
    }

    .carousel-slide img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: var(--hf-black);
    }

    .carousel-indicator {
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.75);
        color: white;
        padding: 5px 12px;
        border-radius: 15px;
        font-size: 12px;
        font-weight: 600;
        backdrop-filter: blur(4px);
    }

    /* Header minimalista en móvil */
    .vehicle-header-minimal {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .vehicle-header-minimal h1 {
        white-space: normal;
        font-size: 18px;
    }

    .vehicle-header-right {
        text-align: left;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid var(--hf-gray-200);
    }

    .vehicle-meta {
        font-size: 12px;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .vehicle-header {
        flex-direction: column;
        text-align: center;
        padding: 22px 18px;
    }

    .vehicle-price-box {
        text-align: center;
        width: 100%;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== FOOTER ===== */
.hf-footer {
    background: var(--hf-black);
    color: var(--hf-white);
    padding: 45px 0 25px;
    margin-top: 50px;
}

.hf-footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 35px;
}

.hf-footer h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--hf-white);
}

.hf-footer p,
.hf-footer a {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 8px;
    display: block;
    transition: var(--hf-transition);
}

.hf-footer a:hover {
    color: var(--hf-white);
}

.hf-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 35px;
    text-align: center;
    font-size: 12px;
    opacity: 0.6;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vehicle-header,
.gallery,
.mobile-carousel,
.card {
    animation: fadeInUp 0.4s ease-out;
}