/* ============================================================
   PORTAL – ÁREA DE SALUD UPALA (ULTRA-MODERNO / BENTO GRID)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Fuentes */
    --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Base Colors - Premium Dark/Light theme */
    --bg-base: #f0f4f8;        /* Light grayish blue */
    --text-primary: #0f172a;   /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-tertiary: #64748b;  /* Slate 500 */

    /* Glass Effect (Light mode) */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-highlight: rgba(255, 255, 255, 0.9);

    /* Institucional Colors / Accents */
    --accent-blue: #0a2463;     /* CCSS Deep Blue */
    --accent-blue-light: #2563eb;
    --accent-cyan: #06b6d4;     
    --accent-green-light: #10b981;
    --accent-purple: #8b5cf6;

    /* Shadows Premium (Layered) */
    --shadow-glass: 0 8px 32px 0 rgba(10, 36, 99, 0.08);
    --shadow-float: 0 20px 40px -10px rgba(10, 36, 99, 0.15);
    --shadow-inner: inset 0 1px 1px rgba(255, 255, 255, 0.8), inset 0 -1px 1px rgba(0, 0, 0, 0.02);

    /* Radios (Estilo iOS) */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --radius-pill: 100px;

    /* Transiciones fluidas */
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.15);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET Y BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-base);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* ============================================================
   MESH GRADIENT BACKGROUND (ANIMADO)
   ============================================================ */
.mesh-background {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background-color: #e2e8f0;
    overflow: hidden;
    opacity: 0.6;
}

.mesh-blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    animation: flow 20s infinite alternate ease-in-out;
    opacity: 0.5;
}

.blob-1 {
    top: -10%; left: -10%;
    width: 60vw; height: 60vw;
    background: var(--accent-cyan);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%; right: -10%;
    width: 50vw; height: 50vw;
    background: var(--accent-blue-light);
    animation-delay: -5s;
    animation-duration: 25s;
}

.blob-3 {
    top: 40%; left: 60%;
    width: 40vw; height: 40vw;
    background: var(--accent-green-light);
    animation-delay: -10s;
    animation-duration: 18s;
}

@keyframes flow {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(15%, 20%) scale(1.1); }
    66%  { transform: translate(-10%, -10%) scale(0.9); }
    100% { transform: translate(5%, -15%) scale(1.05); }
}

/* Decoración de ruido (Grain) para textura premium */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Contenedor Principal Limitado (Estilo Mobile-First App) */
.page-wrapper {
    max-width: 450px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: rgba(255,255,255,0.4);
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255,255,255,0.4);
    border-right: 1px solid rgba(255,255,255,0.4);
}

/* ============================================================
   GLASS NAVBAR (ISLA DINÁMICA STYLE)
   ============================================================ */
.navbar {
    position: sticky;
    top: 15px;
    z-index: 100;
    margin: 0 15px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass), var(--shadow-inner);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(10,36,99,0.15);
}

.navbar-title-block {
    display: flex;
    flex-direction: column;
}

.navbar-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 0.2px;
    line-height: 1.1;
}

.navbar-subtitle {
    font-size: 0.55rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar-secondary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Se agregó este fondo sutil para que imite la encapsulación del reloj perdido sin verse deforme */
    background: rgba(255,255,255,0.6);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.9);
}

.navbar-logo-secondary {
    height: 26px; /* Tamaño reducido a petición del usuario */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(10,36,99,0.1));
}

/* ============================================================
   HERO AREA (SALUDO TYPOGRAPHY)
   ============================================================ */
.hero {
    padding: 40px 24px 20px;
    position: relative;
    z-index: 10;
}


.hero-greeting {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.05;
    letter-spacing: -1px;
    margin-bottom: 24px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--accent-blue-light), var(--accent-cyan));
    -webkit-background-clip: text; /* Mantenido para IE/WebKit compatibilidad */
    background-clip: text; /* Corrección de linting (estándar property) */
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ============================================================
   BENTO GRID (SERVICIOS)
   ============================================================ */
.bento-grid {
    padding: 0 16px 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto auto;
    gap: 14px;
    z-index: 10;
    position: relative;
}

/* Glass Card Base */
.bento-item {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-glass), var(--shadow-inner);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease, border-color 0.4s ease, filter 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    animation: fadeUp 0.6s var(--ease-spring) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.bento-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-float), var(--shadow-inner);
    background: rgba(255,255,255,0.85);
}

