/**
 * Nexir Featured Products - Frontend styles
 *
 * Acento vía --nxr-accent (ver CLAUDE.md). Carrusel Splide a ancho completo con
 * cabecera de sección y flechas de marca. Reaprovecha las miniaturas del tema.
 *
 * @author    Nexir
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 */

.nxr-featured-products {
    width: 100%;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

/* Cabecera: título centrado + flechas arriba a la derecha */
.nxr-featured-products .nxr-featured-header {
    position: relative;
    margin-bottom: 1.5rem;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nxr-featured-products .products-section-title {
    margin: 0;
    padding: 0;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
    text-align: center;
    text-transform: none;
}

/* Bloque de flechas anclado a la derecha de la fila del título */
.nxr-featured-products .splide__arrows {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

/* Contenedor del carrusel */
.nxr-featured-products .splide,
.nxr-featured-products .splide__track {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nxr-featured-products .splide__list {
    display: flex;
    margin: 0;
    padding: 0;
    justify-content: flex-start !important;
}

.nxr-featured-products .splide__slide {
    flex: 0 0 auto;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px !important;
    margin: 0 !important;
}

/* Flechas de marca (estáticas dentro de la cabecera, no centradas en los lados) */
.nxr-featured-products .splide__arrow {
    position: static !important;
    transform: none !important;
    top: auto;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--nxr-accent, #1f2937) !important;
    border: 0;
    box-shadow: none;
    opacity: 1;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.nxr-featured-products .splide__arrow:hover {
    background: #0030c4 !important;
}

.nxr-featured-products .splide__arrow svg {
    display: inline-block;
    width: 18px;
    height: 18px;
    fill: none;
    transform: none !important; /* anula el scaleX(-1) que splide.min.css aplica al prev */
}

.nxr-featured-products .splide__arrow svg path {
    stroke: #ffffff;
}

.nxr-featured-products .splide__arrow:disabled {
    opacity: 0.35;
}

/* Imagen del producto */
.nxr-featured-products .thumbnail-container > a.product-thumbnail > img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.nxr-featured-products .thumbnail-container {
    margin-bottom: 0;
}

/* Título del producto: máx 3 líneas */
.nxr-featured-products .product-miniature .product-title,
.nxr-featured-products .product-miniature .product-title a {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.85rem;
    line-height: 1.4 !important;
    min-height: calc(1.4em * 3) !important;
    max-height: calc(1.4em * 3) !important;
}

/* Precio destacado en azul de marca */
.nxr-featured-products .product-price-and-shipping .price {
    color: var(--nxr-accent-dark, #1f2937);
    font-weight: 700;
    font-size: 0.95rem;
}

/* Ocultar reviews del listado si el tema las pinta */
.nxr-featured-products .dbproduct_list_reviews {
    display: none !important;
}

@media (max-width: 992px) {
    .nxr-featured-products .splide__arrows {
        display: none !important;
    }
}

@media (max-width: 575px) {
    .nxr-featured-products .products-section-title {
        font-size: 1.3rem;
    }
}
