/* =============================================
   AUTOPRIME — vehiculo.css
   Estilos específicos de la Product Detail Page (PDP).
   Usa tokens del sistema Steel Prime (--ap-accent = Steel Blue).
   ============================================= */

/* ========== ESTRUCTURA BASE ========== */
.pdp-section {
    padding: 3.5rem 0;
}

.pdp-section:first-of-type {
    padding-top: 7rem;
}

.pdp-section--hero {
    padding-bottom: 3rem;
}

/* ========== BREADCRUMB ========== */
.pdp-breadcrumb {
    margin-bottom: 2rem;
}

.pdp-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--ap-text-muted);
}

/* Separador entre items del breadcrumb: checker square en lugar de "›".
   Detalle de identidad (bandera a cuadros de AUTOPRIME) único de la PDP. */
.pdp-breadcrumb li + li::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.75rem;
    vertical-align: middle;
    background:
        conic-gradient(
            var(--checker-dark)  0 25%,
            var(--checker-light) 0 50%,
            var(--checker-dark)  0 75%,
            var(--checker-light) 0
        )
        0 0 / 5px 5px;
    opacity: 0.55;
    border-radius: 1px;
}

.pdp-breadcrumb a {
    color: var(--ap-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.pdp-breadcrumb a:hover {
    color: var(--ap-accent-text);
}

.pdp-breadcrumb li[aria-current="page"] {
    color: var(--ap-text);
    font-weight: 600;
}

/* ========== GALERÍA ========== */
.pdp-gallery-main {
    position: relative;
    background: var(--ap-bg-elevated);
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--ap-border);
    box-shadow: var(--ap-shadow);
    aspect-ratio: 4 / 3;
}

.pdp-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

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

.pdp-thumb {
    background: var(--ap-bg-elevated);
    border: 2px solid var(--ap-border);
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    aspect-ratio: 4 / 3;
}

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

.pdp-thumb:hover {
    border-color: var(--ap-accent);
    transform: translateY(-2px);
}

.pdp-thumb.is-active {
    border-color: var(--ap-accent);
    box-shadow: 0 4px 16px var(--ap-accent-glow);
}

/* ========== BADGE ========== */
.pdp-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    background: var(--ap-accent);
    color: white;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    z-index: 2;
    box-shadow: 0 4px 12px var(--ap-accent-glow);
}

.pdp-badge--oferta {
    background: var(--ap-warning);
    color: var(--ap-primary);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.pdp-badge--nuevo {
    background: var(--ap-success);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* ========== INFO PRINCIPAL ========== */
.pdp-info {
    position: sticky;
    top: 6.5rem;
}

.pdp-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--ap-text);
}

.pdp-year {
    display: inline-block;
    font-weight: 400;
    color: var(--ap-text-muted);
    margin-left: 0.25rem;
}

.pdp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    color: var(--ap-text-secondary);
    font-size: 0.9rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ap-border);
    margin-bottom: 1.25rem;
}

.pdp-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pdp-meta i {
    color: var(--ap-accent);
}

/* ========== PRECIO ========== */
.pdp-price-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 0 1.5rem;
}