.bento-item:active {
    transform: scale(0.97);
}



/* Layout Bento asimétrico */
/* Card 1: Ancho completo (Certificado Médico - la más usada) */
.bento-item.card-primary {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: #1a3fb0;
    border: 1px solid rgba(6, 182, 212, 0.5);
    box-shadow: 0 10px 40px -8px rgba(10, 36, 99, 0.5), 0 0 0 1px rgba(6,182,212,0.15), inset 0 1px 0 rgba(255,255,255,0.15);
    animation-delay: 0.1s;
    position: relative;
    overflow: hidden;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Resplandor decorativo interno removido para look sólido */
.bento-item.card-primary::after {
    display: none;
}

.card-primary .bento-icon {
    /* Anchura fluida: min 44px, prefiere 15vw, max 64px */
    width: clamp(44px, 12vw, 64px); 
    height: clamp(44px, 12vw, 64px);
    background: #ffffff;
    color: #1a3fb0;
    font-size: clamp(22px, 6vw, 32px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: none;
    flex-shrink: 0;
}

/* Identificadores para animaciones retrasadas */
#card-transporte { animation-delay: 0.2s; }
#card-cita { animation-delay: 0.3s; }
#card-receta { 
    grid-column: span 2; 
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    animation-delay: 0.4s; 
}

/* Iconos de las tarjetas Bento */
.bento-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

/* Decoraciones de iconos */
.icon-transporte {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: var(--accent-amber);
    box-shadow: inner 0 2px 0 rgba(255,255,255,0.8);
}
.icon-cita {
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: var(--accent-purple);
}
.icon-receta {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: var(--accent-green);
    margin-bottom: 0 !important; /* Por ser horizontal */
}

/* Tipografía de las tarjetas */
.bento-content {
    flex: 1;
}

.bento-item h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.bento-item p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Texto blanco para la card primaria */
.card-primary h3 {
    color: #ffffff;
    font-size: 1.25rem;
    letter-spacing: 0.03em;
}

.card-primary p {
    color: rgba(255,255,255,0.75);
}

/* Texto de "Presione aquí" en tarjetas (CTA) */
.card-cta {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-blue-light);
    background: rgba(37, 99, 235, 0.1);
    padding: 6px 14px; /* Un poco más de padding vertical para equilibrarlo */
    border-radius: var(--radius-pill);
    letter-spacing: 0.2px;
    white-space: nowrap; /* 🔥 Evita que el texto salte a 2 líneas */
    max-width: 100%; /* Evita que crezca desproporcionadamente */
    overflow: hidden;
    text-overflow: ellipsis; /* Si el espacio colapsa mucho en móviles, añade "..." */
    transition: all 0.3s ease;
}

.bento-item:hover .card-cta {
    background: var(--accent-blue-light);
    color: white;
    transform: translateX(4px);
}

.card-primary .card-cta {
   /* background: #06b6d4;*/
   background: #ff2791;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    font-size: 0.72rem;
    padding: 12px 24px;
    animation: pulse-ring-solid 2.2s infinite;
    font-weight: 700;
    letter-spacing: 0.3px;
}

@keyframes pulse-ring-solid {
    0%   { box-shadow: 0 4px 14px rgba(0,0,0,0.2), 0 0 0 0 rgba(255, 206, 230, 0.445); }
    70%  { box-shadow: 0 4px 14px rgba(0,0,0,0.2), 0 0 0 12px rgba(255, 39, 145, 0); }
    100% { box-shadow: 0 4px 14px rgba(0,0,0,0.2), 0 0 0 0 rgba(255, 39, 145, 0); }
}

.card-primary:hover .card-cta {
    background: rgba(255,255,255,0.35);
    color: white;
    border-color: rgba(255,255,255,0.7);
    animation: none;
}

/* Flecha eliminada */

/* ============================================================
   SECCIÓN DE VIDEOS (GLASS DARK)
   ============================================================ */
.videos-wrapper {
    margin: 10px 16px 40px;
    background: rgba(15, 23, 42, 0.85); /* Oscuro translúcido */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-xl);
    padding: 30px 16px 40px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.6s var(--ease-spring) 0.5s both;
}

.videos-wrapper::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 150px; height: 150px;
    background: var(--accent-blue-light);
    filter: blur(60px);
    border-radius: 50%;
    opacity: 0.4;
    z-index: 0;
}

