/* ==========================================================================
   Wolf Banner Carousel - Frontend Styles
   ========================================================================== */

.wolf-banner-carousel {
    position: relative;
    width: 100%;
    padding-bottom: 37.5%; /* ✅ 16:6 ratio (6/16 = 0.375 = 37.5%) */
    min-height: 300px;
    max-height: 600px;
    overflow: hidden;
    border-radius: 0; /* ✅ Sin esquinas redondeadas */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    box-sizing: border-box; /* ✅ Incluir padding en el tamaño total */
    
    /* Variables CSS para posicionamiento configurable */
    --desktop-align-items: flex-end; /* center | flex-start | flex-end */
    --desktop-justify-content: flex-end; /* center | flex-start | flex-end */
    --desktop-text-align: right; /* left | center | right */
    --desktop-padding: 40px;
}

@media (min-width: 1600px) {
    .wolf-banner-carousel {
        max-height: 600px;
    }
}

/* Slides Wrapper */
.wbc-slides-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wbc-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Slide Item */
.wbc-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* La altura se define por inline styles desde el template */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.wbc-slide-item.wbc-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* Slide Image */
.wbc-slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover !important; /* ✅ Forzar cover sin mosaico */
    background-position: center !important;
    background-repeat: no-repeat !important; /* ✅ NUNCA repetir */
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wbc-slide-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* ✅ Siempre cubrir sin mosaico */
    object-position: center !important;
    display: block !important;
}

/* Slide Content */
/* Slide Content */
.wbc-slide-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: var(--desktop-align-items, flex-end); /* ✅ Configurable */
    justify-content: var(--desktop-justify-content, flex-end); /* ✅ Configurable */
    z-index: 2;
    background: transparent; /* ✅ Sin gradiente por defecto */
    padding: var(--desktop-padding, 40px); /* ✅ Configurable */
}

.wbc-slide-content-inner {
    max-width: 600px; /* ✅ Ancho máximo del contenido */
    width: auto;
    padding: 0;
    color: #fff;
    text-align: var(--desktop-text-align, right); /* ✅ Configurable */
}

.wbc-slide-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    animation: wbcSlideInRight 0.8s ease-out; /* ✅ Desde derecha */
}

.wbc-slide-description {
    font-size: 20px;
    margin: 0 0 24px 0;
    line-height: 1.5;
    max-width: 600px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    animation: wbcSlideInRight 0.8s ease-out 0.2s backwards; /* ✅ Desde derecha */
}

.wbc-slide-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* ✅ Espacio para icono */
    padding: 14px 32px;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    border-radius: 4px; /* ✅ Bordes menos redondeados */
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    animation: wbcSlideInRight 0.8s ease-out 0.4s backwards; /* ✅ Animación desde derecha */
    min-width: 150px; /* ✅ Ancho mínimo configurable */
    min-height: 48px; /* ✅ Alto mínimo configurable */
}

.wbc-slide-button svg,
.wbc-slide-button i {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.wbc-slide-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
    color: #fff;
}

/* Link Overlay */
.wbc-slide-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

/* Navigation Arrows */
.wbc-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.wbc-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.wbc-nav svg {
    color: #333;
}

.wbc-nav-prev {
    left: 20px;
}

.wbc-nav-next {
    right: 20px;
}

/* Dots Navigation */
.wbc-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.wbc-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 2px solid rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.wbc-dot:hover {
    background: rgba(255,255,255,0.8);
    transform: scale(1.2);
}

.wbc-dot.wbc-active {
    background: #fff;
    width: 30px;
    border-radius: 6px;
}

