/**
 * Carrusel de productos destacados — hero de la portada.
 * Ficha blanca sobre la foto oscura del lado derecho del hero.
 */

/* =========================================================================
   1. Ubicación dentro del hero
   ========================================================================= */

.ene-hero {
    gap: var(--sp-6);
}

.ene-dest {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: clamp(280px, 27vw, 370px);
    margin-right: var(--sp-8);
    background: var(--ene-white);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    overflow: hidden;
}

/* =========================================================================
   2. Pista y fichas
   ========================================================================= */

.ene-dest .ene-dest-pista {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform 700ms cubic-bezier(.65, 0, .35, 1);
    will-change: transform;
}

.ene-dest .ene-dest-slide {
    flex: 0 0 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
}

.entry-content .ene-dest a.ene-dest-link,
.entry-content .ene-dest a.ene-dest-link:hover {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: var(--ene-ink);
    text-decoration: none;
}

.ene-dest-link:focus-visible {
    outline: 3px solid var(--ene-primary);
    outline-offset: -3px;
}

/* Foto o ícono de categoría */
.ene-dest-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    background: var(--ene-surface-2);
}

.ene-dest-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--sp-4);
    mix-blend-mode: multiply;
}

.ene-dest-icono {
    width: 34%;
    height: auto;
    fill: none;
    stroke: var(--ene-chrome-dim);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Motivo: por qué aparece el producto */
.ene-dest-motivo {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-3);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.3;
}

.ene-dest-motivo--vendido {
    background: var(--ene-ink);
    color: var(--ene-white);
}

.ene-dest-motivo--oferta {
    background: var(--ene-primary);
    color: var(--ene-white);
}

.ene-dest-motivo--recomendado {
    background: var(--ene-white);
    color: var(--ene-ink);
    box-shadow: inset 0 0 0 1.5px var(--ene-ink);
}

/* Texto */
.ene-dest-info {
    display: flex;
    flex-direction: column;
    padding: var(--sp-4) var(--sp-5) var(--sp-2);
}

.ene-dest-cat {
    font-size: var(--text-sm);
    color: var(--ene-text-muted);
    margin-bottom: 2px;
}

.ene-dest-nombre {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
    font-family: var(--font-body);
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--sp-2);
    color: var(--ene-ink);
}

.ene-dest .ene-dest-link:hover .ene-dest-nombre {
    color: var(--ene-primary);
}

/* El precio es lo que más se ve: etiqueta grande en Bebas Neue */
.entry-content .ene-dest-precio {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 3.2vw, 2.9rem);
    line-height: 1;
    letter-spacing: 1px;
    color: var(--ene-ink);
}

.entry-content .ene-dest-antes {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0 0 2px;
    font-size: var(--text-sm);
    color: var(--ene-text-muted);
}

.ene-dest-dcto {
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--ene-primary-light);
    color: var(--ene-primary-dark);
    font-weight: 700;
}

/* =========================================================================
   3. Controles: avance automático + flechas
   ========================================================================= */

.ene-dest-controles {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4) var(--sp-4) var(--sp-5);
}

.ene-dest-puntos {
    display: flex;
    flex: 1;
    gap: 4px;
}

/* Cada segmento muestra cuánto falta para pasar al siguiente producto */
.ene-dest-punto {
    flex: 1;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.ene-dest-punto span {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: var(--ene-surface-3);
    background-image: linear-gradient(var(--ene-ink), var(--ene-ink));
    background-repeat: no-repeat;
    background-size: 0 100%;
}

.ene-dest-punto.is-visto span {
    background-size: 100% 100%;
}

.ene-dest-punto:focus-visible,
.ene-dest-flecha:focus-visible {
    outline: 2px solid var(--ene-primary);
    outline-offset: 2px;
}

.ene-dest-flecha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1.5px solid var(--ene-border-dark);
    border-radius: var(--radius-full);
    background: var(--ene-white);
    color: var(--ene-ink);
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-both), color var(--duration-fast) var(--ease-both);
}

.ene-dest-flecha:hover {
    border-color: var(--ene-primary);
    color: var(--ene-primary);
    background: var(--ene-white);
}

.ene-dest-flecha svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ene-dest-next svg {
    transform: scaleX(-1);
}

/* El deslizamiento se mantiene aunque el sistema pida reducir animaciones:
   enerepuestos.css las acorta a .01ms para todo (*) y aquí se recupera solo para la pista. */
@media (prefers-reduced-motion: reduce) {
    .ene-dest .ene-dest-pista {
        transition-duration: 700ms !important;
    }
}

/* =========================================================================
   4. Responsivo
   ========================================================================= */

@media (max-width: 1100px) and (min-width: 768px) {
    .ene-dest {
        margin-right: var(--sp-6);
    }

    .ene-hero-content {
        padding-right: 0;
    }
}

/* Celular: ficha horizontal bajo los botones, antes de la foto */
@media (max-width: 767px) {
    .ene-hero {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .ene-hero-content {
        width: 100%;
        box-sizing: border-box;
    }

    .ene-dest {
        width: calc(100% - 2 * var(--sp-4));
        max-width: 440px;
        margin: 0 auto var(--sp-5);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--ene-border);
    }

    .entry-content .ene-dest a.ene-dest-link,
    .entry-content .ene-dest a.ene-dest-link:hover {
        flex-direction: row;
        align-items: stretch;
    }

    .ene-dest-media {
        flex: 0 0 38%;
        aspect-ratio: auto;
        min-height: 128px;
    }

    .ene-dest-motivo {
        top: var(--sp-2);
        left: var(--sp-2);
        padding: 3px 7px;
    }

    .ene-dest-info {
        flex: 1;
        min-width: 0;
        justify-content: center;
        padding: var(--sp-3) var(--sp-4);
        text-align: left;
    }

    .ene-dest-nombre {
        font-size: var(--text-base);
        min-height: 0;
    }

    .entry-content .ene-dest-precio {
        font-size: 2rem;
    }

    .ene-dest-controles {
        padding: 0 var(--sp-3) var(--sp-2) var(--sp-4);
        border-top: 1px solid var(--ene-border);
    }

    .ene-dest-flecha {
        width: 40px;
        height: 40px;
        border: 0;
    }
}
