/* ═══════════════════════════════════════════
   WH Rotator — Frontend CSS
   Modo slider + modo carrusel
   ═══════════════════════════════════════════ */

/* ── Variables ── */
.whr-wrapper {
    --whr-height:       420px;
    --whr-ratio-pct:    56.25%;   /* 16/9 por defecto */
    --whr-overlay-bg:   linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 60%);
    --whr-accent:       #86bc26;
    --whr-radius:       8px;
    --whr-transition:   .4s cubic-bezier(.4,0,.2,1);

    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ════════════════════════════════
   MODO SLIDER
════════════════════════════════ */
.whr-mode-slider .whr-swiper {
    width: 100%;
}

.whr-mode-slider .whr-slide {
    height: var(--whr-height);
    position: relative;
    overflow: hidden;
    border-radius: var(--whr-radius);
}

.whr-mode-slider .whr-img-wrap {
    width: 100%;
    height: 100%;
}

.whr-mode-slider .whr-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--whr-transition);
}

.whr-mode-slider .whr-link:hover .whr-img {
    transform: scale(1.04);
}

/* ════════════════════════════════
   MODO CARRUSEL
════════════════════════════════ */
.whr-mode-carousel .whr-swiper {
    width: 100%;
    padding-bottom: 8px;
}

.whr-mode-carousel .whr-slide {
    border-radius: var(--whr-radius);
    overflow: hidden;
}

.whr-mode-carousel .whr-img-wrap {
    position: relative;
    width: 100%;
    padding-top: var(--whr-ratio-pct); /* aspect-ratio via padding hack */
    overflow: hidden;
}

.whr-mode-carousel .whr-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--whr-transition);
}

.whr-mode-carousel .whr-link:hover .whr-img {
    transform: scale(1.05);
}

/* ════════════════════════════════
   LINK
════════════════════════════════ */
.whr-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--whr-radius);
    text-decoration: none;
    color: inherit;
}

/* ════════════════════════════════
   OVERLAY de texto
════════════════════════════════ */
.whr-overlay {
    position: absolute;
    inset: 0;
    background: var(--whr-overlay-bg);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 28px;
    border-radius: var(--whr-radius);

    /* Oculto por defecto en carrusel, siempre visible en slider */
    opacity: 0;
    transform: translateY(6px);
    transition: opacity var(--whr-transition), transform var(--whr-transition);
}

/* Slider: overlay siempre visible */
.whr-mode-slider .whr-overlay {
    opacity: 1;
    transform: none;
}

/* Carrusel: overlay aparece al hover */
.whr-mode-carousel .whr-link:hover .whr-overlay,
.whr-mode-carousel .whr-slide:hover .whr-overlay {
    opacity: 1;
    transform: translateY(0);
}

.whr-titulo {
    margin: 0 0 6px;
    font-size: clamp(16px, 2.5vw, 28px);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.whr-subtitulo {
    margin: 0 0 10px;
    font-size: clamp(12px, 1.5vw, 15px);
    color: rgba(255,255,255,.85);
    line-height: 1.4;
}

.whr-cta {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: var(--whr-accent);
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: .3px;
    transition: background .2s, transform .2s;
}

.whr-link:hover .whr-cta {    
    background: var(--whr-accent);
    transform: translateX(3px);
}

/* ════════════════════════════════
   NAVEGACIÓN (flechas)
════════════════════════════════ */
.whr-nav-next,
.whr-nav-prev {
    --swiper-navigation-color: #fff;
    --swiper-navigation-size: 18px;
    width: 42px !important;
    height: 42px !important;
    background: rgba(0,0,0,.45);
    border-radius: 50%;
    backdrop-filter: blur(6px);
    transition: background .2s, transform .2s;
}

.whr-nav-next:hover,
.whr-nav-prev:hover {
    background: rgba(0,0,0,.7);
    transform: scale(1.1);
}

.whr-nav-next::after,
.whr-nav-prev::after {
    font-size: 14px !important;
    font-weight: 900 !important;
}

/* ════════════════════════════════
   PAGINACIÓN (dots)
════════════════════════════════ */
.whr-dots {
    --swiper-pagination-color: var(--whr-accent);
    --swiper-pagination-bullet-inactive-color: rgba(0,0,0,.3);
    --swiper-pagination-bullet-inactive-opacity: 1;
    --swiper-pagination-bullet-size: 8px;
    --swiper-pagination-bullet-horizontal-gap: 4px;
}

/* En slider los dots van dentro, en carrusel abajo */
.whr-mode-slider .whr-dots {
    bottom: 16px !important;
}

.whr-mode-carousel .whr-dots {
    position: relative !important;
    margin-top: 10px;
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 480px) {
    .whr-overlay {
        padding: 16px;
    }
    .whr-mode-slider .whr-slide {
        height: 220px;
    }
}
