/* ========================================= */
/* 1. RESET & BASE (Fondo Blanco)            */
/* ========================================= */
:root {
    --azul-lules: #005fa3;
    --azul-oscuro: #004a80;
    --blanco: #ffffff;
    --gris-fondo: #ffffff; 
    --gris-suave: #f8f9fa;
    --sombra: 0 4px 12px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
    text-decoration: none !important;
}

body {
    background-color: var(--blanco);
    color: #333;
    line-height: 1.4;
    padding-bottom: 80px; /* Espacio para que el botón flotante no tape contenido */
}

/* Barra superior: clima y usuario */
.top-bar {
    background: var(--blanco);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    min-height: 45px;
}

#TT_yCegrxthYQSKM8hKKAqDzjzjzWaKT4tAeqaB1x1vGdg {
    font-size: 13px;
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-info small {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.user-info i {
    color: var(--blanco);
}

/* ========================================= */
/* 2. BUSCADOR (Píldora Premium)             */
/* ========================================= */
.buscador-container {
    padding: 10px 20px;
    background: var(--blanco);
}

.buscador {
    display: flex;
    align-items: center;
    background: var(--gris-suave);
    border-radius: 50px;
    padding: 5px 18px;
    border: 1px solid #eaeaea;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.buscador input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 10px;
    outline: none;
    font-size: 15px;
    color: #444;
}

.buscador button {
    background: none;
    border: none;
    color: var(--azul-lules);
    font-size: 18px;
    cursor: pointer;
    padding-left: 10px;
}

/* ========================================= */
/* 3. SLIDER CON EFECTO FADE PURO (Sin deslizamiento) */
/* ========================================= */
.publi-slider {
    width: 100%;
    max-width: 900px;
    height: 160px;
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: var(--sombra);
    background: #f1f5f9;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: block !important; /* Forzamos a que no actúe como flex ni se estire */
    animation: none !important; /* Anulamos cualquier animación vieja de movimiento */
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out; /* Único efecto permitido: desvanecimiento suave */
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 18px;
}

/* ========================================= */
/* 4. FARMACIA (Versión Ultra-Compacta Pro)  */
/* ========================================= */

.farmacia-card-compacta {
    background: #fff;
    margin: 10px auto;
    padding: 8px 12px;
    border-radius: 12px;
    width: 95%;
    max-width: 800px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #eee;
    border-left: 5px solid var(--azul-lules);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Sección TURNO (Fija a la izquierda) */
.f-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    border-right: 1px solid #eee;
    padding-right: 8px;
    flex-shrink: 0;
}
.f-header img { width: 20px !important; height: auto; margin: 0 !important; }
.f-header span { font-size: 8px; font-weight: 900; color: var(--azul-lules); }

/* Contenedor central */
.f-content {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.f-content::-webkit-scrollbar { display: none; }

.f-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 12px;
    color: #444;
}

.f-item strong { 
    color: #000; 
    font-size: 13px; 
    font-weight: 700; 
}

.f-item i { 
    color: var(--azul-lules); 
    font-size: 11px; 
}

.f-divider {
    min-width: 1px;
    height: 16px;
    background: #eee;
    flex-shrink: 0;
}

.f-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 4px; }

.f-btn-mapa {
    background: var(--azul-lules);
    color: #fff !important;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.f-btn-mapa:active { transform: scale(0.9); }

@media (max-width: 380px) {
    .f-item span { display: none; } 
    .f-item.main-name span { display: inline; } 
}

/* ========================================= */
/* 5. BOTONES APP (Grilla)                   */
/* ========================================= */
.billetera-botones {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 15px 20px;
}

.boton-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--blanco);
    padding: 12px 5px;
    border-radius: 15px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.boton-app i { font-size: 22px; color: var(--azul-lules); margin-bottom: 6px; }
.boton-app span { font-size: 10px; color: #555; font-weight: bold; text-transform: uppercase; }

/* ========================================= */
/* 6. NOTICIAS                               */
/* ========================================= */
.noticia-item {
    background: var(--blanco);
    margin: 15px 20px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    box-shadow: var(--sombra);
}

.noticia-item img { width: 100%; height: 170px; object-fit: cover; }
.noticia-body { padding: 15px; }
.noticia-body h2 { font-size: 16px; margin-bottom: 8px; color: var(--azul-oscuro); }

.btn-leer {
    background: #f0f4f8;
    color: var(--azul-lules) !important;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 13px;
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
}

/* ========================================= */
/* 7. BOTÓN FLOTANTE DE LOGIN                */
/* ========================================= */
.floating-login {
    position: fixed;
    bottom: 25px;
    right: 20px;
    background: var(--azul-lules);
    color: white !important;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0,95,163,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    border: 2px solid white;
    transition: all 0.3s ease;
}

.floating-login:active {
    transform: scale(0.9);
}

.floating-login i {
    font-size: 22px;
    margin-bottom: 2px;
}

.floating-login span {
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
}

.hidden { display: none; }

/* ========================================= */
/* ESTILOS POPUP                             */
/* ========================================= */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#testPopup[style*="opacity: 1"] .popup-content {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
}

.popup-btn {
    display: block;
    background: #28a745;
    color: white !important;
    text-decoration: none;
    font-weight: bold;
    border-radius: 12px;
    margin-top: 20px;
    transition: background 0.3s;
}

.popup-btn:hover {
    background: #218838;
}

/* ========================================= */
/* 8. ADAPTACIÓN PARA TABLET Y PC            */
/* ========================================= */
@media (min-width: 768px) {
    body {
        max-width: 100%;
        background-color: #f4f7f6;
    }

    .publi-slider {
        max-width: 900px;
        height: 220px; /* Altura más cómoda para pantallas medianas */
        margin: 20px auto;
    }

    .test-politico-banner img, 
    .banner-inferior img { 
        max-width: 800px;
        height: 180px;    
        margin: 0 auto;
        display: block;
        border-radius: 15px;
        object-fit: cover;
    }

    .buscador-container {
        max-width: 600px;
        margin: 0 auto 10px;
    }

    .billetera-botones {
        grid-template-columns: repeat(4, 1fr);
        max-width: 700px;
        margin: 0 auto;
        gap: 20px;
    }
    
    .boton-app {
        padding: 20px 10px;
    }

    .boton-app i { font-size: 28px; }
    .boton-app span { font-size: 12px; }

    .lista-noticias {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        max-width: 1000px;
        margin: 0 auto;
        padding: 20px;
    }

    .noticia-item {
        margin: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .noticia-item img {
        height: 200px;
    }
}

@media (min-width: 1024px) {
    .lista-noticias {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
    }
    
    .publi-slider {
        height: 300px; /* Altura amplia para computadoras */
    }
}