/**
 * AutoCRM Public CSS - Diseño Espaciado y Profesional
 * Versión: 3.0
 */

/* VARIABLES DE COLOR - Personalizables desde admin */
:root {
    --autocrm-primary: #2563eb;
    --autocrm-secondary: #10b981;
    --autocrm-accent: #f59e0b;
    --autocrm-danger: #ef4444;
    --autocrm-dark: #1f2937;
    --autocrm-gray: #6b7280;
    --autocrm-light-gray: #f3f4f6;
    --autocrm-border: #e5e7eb;
    --autocrm-white: #ffffff;
    --autocrm-radius: 16px;
    --autocrm-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --autocrm-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --autocrm-shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

/* RESET */
.autocrm-vehicle-detail * {
    box-sizing: border-box;
}

/* CONTENEDOR PRINCIPAL */
.autocrm-vehicle-detail {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================
   GALERÍA DE IMÁGENES - MEJORADA
======================================== */

.autocrm-vehicle-gallery-section {
    margin-bottom: 50px;
}

.autocrm-main-image-container {
    position: relative;
    border-radius: var(--autocrm-radius);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--autocrm-light-gray);
    box-shadow: var(--autocrm-shadow-lg);
}

.autocrm-main-image-container img {
    width: 100%;
    height: auto;
    min-height: 400px;
    max-height: 600px;
    object-fit: contain;
    display: block;
    background: var(--autocrm-white);
    transition: transform 0.3s ease;
}

/* transform hover removido para evitar loop con Swiper ResizeObserver */
.autocrm-main-image-container:hover img {
    /* transform: scale(1.02); -- REMOVIDO: causa zoom infinito con Swiper */
}

/* Botón fullscreen */
.autocrm-fullscreen-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.autocrm-fullscreen-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.05);
}

/* Thumbnails mejorados */
.autocrm-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.autocrm-thumb {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    box-shadow: var(--autocrm-shadow-sm);
    background: var(--autocrm-white);
}

.autocrm-thumb:hover {
    border-color: var(--autocrm-primary);
    transform: scale(1.05);
    box-shadow: var(--autocrm-shadow-md);
}

