

/* --------- 1. RESET, FUENTES Y VARIABLES --------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --------- Variable de Colores --------- */
:root {
    /* Paleta de colores */
    --color-primario:    #2564eb7c;
    --color-secundario:  #1e40af;
    --color-acento:      #3b82f6;
    --color-exito:       #16a34a99;
    --color-peligro:     #dc2626;
    --color-advertencia: #d906067b;
    --color-fondo:       #f1f5f9;
    --color-blanco:      #ffffff;
    --color-texto:       #1e293b;
    --color-texto-suave: #64748b;
    --color-borde:       #e2e8f0;

    --fuente: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --radio: 8px;
    --sombra: 0 2px 8px rgba(0,0,0,0.10);
    --sombra-md: 0 4px 16px rgba(0,0,0,0.12);
}

@font-face {
    font-family: 'AmsterdamOne-eZ12l';
    src: url('https://www.bhmimare.com/fonts/AmsterdamOne-eZ12l.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: var(--fuente);
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primario);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

ul {
    list-style: none;
}

span {
    font-style: italic;
    color: #991b1b;
    font-family: 'AmsterdamOne-eZ12l', sans-serif !important;
}

/* ---------- 2. NAVBAR & NAVEGACIÓN --------- */
.navbar {
    background-color: #2563eb63;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--sombra-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.img-logo {
    height: 50px;      
    width: auto;
    object-fit: contain;
    border-radius: 50px;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #991b1b;
    font-size: 15px;
    font-weight: 500;
    font-family: 'AmsterdamOne-eZ12l';
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-menu li a {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radio);
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    display: block;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.btn-nav-logout {
    background: rgba(220,38,38,0.75) !important; 
    color: white !important; 
    font-size: 0.85rem !important;
}

.btn-nav-logout:hover {
    background: rgba(220,38,38,1) !important;
}

.btn-nav-registro {
    background: white !important;
    color: var(--color-primario) !important;
    font-weight: 600 !important;
}

.btn-primario.btn-sm {
    border-radius: 5px;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-secundario);
    border-radius: var(--radio);
    min-width: 180px;
    box-shadow: var(--sombra-md);
    flex-direction: column;
    padding: 0.5rem 0;
}

.nav-dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu li a {
    padding: 0.5rem 1rem !important;
    border-radius: 0 !important;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* -------- 3. ESTRUCTURA Y COMPONENTES COMUNES -------- */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radio);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-blanco:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.btn-primario    { background: var(--color-primario);   color: white; }
.btn-blanco      { background: #ffffff; color: var(--color-primario); border: none; font-weight: bold; transition: all 0.3s ease; }
.btn-exito       { background: var(--color-exito);      color: white; }
.btn-peligro     { background: var(--color-peligro);     color: white; }
.btn-advertencia { background: var(--color-advertencia); color: white; }
.btn-sm          { padding: 0.35rem 0.8rem; font-size: 0.85rem; }

/* Cabecera de páginas */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.6rem;
    color: var(--color-texto);
}

/* -------- 4. HOME / INDEX (HERO Y TARJETAS) -------- */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    height: 80vh;
    overflow: hidden;
    border-radius: var(--radio);
    margin-bottom: 2.5rem;
    padding: 2rem;
}

.hero h1 {
    margin-top: 50px;
    margin-bottom: 9px;
    font-size: 2.4rem;
    line-height: 1.2;
    font-weight: 700;
}

.hero p {
    font-size: 1rem;
    opacity: 0.88;
    max-width: 640px;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.hero .hero-btns {
    display: flex;
    gap: 1rem;  
    flex-wrap: wrap;
    justify-content: center;
}

.hero h1,
.hero p,
.hero .hero-btns {
    position: relative;
    z-index: 3;
}

.hero .bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 100, 235, 0.3);
    z-index: 2;
}

/* Tarjetas Informativas */
.seccion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card-info {
    background: var(--color-blanco);
    border-radius: var(--radio);
    padding: 1.5rem;
    box-shadow: var(--sombra);
    text-align: center;
    border-top: 4px solid var(--color-primario);
}

.card-info .icono {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.card-info h3 {
    margin-bottom: 0.5rem;
    color: var(--color-primario);
}

.card-info p {
    color: var(--color-texto-suave);
    font-size: 0.95rem;
}

p.sobre-mi {
    padding: 10px 80px 50px;
}

/* -------- 5. NOTICIAS -------- */
.grid-noticias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
    margin-top: 1.5rem;
}

