/**
 * Estilos para el Sistema de Promociones Múltiples
 * Carrusel con contadores independientes
 */

/* Contenedor principal del carrusel */
.promociones-carrusel-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    z-index: 10;
}

.promociones-swiper {
    width: 100% !important;
    height: auto;
}

/* Asegurar que el swiper de promociones ocupe todo el ancho */
.promociones-carrusel-container .swiper {
    width: 100% !important;
    height: auto !important;
}

/* Estilo de cada anuncio de promoción */
.anuncio-promo {
    display: flex !important;
    justify-content: space-evenly;
    align-items: center;
    padding: 1rem 2rem;
    min-height: 100px;
    transition: all 0.3s ease;
    width: 100%;
}

/* Fondo rojo para todas las promociones */
.bg-gradient-primary,
.bg-gradient-success,
.bg-gradient-warning {
    background: #dc3545 !important;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

/* Badge de tipo de promoción (2x1, 3x2) */
.badge-promo-tipo {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* Icono de promoción */
.promoImg {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Contenedor del temporizador */
.countdown-promo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.contenedor-temporizador {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.contenedor-temporizador .info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.contenedor-temporizador .detalle {
    font-size: 2rem;
    line-height: 1;
    display: block;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Botón de promoción */
.btnPromo {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.btnPromo:hover {
    background: white;
    color: #667eea !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Navegación del carrusel */
.promo-nav {
    color: white !important;
    background: rgba(255, 255, 255, 0.3) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.promo-nav:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.1);
}

.promo-nav::after {
    font-size: 1.2rem !important;
    font-weight: bold;
}

/* Paginación */
.promo-pagination {
    bottom: 10px !important;
    position: relative !important;
    margin-top: 0.5rem;
}

.promo-pagination .swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
    width: 10px;
    height: 10px;
}

.promo-pagination .swiper-pagination-bullet-active {
    opacity: 1;
    width: 24px;
    border-radius: 5px;
}

/* Desktop Grande (> 1400px) */
@media (min-width: 1400px) {
    .anuncio-promo {
        padding: 1.25rem 4rem;
        min-height: 110px;
    }
    
    .promoImg {
        width: 90px !important;
        height: 90px !important;
    }
    
    .anuncio-promo h2 {
        font-size: 2rem !important;
    }
    
    .contenedor-temporizador .detalle {
        font-size: 2.5rem;
    }
    
    .btnPromo {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* Desktop Estándar (1200px - 1400px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .anuncio-promo {
        padding: 1.15rem 3rem;
        min-height: 105px;
    }
    
    .promoImg {
        width: 85px !important;
        height: 85px !important;
    }
    
    .anuncio-promo h2 {
        font-size: 1.75rem !important;
    }
    
    .contenedor-temporizador .detalle {
        font-size: 2.25rem;
    }
}

/* Tablet Grande (768px - 992px) */
@media (min-width: 768px) and (max-width: 992px) {
    .anuncio-promo {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 2rem;
        min-height: auto;
    }
    
    .promoInline {
        width: 100%;
        justify-content: center !important;
    }
    
    .promoImg {
        width: 70px !important;
        height: 70px !important;
        margin: 0 1rem !important;
    }
    
    .anuncio-promo h2 {
        font-size: 1.5rem !important;
        text-align: center;
    }
    
    .contenedor-temporizador {
        gap: 1rem;
    }
    
    .contenedor-temporizador .info {
        min-width: 60px;
        font-size: 0.9rem;
    }
    
    .contenedor-temporizador .detalle {
        font-size: 1.8rem;
    }
    
    .btnPromo {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Tablet Pequeña (577px - 767px) */
@media (min-width: 577px) and (max-width: 767px) {
    .anuncio-promo {
        flex-direction: column;
        gap: 0.85rem;
        padding: 1.15rem 1.5rem;
        min-height: auto;
    }
    
    .promoInline {
        width: 100%;
        justify-content: center !important;
    }
    
    .promoImg {
        width: 55px !important;
        height: 55px !important;
        margin: 0 0.75rem !important;
    }
    
    .anuncio-promo h2 {
        font-size: 1.2rem !important;
        text-align: center;
    }
    
    .contenedor-temporizador {
        gap: 0.75rem;
    }
    
    .contenedor-temporizador .info {
        min-width: 50px;
        font-size: 0.75rem;
    }
    
    .contenedor-temporizador .detalle {
        font-size: 1.5rem;
    }
    
    .btnPromo {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Móvil Grande (400px - 576px) */
@media (min-width: 400px) and (max-width: 576px) {
    .anuncio-promo {
        padding: 1rem;
        min-height: auto;
        gap: 0.75rem;
        flex-direction: row !important;
        justify-content: space-between;
    }
    
    /* Ocultar texto de descripción en móvil */
    .anuncio-promo h2 {
        display: none !important;
    }
    
    .anuncio-promo .promo {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .promoImg {
        width: 50px !important;
        height: 50px !important;
        margin: 0 !important;
    }
    
    .badge-promo-tipo {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
        margin: 0;
    }
    
    .promoInline {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .contenedor-temporizador {
        gap: 0.4rem;
        justify-content: center;
    }
    
    .contenedor-temporizador .info {
        min-width: 42px;
        font-size: 0.65rem;
    }
    
    .contenedor-temporizador .detalle {
        font-size: 1.3rem;
    }
    
    .btnPromo {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        white-space: nowrap;
        text-align: center;
    }
    
    /* Ocultar botones de navegación en móvil */
    .promo-nav {
        display: none !important;
    }
}

/* Móvil Pequeño (< 400px) */
@media (max-width: 399px) {
    .anuncio-promo {
        padding: 0.85rem 0.5rem;
        min-height: auto;
        gap: 0.5rem;
        flex-direction: row !important;
        justify-content: space-between;
    }
    
    /* Ocultar texto de descripción en móvil pequeño */
    .anuncio-promo h2 {
        display: none !important;
    }
    
    .anuncio-promo .promo {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .promoImg {
        width: 40px !important;
        height: 40px !important;
        margin: 0 !important;
    }
    
    .badge-promo-tipo {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        margin: 0;
    }
    
    .promoInline {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .contenedor-temporizador {
        gap: 0.3rem;
        justify-content: center;
    }
    
    .contenedor-temporizador .info {
        min-width: 38px;
        font-size: 0.55rem;
    }
    
    .contenedor-temporizador .detalle {
        font-size: 1.1rem;
    }
    
    .btnPromo {
        padding: 0.5rem 0.85rem;
        font-size: 0.7rem;
        white-space: nowrap;
        text-align: center;
    }
    
    /* Ocultar botones de navegación en móvil pequeño */
    .promo-nav {
        display: none !important;
    }
}

/* Animación de entrada */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.promociones-carrusel-container {
    animation: slideInDown 0.5s ease-out;
}

/* Efecto de hover en el anuncio completo */
.anuncio-promo:hover .promoImg {
    transform: scale(1.1);
}

/* Indicador visual de múltiples promociones */
.swiper-pagination-bullet {
    transition: all 0.3s ease;
}

.swiper-pagination-bullet:hover {
    transform: scale(1.2);
}

/* Estilo para cuando la promoción está por expirar (menos de 1 hora) */
.anuncio-promo.expirando-pronto {
    animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.1);
    }
}

/* Mejora de accesibilidad */
.btnPromo:focus,
.promo-nav:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Soporte para modo oscuro */
@media (prefers-color-scheme: dark) {
    .anuncio-promo {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
}

/* Transiciones suaves para el carrusel */
.swiper-fade .swiper-slide {
    transition-property: opacity;
}

.swiper-fade .swiper-slide-active {
    z-index: 1;
}