.video-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 10;
}

.video-label {
    font-size: 0.85rem; /* Un poco más grande para compensar faltante de h2 */
    font-weight: 800;
    letter-spacing: 4px; /* Mayor espaciado entre letras */
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 12px;
}

.videos-wrapper h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: white;
    font-weight: 700;
}

/* Video Containers */
.splide__slide {
    padding: 15px 0; /* Evitar recortes durante la animación Hover */
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
    padding-bottom: 177.78%; /* Ratio 9:16 Shorts */
    height: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease, border-color 0.4s ease;
}

.video-container:hover {
    transform: scale(1.02) translateY(-4px); /* Hover más sutil para que no sea brusco */
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 0 4px rgba(6, 182, 212, 0.2);
}

.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* Custom Splide UI - App style */
.splide__arrow {
    background: rgba(255,255,255,0.1) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: white !important;
    width: 44px !important;
    height: 44px !important;
}

.splide__pagination {
    bottom: -20px !important;
}
.splide__pagination__page {
    background: rgba(255,255,255,0.2) !important;
    width: 6px !important; height: 6px !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
}
.splide__pagination__page.is-active {
    background: var(--accent-cyan) !important;
    width: 20px !important;
    border-radius: 4px !important;
    box-shadow: 0 0 10px rgba(6,182,212,0.5) !important;
}

/* ============================================================
   WIDGET FLOTANTE WHATSAPP (DYNAMIC BUTTON)
   ============================================================ */
.floating-button {
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: var(--radius-pill);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4), inset 0 2px 2px rgba(255,255,255,0.3);
    border: none;
    z-index: 200;
    transition: all var(--ease-spring);
}

.floating-button::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: var(--radius-pill);
    border: 2px solid #25D366;
    opacity: 0;
    animation: ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    75%, 100% { transform: scale(1.4); opacity: 0; }
    0% { transform: scale(1); opacity: 0.8; }
}

.floating-button img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
}

.floating-button:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.5);
}

/* ============================================================
   FOOTER GLASS
   ============================================================ */
.footer {
    margin-top: auto;
    padding: 30px 20px;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-logo {
    height: 55px;
    opacity: 0.95;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.footer-logo-ccss {
    height: 30px; /* Más pequeño según solicitud */
    opacity: 0.85;
    filter: brightness(0.2) drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.footer-separator {
    width: 1px; height: 30px;
    background: rgba(0,0,0,0.1);
}

.footer p {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.footer p strong {
    color: var(--accent-blue);
    font-family: var(--font-heading);
}

/* ============================================================
   SCROLL INDICATOR (PILL)
   ============================================================ */
.scroll-indicator {
    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 150;
    box-shadow: var(--shadow-glass);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s var(--ease-spring);
    transform: translateX(-50%) translateY(20px);
}

.scroll-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.scroll-indicator .material-icons {
    font-size: 16px;
    color: var(--accent-blue);
    animation: bounceX 2s infinite ease-in-out;
}

.scroll-indicator span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================
   MEDIA QUERIES APP
   ============================================================ */
@media screen and (max-width: 576px) {
    .page-wrapper {
        box-shadow: none;
        border: none;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }

    .bento-item {
        padding: 18px;
    }

    .bento-item.card-primary {
        gap: 16px;             /* Mismo espacio que card-receta */
        padding: 16px 20px;    /* Mismos padding que card-receta */
        flex-direction: row;   /* Forzar que se mantenga uno al lado del otro */
        align-items: center;   
    }

    body .page-wrapper .bento-grid .card-primary .bento-icon {
        width: 48px !important; 
        height: 48px !important;
        font-size: 24px !important;
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }

    .card-primary h3 {
        font-size: 1.15rem;
    }

    .card-primary p {
        font-size: 0.75rem;
    }

    .card-primary .card-cta {
        padding: 10px 18px;    /* Mantener el botón de buen tamaño */
        font-size: 0.72rem;
        white-space: normal;   /* Permitir que el texto baje de línea dentro del botón si es muy estrecho */
        margin-top: 10px;
        text-align: center;
        width: auto;           /* Que use su tamaño natural y no el 100% */
        display: inline-block; /* Flujo natural a la izquierda */
    }

/* Flecha móvil eliminada */
}