/* Animations */
@keyframes wbcSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes wbcSlideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes wbcFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .wolf-banner-carousel {
        padding-bottom: 50%; /* ✅ 16:8 ratio más cuadrado en tablet */
        min-height: 250px;
        max-height: 500px;
        
        /* Variables para tablet */
        --tablet-align-items: flex-end;
        --tablet-justify-content: flex-end;
        --tablet-text-align: right;
        --tablet-padding: 30px;
    }
    
    .wbc-slide-content {
        align-items: var(--tablet-align-items, var(--desktop-align-items, flex-end));
        justify-content: var(--tablet-justify-content, var(--desktop-justify-content, flex-end));
        padding: var(--tablet-padding, var(--desktop-padding, 30px));
    }
    
    .wbc-slide-content-inner {
        padding: 0;
        text-align: var(--tablet-text-align, var(--desktop-text-align, right));
        max-width: 500px; /* ✅ Reducir ancho máximo en tablet */
    }

    .wbc-slide-title {
        font-size: 32px; /* ✅ Ajustado para tablet */
        margin-bottom: 12px;
    }

    .wbc-slide-description {
        font-size: 16px; /* ✅ Ajustado para tablet */
        margin-bottom: 20px;
    }

    .wbc-slide-button {
        padding: 12px 24px;
        font-size: 14px;
        min-width: 140px;
        min-height: 44px;
    }

    .wbc-nav {
        width: 42px;
        height: 42px;
    }

    .wbc-nav-prev {
        left: 12px;
    }

    .wbc-nav-next {
        right: 12px;
    }
    
    .wbc-dots {
        bottom: 16px;
        gap: 8px;
    }

    .wbc-dot {
        width: 10px;
        height: 10px;
    }

    .wbc-dot.wbc-active {
        width: 25px;
    }
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    .wolf-banner-carousel {
        padding-bottom: 75%; /* ✅ 4:3 ratio en móvil (3/4 = 0.75 = 75%) */
        min-height: 0; /* ✅ Eliminar min-height para respetar el ratio */
        max-height: none; /* ✅ Sin límite máximo */
        margin: 0 !important; /* ✅ Sin margen en móvil */
        width: 100% !important; /* ✅ Ancho completo */
        
        /* Variables para móvil */
        --mobile-align-items: flex-end;
        --mobile-justify-content: center; /* ✅ Centrado en móvil por defecto */
        --mobile-text-align: center;
        --mobile-padding: 16px; /* ✅ Reducido para móvil */
    }
    
    .wbc-slide-image {
        background-size: cover !important; /* ✅ Forzar cover en móvil */
        background-position: center !important; /* ✅ Centrar imagen */
    }
    
    .wbc-slide-image img {
        object-fit: cover !important; /* ✅ Forzar cover sin mosaicos */
        object-position: center !important; /* ✅ Centrar imagen */
    }
    
    .wbc-slide-content {
        align-items: var(--mobile-align-items, var(--desktop-align-items, flex-end));
        justify-content: var(--mobile-justify-content, var(--desktop-justify-content, center));
        padding: var(--mobile-padding, var(--desktop-padding, 16px));
    }

    .wbc-slide-content-inner {
        padding: 0;
        max-width: 100%;
        width: 100%; /* ✅ Ancho completo en móvil */
        text-align: var(--mobile-text-align, var(--desktop-text-align, center));
    }

    .wbc-slide-title {
        font-size: 20px; /* ✅ Más compacto para móvil */
        margin-bottom: 8px;
        line-height: 1.3;
        word-wrap: break-word; /* ✅ Romper palabras largas */
    }

    .wbc-slide-description {
        font-size: 13px; /* ✅ Más compacto para móvil */
        margin-bottom: 12px;
        line-height: 1.4;
        word-wrap: break-word; /* ✅ Romper palabras largas */
    }

    .wbc-slide-button {
        padding: 8px 16px; /* ✅ Más compacto */
        font-size: 12px;
        min-width: 100px;
        min-height: 36px;
    }

    .wbc-nav {
        width: 32px; /* ✅ Más pequeño */
        height: 32px;
        opacity: 0.9;
    }

    .wbc-nav-prev {
        left: 6px;
    }

    .wbc-nav-next {
        right: 6px;
    }

    .wbc-dots {
        bottom: 10px;
        gap: 5px;
    }

    .wbc-dot {
        width: 7px;
        height: 7px;
        border-width: 1px;
    }

    .wbc-dot.wbc-active {
        width: 18px;
    }
}

/* Touch Support */
@media (hover: none) and (pointer: coarse) {
    .wbc-nav:hover {
        transform: translateY(-50%);
    }

    .wbc-dot:hover {
        transform: none;
    }
}

/* Extra Small Mobile (< 480px) */
@media (max-width: 480px) {
    .wolf-banner-carousel {
        padding-bottom: 85%; /* ✅ Ratio más vertical para pantallas muy pequeñas */
    }
    
    .wbc-slide-title {
        font-size: 18px; /* ✅ Aún más compacto */
        margin-bottom: 6px;
    }

    .wbc-slide-description {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .wbc-slide-button {
        padding: 7px 14px;
        font-size: 11px;
        min-width: 90px;
        min-height: 32px;
    }
    
    .wbc-nav {
        width: 28px;
        height: 28px;
    }
    
    .wbc-nav-prev {
        left: 4px;
    }

    .wbc-nav-next {
        right: 4px;
    }
    
    .wbc-dots {
        bottom: 8px;
        gap: 4px;
    }

    .wbc-dot {
        width: 6px;
        height: 6px;
    }

    .wbc-dot.wbc-active {
        width: 15px;
    }
}

/* Accessibility */
.wbc-nav:focus,
.wbc-dot:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Loading State */
.wolf-banner-carousel.wbc-loading {
    min-height: 500px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wolf-banner-carousel.wbc-loading::after {
    content: "";
    width: 50px;
    height: 50px;
    border: 4px solid #ddd;
    border-top-color: #e74c3c;
    border-radius: 50%;
    animation: wbcSpin 0.8s linear infinite;
}

@keyframes wbcSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Error State */
.wbc-error {
    padding: 20px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    text-align: center;
}