.pdp-price-label {
    font-size: 0.8rem;
    color: var(--ap-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.pdp-price {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1;
    letter-spacing: -0.02em;
    background: var(--ap-gradient-aurora);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    position: relative;
    display: inline-block;
    padding-bottom: 0.6rem;
}

/* Underline checker bajo el precio — firma visual de AUTOPRIME.
   Rotación sutil de -2deg da sensación de movimiento/velocidad. */
.pdp-price::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background:
        conic-gradient(
            var(--checker-dark)  0 25%,
            var(--checker-light) 0 50%,
            var(--checker-dark)  0 75%,
            var(--checker-light) 0
        )
        0 0 / 4px 4px;
    transform: rotate(-2deg);
    transform-origin: left center;
    opacity: 0.75;
    border-radius: 1px;
}

.pdp-price-financed {
    color: var(--ap-text-secondary);
    font-size: 0.9rem;
}

.pdp-price-financed strong {
    color: var(--ap-text);
    font-weight: 600;
}

.pdp-price-link {
    color: var(--ap-accent-text);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.pdp-price-link:hover {
    color: var(--ap-accent-active);
}

/* ========== CTAs ========== */
.pdp-cta-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pdp-cta {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    justify-content: center;
}

.pdp-cta--wa {
    background: var(--ap-success);
    color: white;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

.pdp-cta--wa:hover {
    background: #1FB352;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
}

/* ========== TRUST ROW ========== */
.pdp-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ap-border);
    font-size: 0.8rem;
    color: var(--ap-text-secondary);
    text-align: center;
}

.pdp-trust div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.pdp-trust i {
    color: var(--ap-accent);
    font-size: 1.35rem;
}

/* ========== VIDEOS ==========
   Sección entre la galería y la ficha técnica. Player nativo con frame
   estilizado en Steel Prime. Auto-hide cuando el vehículo no tiene videos. */
.pdp-section--videos {
    padding-top: 1rem;
}

.pdp-videos-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: var(--ap-accent-soft);
    border: 1px solid var(--ap-border-accent);
    border-radius: 100px;
    color: var(--ap-accent-text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pdp-videos-count i {
    font-size: 0.95rem;
}

.pdp-videos {
    display: grid;
    gap: 1.75rem;
}

/* Un solo video: centrado, ancho cómodo (no full-width agresivo). */
.pdp-videos--single {
    grid-template-columns: minmax(0, 960px);
    justify-content: center;
}

/* Múltiples videos: grid que se auto-acomoda — 2 cols en desktop, 1 en móvil. */
.pdp-videos--multi {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

.pdp-video-card {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pdp-video-frame {
    position: relative;
    background: var(--ap-bg-elevated);
    border: 1px solid var(--ap-border);
    border-radius: 1.5rem;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: var(--ap-shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.pdp-video-frame:hover {
    border-color: var(--ap-border-accent);
    box-shadow: 0 12px 36px var(--ap-accent-glow);
    transform: translateY(-2px);
}

/* Acento de marca: sutil banda superior con gradient aurora — solo cuando
   el frame está en hover, para no saturar la vista en reposo. */
.pdp-video-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ap-gradient-aurora);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.pdp-video-frame:hover::before {
    opacity: 0.85;
}

.pdp-video-frame video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: cover;
}

.pdp-video-caption {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.5rem;
    font-size: 0.92rem;
    color: var(--ap-text-secondary);
    line-height: 1.4;
}

.pdp-video-caption i {
    color: var(--ap-accent);
    font-size: 1rem;
    flex-shrink: 0;
}

/* ========== SPECS GRID ========== */
.pdp-specs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.pdp-spec {
    background: var(--ap-bg-elevated);
    border: 1px solid var(--ap-border);
    border-radius: 1rem;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.pdp-spec:hover {
    border-color: var(--ap-border-accent);
    box-shadow: var(--ap-shadow-sm);
    transform: translateY(-2px);
}

.pdp-spec-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    background: var(--ap-accent-soft);
    color: var(--ap-accent-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pdp-spec-label {
    font-size: 0.75rem;
    color: var(--ap-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.pdp-spec-value {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ap-text);
    font-size: 1rem;
}

/* ========== DESCRIPCIÓN ========== */
.pdp-description {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--ap-text-secondary);
}

/* ========== EQUIPAMIENTO ========== */
.pdp-equipment {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.pdp-equipment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--ap-bg);
    border: 1px solid var(--ap-border);
    border-radius: 0.75rem;
    font-size: 0.9rem;
    color: var(--ap-text);
    transition: all 0.25s ease;
}

.pdp-equipment-item:hover {
    border-color: var(--ap-border-accent);
}

.pdp-equipment-item i {
    color: var(--ap-accent);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ========== CALCULADORA ========== */
.pdp-calculator {
    padding: 2.5rem;
}

.pdp-calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pdp-calc-row label {
    display: block;
    font-weight: 600;
    color: var(--ap-text);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.pdp-calc-field input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--ap-border);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.pdp-calc-field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--ap-gradient-aurora);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--ap-accent-glow);
    transition: transform 0.2s ease;
}

.pdp-calc-field input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.pdp-calc-field input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--ap-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.pdp-calc-field-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--ap-text-muted);
    font-weight: 500;
}

.pdp-calc-field-labels span:first-child {
    color: var(--ap-accent-text);
    font-weight: 700;
}

.pdp-calc-result {
    margin-top: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--ap-accent-soft);
    border: 1px solid var(--ap-border-accent);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pdp-calc-result-label {
    font-size: 0.85rem;
    color: var(--ap-text-secondary);
    font-weight: 600;
}

.pdp-calc-result-value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.75rem;
    background: var(--ap-gradient-aurora);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
    .pdp-section:first-of-type {
        padding-top: 6rem;
    }

    .pdp-info {
        position: static;
    }
}

@media (max-width: 575px) {
    .pdp-section {
        padding: 2.5rem 0;
    }

    .pdp-gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .pdp-trust {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .pdp-trust div {
        flex-direction: row;
        justify-content: flex-start;
    }

    .pdp-equipment {
        grid-template-columns: 1fr;
    }

    .pdp-calculator {
        padding: 1.5rem;
    }

    .pdp-videos--multi {
        grid-template-columns: 1fr;
    }

    .pdp-video-frame {
        border-radius: 1rem;
    }
}
