/* ========================================= */
/* 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(#ffffff);
}

/* ========================================= */
/* 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 (Compacto)                      */
/* ========================================= */
.publi-slider {
    width: 92%;
    margin: 10px auto 20px;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: var(--sombra);
}

.slider-wrapper {
    display: flex;
    width: 300%;
    animation: slide 12s infinite ease-in-out;
}

.slide { width: 100%; }

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

@keyframes slide {
    0%, 25% { transform: translateX(0%); }
    33%, 58% { transform: translateX(-33.333%); }
    66%, 91% { transform: translateX(-66.666%); }
    100% { transform: translateX(0%); }
}

/* ========================================= */
/* 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; /* Evita que el contenido se salga de la tarjeta */
}

/* Sección TURNO (Fija a la izquierda) */
.f-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px; /* Tamaño fijo para que no se achique */
    border-right: 1px solid #eee;
    padding-right: 8px;
    flex-shrink: 0; /* IMPORTANTE: impide que se aplaste */
}
.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 (EL QUE DESLIZA SI EL NOMBRE ES LARGO) */
.f-content {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
    overflow-x: auto; /* Activa el scroll horizontal si el texto no entra */
    scrollbar-width: none; /* Oculta scrollbar en Firefox */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iPhone */
}
.f-content::-webkit-scrollbar { display: none; } /* Oculta scrollbar en Chrome/Safari */

.f-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap; /* Impide que el nombre salte a otra línea */
    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; 
}

/* Divisores entre Nombre, Dirección y Tel */
.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; }

/* Botón Mapa (Fijo a la derecha) */
.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; /* IMPORTANTE: impide que se aplaste */
    transition: transform 0.2s;
}
.f-btn-mapa:active { transform: scale(0.9); }
/* Ajuste específico para pantallas muy pequeñas */
@media (max-width: 380px) {
    .f-item span { display: none; } /* Oculta el texto "Calle..." y deja solo el icono si es muy chico */
    .f-item.main-name span { display: inline; } /* Mantiene el nombre siempre */
}
/* ========================================= */
/* 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 (NUEVO)        */
/* ========================================= */
.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;
}

/* Ocultar botón si es necesario con JS */
.hidden { display: none; }

/* ========================================= */
/* ESTILOS ESPECÍFICOS PARA TU POPUP TEST    */
/* ========================================= */
.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px); /* Efecto desenfoque premium */
    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;
}

/* Cuando el popup tiene la opacidad en 1, agrandamos el contenido */
#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 (Optimizado) */
/* ========================================= */

@media (min-width: 768px) {
    body {
        max-width: 100%; /* Permitimos que ocupe el ancho en tablets */
        background-color: #f4f7f6;
    }

    /* 1. ARREGLO DEL SLIDER SUPERIOR */
    .publi-slider {
        max-width: 900px; /* Un poco más ancho en tablet/pc */
        margin: 20px auto;
    }

    .slide img {
        height: 170px; /* LE DAMOS MÁS ALTURA: Antes tenías 100px, por eso se veía mal */
        object-fit: cover; /* Mantiene la proporción sin estirar */
    }

    /* 2. ARREGLO DEL BANNER DE ABAJO (Test Político u otros) */
    /* Suponiendo que el banner de abajo tiene una clase o es una img dentro de una sección */
    .test-politico-banner img, 
    .banner-inferior img { 
        max-width: 800px; /* Limitamos el ancho para que no sea gigante */
        height: 180px;    /* Limitamos la altura */
        margin: 0 auto;
        display: block;
        border-radius: 15px;
        object-fit: cover;
    }

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

    /* 4. BOTONES APP */
    .billetera-botones {
        grid-template-columns: repeat(4, 1fr);
        max-width: 700px;
        margin: 0 auto;
        gap: 20px;
    }
    
    .boton-app {
        padding: 20px 10px; /* Botones más cómodos para dedos en tablet */
    }

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

    /* 5. GRILLA DE NOTICIAS */
    .lista-noticias {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en Tablet */
        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; /* Imagen de noticia un poco más grande */
    }
}

/* Ajuste extra para PC Grande */
@media (min-width: 1024px) {
    .lista-noticias {
        grid-template-columns: repeat(3, 1fr); /* 3 columnas en PC */
        max-width: 1200px;
    }
    
    .slide img {
        height: 300px; /* Todavía más presencia en monitores grandes */
    }
}