.tarjeta-noticia {
    background: var(--color-blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.tarjeta-noticia:hover {
    box-shadow: var(--sombra-md);
    transform: translateY(-3px);
}

.tarjeta-noticia img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--color-fondo);
}

.tarjeta-noticia .img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--color-primario), var(--color-acento));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.tarjeta-noticia .noticia-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tarjeta-noticia h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--color-texto);
}

.tarjeta-noticia .noticia-meta {
    font-size: 0.82rem;
    color: var(--color-texto-suave);
    margin-bottom: 0.75rem;
}

.tarjeta-noticia p {
    font-size: 0.92rem;
    color: var(--color-texto-suave);
    flex: 1;
}

section.container.my-5 {
    margin-top: 40px;
}

/* --------- 6. FORMULARIOS -------- */
.container-form {
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 2rem;
    max-width: 550px;
    margin: 20px auto;
    width: 100%;
}

.container-form.ancho {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.container-form h2 {
    text-align: center;
    margin: 25px;
    color: var(--color-primario);
}

.form-grupo {
    margin-bottom: 1.1rem;
}

.form-grupo label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: var(--color-texto);
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--color-borde);
    border-radius: var(--radio);
    font-size: 0.95rem;
    font-family: var(--fuente);
    color: var(--color-texto);
    background: var(--color-fondo);
    transition: border-color 0.2s;
}

.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
    outline: none;
    border-color: var(--color-primario);
    background: white;
}

.form-grupo textarea {
    resize: vertical;
    min-height: 90px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}

.form-grid .form-grupo.full {
    grid-column: 1 / -1;
}

.form-grupo .error-campo {
    color: var(--color-peligro);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

/* -------- 7. TABLAS DE ADMINISTRACIÓN -------- */
.tabla-container {
    background: var(--color-blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow-x: auto;
    margin-top: 1.5rem;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

thead {
    background: var(--color-primario);
    color: white;
}

thead th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid var(--color-borde);
    transition: background 0.15s;
}

tbody tr:hover {
    background: var(--color-fondo);
}

tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.acciones {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* -------- 8. PERFIL DE USUARIO -------- */
.perfil-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
    background: var(--color-blanco);
}

.perfil-avatar {
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 2rem;
    text-align: center;
}

.avatar-icono {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 1rem;
}

.perfil-avatar h3 {
    font-size: 1.2rem;
    color: var(--color-primario);
}

.perfil-avatar .badge-rol {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.badge-admin { background: #fef9c339; color: #85260e; }
.badge-user  { background: #dbeafe2c; color: #1e40af; }

/* -------- 9. GALERÍA PRINCIPAL Y COMPONENTES -------- */
.galeria-hero {
    height: 40vh;
    background: url('../img/fondo.jpg') center center/cover no-repeat fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    border-radius: 15px;
    margin-bottom: 15px;
}

.galeria-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.056), rgba(0, 0, 0, 0.438));
}

.galeria-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    padding: 50px;
    color: #fff;
}

.galeria-content em {
    display: block;
    letter-spacing: 8px;
    font-size: 20px;
    margin-bottom: 30px;
    opacity: .85;
}

.galeria-content h2 {
    font-size: 20px;
    font-weight: 200;
    line-height: 1.15;
    margin-bottom: 5px;
    text-transform: none;
}

.galeria-content p {
    max-width: 700px;
    margin: auto auto 25px;
    font-size: 16px;
    line-height: 1.9;
    opacity: .92;
}

.galeria-btn {
    display: inline-block;
    padding: 18px 60px;
    border: 1px solid #fff;
    color: white;
    text-decoration: none;
    font-size: .95rem;
    letter-spacing: 4px;
    transition: .5s;
}

.galeria-btn:hover {
    background: #fff;
    color: #11111156;
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.125);
}

#screen-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2563eb63;
    transform: scaleY(0);
    transform-origin: top;
    z-index: 9999;
    transition: transform .9s ease-in-out;
}

#screen-transition.activo {
    transform: scaleY(1);
}

/* Galería Grid Estilo Pinterest */
.galeria-principal {
    max-width: 1400px;
    margin: auto;
    padding: 100px 40px;
    background: #fafafa;
}

.titulo-2 {
    text-align: center;
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin-bottom: 70px;
    color: #111;
}