.autocrm-thumb.active {
    border-color: var(--autocrm-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.autocrm-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.autocrm-no-image {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 100px 20px;
    text-align: center;
    border-radius: var(--autocrm-radius);
    color: var(--autocrm-gray);
    font-size: 48px;
}

/* Modal Fullscreen */
.autocrm-fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    padding: 20px;
}

.autocrm-fullscreen-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.autocrm-fullscreen-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.autocrm-close-fullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: black;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.autocrm-close-fullscreen:hover {
    transform: scale(1.1) rotate(90deg);
}

/* ========================================
   HEADER - TÍTULO Y PRECIO
======================================== */

.autocrm-vehicle-header {
    background: var(--autocrm-white);
    padding: 40px;
    border-radius: var(--autocrm-radius);
    box-shadow: var(--autocrm-shadow-md);
    margin-bottom: 40px;
}

.autocrm-vehicle-header h1 {
    margin: 0 0 20px 0;
    font-size: 36px;
    font-weight: 700;
    color: var(--autocrm-dark);
    line-height: 1.3;
}

.autocrm-vehicle-header h1 .model {
    display: block;
    color: var(--autocrm-gray);
    font-weight: 400;
    font-size: 24px;
    margin-top: 8px;
}

.autocrm-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.autocrm-status-badge,
.autocrm-condition-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.autocrm-status-badge.available {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.autocrm-status-badge.reserved {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.autocrm-status-badge.sold {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.autocrm-condition-badge {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: var(--autocrm-dark);
}

.autocrm-price-box {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    border-left: 5px solid var(--autocrm-primary);
}

.autocrm-price-box .price {
    display: block;
    font-size: 48px;
    font-weight: 800;
    color: var(--autocrm-primary);
    margin-bottom: 8px;
    line-height: 1;
}

.autocrm-price-box .suffix {
    font-size: 18px;
    color: var(--autocrm-gray);
    margin-left: 10px;
    font-weight: 500;
}

.autocrm-price-box .note {
    margin-top: 15px;
    padding: 15px;
    background: var(--autocrm-white);
    border-radius: 8px;
    font-size: 15px;
    color: var(--autocrm-dark);
    line-height: 1.6;
}

/* ========================================
   ESPECIFICACIONES GRID
======================================== */

.autocrm-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.autocrm-spec-card {
    background: var(--autocrm-white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--autocrm-shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.autocrm-spec-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--autocrm-shadow-md);
    border-color: var(--autocrm-primary);
}

.autocrm-spec-card .icon {
    font-size: 36px;
    flex-shrink: 0;
}

.autocrm-spec-card .content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.autocrm-spec-card .label {
    font-size: 12px;
    color: var(--autocrm-gray);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.autocrm-spec-card .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--autocrm-dark);
    line-height: 1.2;
}

/* ========================================
   INFORMACIÓN ADICIONAL
======================================== */

.autocrm-additional-info {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fbbf24;
    border-radius: var(--autocrm-radius);
    padding: 35px;
    margin-bottom: 40px;
}

.autocrm-additional-info h3 {
    margin: 0 0 20px 0;
    color: var(--autocrm-dark);
    font-size: 24px;
    font-weight: 700;
}

.autocrm-additional-info p {
    margin: 15px 0;
    font-size: 16px;
    color: var(--autocrm-dark);
    line-height: 1.6;
}

.autocrm-additional-info strong {
    font-weight: 700;
    color: #92400e;
}

.autocrm-additional-info code {
    background: rgba(0,0,0,0.1);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 600;
}

/* ========================================
   DESCRIPCIÓN
======================================== */

.autocrm-vehicle-description {
    background: var(--autocrm-white);
    padding: 40px;
    border-radius: var(--autocrm-radius);
    box-shadow: var(--autocrm-shadow-md);
    margin-bottom: 40px;
}

.autocrm-vehicle-description h3 {
    margin: 0 0 25px 0;
    color: var(--autocrm-dark);
    font-size: 28px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--autocrm-light-gray);
}

.autocrm-vehicle-description p {
    line-height: 1.8;
    font-size: 16px;
    color: var(--autocrm-gray);
    margin-bottom: 15px;
}

/* ========================================
   FORMULARIO DE CONTACTO
======================================== */

.autocrm-contact-section {
    background: linear-gradient(135deg, var(--autocrm-primary) 0%, #1e40af 100%);
    padding: 50px;
    border-radius: var(--autocrm-radius);
    box-shadow: var(--autocrm-shadow-lg);
    color: white;
}

.autocrm-contact-section h3 {
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 700;
}

.autocrm-contact-section > p {
    margin-bottom: 30px;
    font-size: 18px;
    opacity: 0.9;
}

.autocrm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.autocrm-contact-section input,
.autocrm-contact-section textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: var(--autocrm-dark);
}

.autocrm-contact-section input:focus,
.autocrm-contact-section textarea:focus {
    outline: none;
    border-color: var(--autocrm-accent);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.autocrm-contact-section textarea {
    resize: vertical;
    min-height: 120px;
}

.autocrm-btn-submit {
    background: white;
    color: var(--autocrm-primary);
    padding: 18px 40px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.autocrm-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    background: var(--autocrm-accent);
    color: white;
}

.autocrm-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.autocrm-form-messages {
    margin-bottom: 20px;
}

.autocrm-success-message {
    background: var(--autocrm-secondary);
    color: white;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.autocrm-error-message {
    background: var(--autocrm-danger);
    color: white;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .autocrm-vehicle-detail {
        padding: 20px 15px;
    }

    .autocrm-vehicle-header {
        padding: 25px;
    }

    .autocrm-vehicle-header h1 {
        font-size: 26px;
    }

    .autocrm-vehicle-header h1 .model {
        font-size: 18px;
    }

    .autocrm-price-box .price {
        font-size: 36px;
    }

    .autocrm-specs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .autocrm-form-row {
        grid-template-columns: 1fr;
    }

    .autocrm-contact-section {
        padding: 30px 20px;
    }

    .autocrm-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }
}

/* ========================================
   LISTADO DE VEHÍCULOS
======================================== */

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

.autocrm-vehicle-card {
    background: var(--autocrm-white);
    border-radius: var(--autocrm-radius);
    overflow: hidden;
    box-shadow: var(--autocrm-shadow-sm);
    transition: all 0.3s ease;
}

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

.autocrm-vehicle-image {
    height: 240px;
    overflow: hidden;
    background: var(--autocrm-light-gray);
}

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

.autocrm-vehicle-card:hover .autocrm-vehicle-image img {
    transform: scale(1.1);
}

.autocrm-vehicle-info {
    padding: 25px;
}

.autocrm-vehicle-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: var(--autocrm-dark);
    line-height: 1.3;
}

.autocrm-vehicle-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--autocrm-primary);
    margin-bottom: 20px;
}

.autocrm-vehicle-specs {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--autocrm-gray);
}

.autocrm-btn-detail {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--autocrm-primary);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 16px;
}

.autocrm-btn-detail:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
