/* ================================================
   BARRA SUPERIOR — WHATSAPP / CARRUSEL / INSTAGRAM
   ================================================ */

.barra-superior {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999;
    width: 100%;
    background-color: #3a7d44 !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 60px;
    box-sizing: border-box;
    font-size: 13px;
    font-family: inherit;
}

body {
    padding-top: 45px !important;
}

/* Iconos pegados a la derecha */
body .barra-superior__iconos {
    position: absolute !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
}

.barra-superior__iconos a {
    color: #fff;
    opacity: 0.9;
    transition: opacity 0.2s ease, transform 0.2s ease;
    line-height: 0;
    display: inline-flex;
}

.barra-superior__iconos a:hover {
    opacity: 1;
    transform: scale(1.15);
}

body .barra-superior__iconos a,
body .barra-superior__iconos a:visited,
body .barra-superior__iconos a:hover {
    color: #fff !important;
}

/* Carrusel de mensajes */
.barra-superior__carrusel {
    position: relative;
    height: 22px;
    min-width: 280px;
    overflow: visible;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.barra-superior__mensaje {
    position: absolute;
    width: 100%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    white-space: nowrap;
    color: #fff !important;
}

.barra-superior__mensaje.activo {
    opacity: 1;
}

/* ================================================
   VERSIÓN MÓVIL OPTIMIZADA
   ================================================ */

@media (max-width: 768px) {
    .barra-superior {
        padding: 10px 12px !important;
        min-height: 55px;
    }
    
    body {
        padding-top: 55px !important;
    }
    
    /* Los iconos se colocan a la derecha pero dentro del flujo */
    body .barra-superior__iconos {
        position: relative !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        margin-left: 8px !important;
        flex-shrink: 0 !important;
    }
    
    /* El carrusel ocupa el espacio disponible y permite texto flexible */
    .barra-superior__carrusel {
        flex: 1 !important;
        min-width: 0 !important;  /* Permite que se reduzca */
        height: auto !important;
        min-height: 40px;
        overflow: hidden;
    }
    
    /* Los mensajes ahora permiten saltos de línea */
    .barra-superior__mensaje {
        white-space: normal !important;
        word-wrap: break-word !important;
        line-height: 1.3 !important;
        font-size: 12px;
        padding: 0 4px;
    }
    
    /* Ajuste del contenedor flex para mejor distribución */
    .barra-superior {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        gap: 8px;
    }
}

/* Para móviles muy pequeños (hasta 480px) */
@media (max-width: 480px) {
    .barra-superior {
        padding: 8px 10px !important;
        min-height: 52px;
    }
    
    body {
        padding-top: 52px !important;
    }
    
    .barra-superior__mensaje {
        font-size: 11px;
        line-height: 1.3;
    }
    
    body .barra-superior__iconos {
        gap: 8px !important;
    }
    
    .barra-superior__iconos svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Para tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .barra-superior {
        padding: 7px 30px;
    }
    
    .barra-superior__carrusel {
        min-width: 320px;
    }
}