.galeria-miniatura {
    column-count: 4;
    column-gap: 22px;
    margin-top: 15px;
}

.foto-item {
    position: relative;
    margin-bottom: 22px;
    break-inside: avoid;
    overflow: hidden;
    border-radius: 18px;
}

.miniatura {
    width: 100%;
    display: block;
    transition: .6s;
}

.overlay-foto {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 35px;
    opacity: 0;
    transition: .45s;
}

.overlay-foto h3 {
    color: white;
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: .45s;
}

.overlay-foto p {
    color: #ddd;
    letter-spacing: 2px;
    transform: translateY(20px);
    transition: .45s;
}

.foto-item:hover .miniatura {
    transform: scale(1.08);
}

.foto-item:hover .overlay-foto {
    opacity: 1;
}

.foto-item:hover h3,
.foto-item:hover p {
    transform: translateY(0);
}

/* --------- 10. MODAL DE VISUALIZACIÓN DE FOTOS --------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,.4);
}

.modal-close {
    position: absolute;
    top: 35px;
    right: 45px;
    font-size: 55px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 65px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 20px;
}

.modal-prev { left: 30px; }
.modal-next { right: 30px; }

/* --------- 11. PIE DE PÁGINA (FOOTER) -------- */
.footer {
    background: var(--color-texto);
    color: rgba(255,255,255,0.8);
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col {
    margin-left: 40px; /* Reducido para evitar desbordes */
}

.footer-col h4 {
    color: white;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.footer-col p,
.footer-col li {
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-col a {
    color: rgba(255,255,255,0.75);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* -------- 12. UTILIDADES -------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* -------- 13. MEDIA QUERIES (OPTIMIZADAS Y UNIFICADAS) --------- */


/* ── Página Mis Citas ───────────────────────────────────────────────────── */
.citas-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 1200px) {
    .galeria-miniatura {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .titulo-2, .titulo {
        font-size: 2.2rem;
    }
    .acerca-de {
        padding: 45px 30px;
    }
}

/* Estado inicial del menú en móviles */
@media (max-width: 768px) {

    /* Mis Citas: apila columnas en móvil */
    .citas-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }


    .nav-toggle {
        display: block;
    }

   .nav-menu {
        display: none; /* Estado inicial: oculto */
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #1e40af; 
        padding: 1.5rem;
        z-index: 999;
    }

    .nav-menu.abierto {
        display: flex !important;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        padding: 0.8rem 1rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }  
    
/* Submenú Dropdown en Móvil */
    .nav-dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        padding-left: 0;
        background: rgba(0, 0, 0, 0.15);
        width: 100%;
    }
    
    .nav-dropdown .dropdown-menu li a {
        text-align: center;
        font-size: 0.9rem;
    }

    /* Formularios Flexibles */
    .container-form {
        width: 95%;
        padding: 1.25rem;
        margin: 15px auto;
    }

    
    .container-form.ancho {
        display: block !important; 
        width: 100%;
        padding: 15px;
        margin: 10px 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Perfil de Usuario */
    .perfil-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Sección Hero (Ocultar video pesado e implementar degradado óptimo) */
    .hero {
        height: auto;
        padding: 3.5rem 1.25rem 3rem;
        background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    }

    .hero .bg-video {
        display: none !important;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    /* Hero Galería en Móvil */
    .galeria-hero {
        display: none !important;
    }

    /* Grid Galería Pinterest */
    .galeria-miniatura {
        column-count: 2;
    }

    /* Pie de Página (Footer) sin márgenes desplazados */
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem 1rem;
    }

    .footer-col {
        margin-left: 0 !important;
        margin-bottom: 1.5rem;
    }
    
    p.sobre-mi {
        padding: 15px 20px !important;
    }
}

@media (max-width: 600px) {

    .citas-layout {
        gap: 1rem;
    }

    /* Tabla de citas: ocultar columna motivo en pantallas muy pequeñas */
    .citas-layout .tabla-container table thead tr th:nth-child(2),
    .citas-layout .tabla-container table tbody tr td:nth-child(2) {
        display: none;
    }

    /* Galería a una columna */
    .galeria-principal {
        padding: 40px 15px;
    }

    .galeria-miniatura {
        column-count: 1;
        gap: 20px;
    }

    /* Noticias a una columna */
    .grid-noticias {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Modal Adaptativo */
    .modal-nav {
        font-size: 40px;
    }

    .modal-close {
        font-size: 35px;
    }
}