/* =========================================
   1. CSS RESET & BASIC STYLES
========================================= */
body {
    margin: 0;
    padding-top: 70px;
    /* ✨ CRITICAL: Push content up so it doesn't hide behind the bottom menu! */
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f9f9f9;
    color: #333;
}

/* =========================================
   2. HEADER & NAVIGATION (UNIFIED)
========================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    box-sizing: border-box;
    transition: top 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: #0087cb;
    color: white;
    padding: 10px 20px; /* Reduced padding for a sleeker look */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Constrain the profile button SVG */
.menu-toggle {
    display: block; /* Always visible */
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* =========================================
   3. THE FLOATING PROFILE CARD (ALWAYS ON)
========================================= */
#main-nav {
    display: none;
    /* width: 100%; */
    position: fixed;
    top: 60px;
    right: 0px;
    background: #0087cb;
    z-index: 3000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#main-nav.active {
    display: flex;
}

#main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

#main-nav li {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#main-nav li:first-child {
    border-top: none;
}

#main-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
}

#main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Dropdown Menu logic (Inside the Profile Card) */
.dropdown-menu {
    display: none;
    list-style: none;
    padding: 0;
    background: rgba(0, 0, 0, 0.1); /* Slightly darker to distinguish nested items */
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    padding-left: 45px; /* Indent sub-items */
    font-size: 0.9em;
    opacity: 0.9;
}

/* =========================================
   5. MAIN CONTENT & FORMS
========================================= */
.container {
    padding: 20px;
    max-width: 800px;
    margin: auto;
    background: white;
    min-height: 80vh;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

input[type="email"], input[type="text"], input[type="tel"], input[type="date"] {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box;
}

button {
    background: #0087cb; color: white; border: none; padding: 12px 20px; border-radius: 4px; cursor: pointer; font-size: 1em; transition: background 0.2s;
}
button:hover { background: #006b9f; }

label { font-weight: bold; }
.checkbox-label { font-weight: normal; margin-left: 5px; }

/* =========================================
   6. TILE GRID SYSTEM
========================================= */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.tile { padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); transition: transform 0.2s; cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border: 1px solid #eee; }
.tile h3 { margin: 0 0 10px 0; }
.tile p { margin: 0; }

/* =========================================
   7. SACRED LOADER
========================================= */
.loader-wrapper { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 60vh; width: 100%; }
.sacred-container { position: relative; display: flex; justify-content: center; align-items: center; }
.monstrance { width: 140px; height: 140px; z-index: 2; }
.rays { transform-origin: center; animation: rotateRays 15s linear infinite; }
.glow { position: absolute; width: 70px; height: 70px; background: radial-gradient(circle, #00009955 0%, transparent 75%); border-radius: 50%; animation: divineGlow 4s ease-in-out infinite; }
.loading-text { margin-top: 30px; font-family: 'Cinzel', serif; letter-spacing: 5px; font-size: 0.9rem; text-transform: uppercase; opacity: 0.8; }
@keyframes rotateRays { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes divineGlow { 0%, 100% { transform: scale(1); opacity: 0.3; } 50% { transform: scale(1.7); opacity: 0.5; } }

/* =========================================
   8. BOTTOM APP NAVIGATION (SLEEK & RESPONSIVE)
========================================= */
.bottom-nav {
    position: fixed;
    bottom: -10px;
    padding-top:8px;
    left: 0;
    width: 100%;
    height: 60px; 
    z-index: 2000;
    background: rgba(0, 34, 68, 1);
    display: flex;
    flex-direction: row;
    justify-content: space-around; /* Distributes icons evenly */
    align-items: center;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
    padding-bottom: env(safe-area-inset-bottom);
    
    /* 🚨 THE MAGIC LOCK: This pushes the menu to its own GPU layer */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: center; */
    flex: 1; 
    height: 100%;
    color: #8fa3b8;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
    color: #ffffff;
    background: radial-gradient(circle at center, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.bottom-nav-icon {
    height: 22px; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.bottom-nav-icon svg, 
.bottom-nav-icon img, 
.bottom-nav-icon i {
    max-width: 22px; 
    max-height: 22px;
    object-fit: contain;
    fill: currentColor;
}

.bottom-nav-text {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ✨ DESKTOP UPGRADE: Transforms into a vertical left-rail on larger screens! */
@media (min-width: 769px) {
    body {
        padding-bottom: 20px; /* Removes the heavy bottom padding */
        padding-left: 80px; /* Pushes content right to make room for side nav */
    }

    .bottom-nav {
        top: 0;
        position: fixed;
        z-index: 1999;
        bottom: 0;
        left: 0;
        width: 80px;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 100px;
        border-top: none;
        border-right: 1px solid rgba(0,0,0,0.1);
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }

    .bottom-nav-item {
        flex: none; 
        width: 100%;
        height: 50px; /* Fixed height for each vertical button */
    }
}


/* ✨ ESTILOS DEL TOGGLE DE IDIOMA */
.lang-toggle-container {
display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 1px;
    border: 1px solid #cbd5e1;
    margin-left: auto; 
    margin-right: -10px; 
    transform: scale(0.7);
}



.lang-btn {
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 0.8em;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
    line-height: 1;
}

.lang-btn.active {
    background: #003366;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 🙈 OCULTAR LOS ELEMENTOS NATIVOS DE GOOGLE TRANSLATE */
body { top: 0 !important; } /* Evita que Google baje tu página */
.skiptranslate, .goog-te-banner-frame { display: none !important; }