/*
========================================
1. RESET Y VARIABLES GLOBALES
========================================
*/
:root {
    /* Paleta de Colores - Enfoque en Calidez y Dignidad (Azul y Beige) */
    --color-primary: #2F3A44;    /* Gris azulado para títulos y bases */
    --color-secondary: #4A768D;  /* Azul grisáceo sobrio para botones/enlaces destacados */
    --color-accent: #D9E3E7;     /* Azul gris muy claro para fondos sutiles */
    --color-background: #f5f1ea; /* Beige/gris cálido muy suave para el fondo general */
    --color-text: #2F2F2F;       /* Gris oscuro cálido para texto */
    --color-cream: #FFFDF8;      /* Un crema muy ligero para cabeceras y tarjetas (suave contraste) */
    --color-white: #FFFFFF;      /* Blanco puro (solo para texto sobre fondos oscuros/botones) */
    --color-neutral: #F3F2F0;    /* Un gris/beige más claro que el fondo para separar secciones */

    /* Tipografía */
    --font-serif: 'Lora', Georgia, serif;
    --font-sans: 'Open Sans', Arial, sans-serif;
}


/* Aplicar un reset suave */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    color: var(--color-primary);
    margin-bottom: 0.7em;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
}


.obituary-card img {
            /* ANTES: width: 100px; height: 100px; */
            /* AHORA: Reducimos para pantallas grandes (el móvil la hará aún más pequeña) */
            width: 100px; 
            height: 100px;
            object-fit: cover;
            border-radius: 50px;
            margin-left: 20px;
            flex-shrink: 0;
        }

        /* ---------------------------------------------------- */
        /* La siguiente regla asegura que en móviles se vea bien */
        /* ---------------------------------------------------- */
        
        @media (max-width: 600px) {
            /* 1. La Tarjeta Completa */
            .obituary-card {
                flex-direction: column; 
                text-align: center;
                padding: 15px;
            }

            /* 2. La Imagen del Difunto en móvil */
            .obituary-card img {
                width: 100px; /* Tamaño aún más pequeño para móvil */
                height: 100px;
                margin: 0 auto 10px; 
                order: -1; 
            }
            /* ... (resto de reglas para .admin-actions) ... */
        }


/*
========================================
2. BOTONES Y ESTILOS GENERALES
========================================
*/

.btn-primary, .btn-secondary, .btn-link {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-cta-phone {
    font-size: 1.5rem;
    padding: 15px 30px;
    background-color: var(--color-secondary);
    color: var(--color-white);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

/*
========================================
3. HEADER Y NAVEGACIÓN
========================================
*/

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: var(--color-cream); /* Crema suave para el header */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.logo img {
    height: 80px;
}

.contact-urgent {
    text-align: center;
    font-size: 0.9rem;
}

.contact-urgent .phone-number {
    display: block;
    font-size: 1.2rem;
    color: var(--color-secondary);
    font-weight: bold;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li {
    margin-left: 25px;
    position: relative;
}

.main-nav ul li a {
    display: block;
    padding: 10px 0;
    font-weight: 600;
}

/* Dropdown Menu (Submenú) */
.dropdown-menu {
    display: none; 
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-cream); 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    padding: 10px 0;
}

/* Regla que hace que el menú aparezca en ESCRITORIO al pasar el cursor */
.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
    padding: 0 15px;
}

.dropdown-menu li a {
    padding: 8px 0;
    font-weight: normal;
    border-bottom: 1px solid #eee;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

/*
========================================
4. SECCIÓN HERO (Primer Impacto)
========================================
*/

.hero {
    position: relative;
    height: 60vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.4); /* Oscurece la imagen para el texto blanco */
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--color-white);
    max-width: 800px;
    padding: 30px 40px; 
    background-color: rgba(47, 58, 68, 0.65); /* Azul Primario semi-transparente para contraste */
    border-radius: 8px;
}

.hero-content h1 {
    color: var(--color-white);
    font-size: 3rem;
    margin-bottom: 0.3em;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero-actions a {
    margin: 0 10px;
}

/*
========================================
5. ACCESO RÁPIDO Y CARDS
========================================
*/

.quick-access {
    text-align: center;
    background-color: var(--color-background);
    border-bottom: 1px solid #ddd;
}

.quick-access h2 {
    margin-bottom: 40px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--color-cream); /* Tarjetas en crema para contraste suave */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

/*
========================================
6. SECCIÓN QUIÉNES SOMOS Y SERVICIOS
========================================
*/

.about-us {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5%;
}

.about-us .content-text {
    flex: 1;
    min-width: 300px;
}

/* VISTA PREVIA DE GALERÍA (Index.html) */
#galeria-preview-dinamica {
    /* Define 4 columnas: 3 para fotos y 1 para el botón */
    grid-template-columns: repeat(3, 1fr) 1fr; 
    gap: 10px; 
    margin-top: 20px;
    width: 100%;
    display: grid;
}

#galeria-preview-dinamica img {
    width: 100%;
    height: 150px; 
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#galeria-preview-dinamica .btn-primary {
    align-self: stretch; 
    text-decoration: none;
    line-height: 1.2;
}

/* ESTILOS DE SERVICIOS DINÁMICOS */

.service-details {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 8px;
}

.service-details img {
    flex-basis: 40%;
    max-width: 40%;
    height: 300px; 
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.service-details ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}

/* Estilo para el Precio */
.service-price {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-primary); 
    margin-bottom: 15px;
}

.service-price span {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--color-secondary); 
    display: block; 
    margin-top: 5px;
}

/*
========================================
ESTILOS ESPECÍFICOS PARA LA SECCIÓN EQUIPO
========================================
*/
.team-section {
    padding: 50px 0;
}

.team-grid {
    display: grid;
    /* Cuadrícula de 3 columnas para escritorio */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 30px;
    text-align: center;
    margin-top: 30px;
}

.team-member {
    background-color: var(--color-cream);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.team-member img {
    /* TAMAÑO Y FORMA CLAVE: Fijo, Redondo y Uniforme */
    width: 140px; 
    height: 140px;
    border-radius: 50%; /* Foto de perfil redonda */
    object-fit: cover; /* Asegura que la foto llene el círculo sin distorsionarse */
    border: 3px solid var(--color-accent); /* Borde suave */
    margin-bottom: 15px;
}

.team-member h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.team-member p {
    color: var(--color-secondary);
    font-size: 0.95rem;
}

/* Adaptación a tablets: 2 columnas */
@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/*
========================================
7. CALL TO ACTION FINAL
========================================
*/

.final-cta {
    background-color: var(--color-primary);
    color: var(--color-white);
    text-align: center;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.final-cta img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.1;
    z-index: 1;
}

.final-cta h2 {
    color: var(--color-white);
    margin-bottom: 10px;
}

/*
========================================
8. FOOTER
========================================
*/

.main-footer {
    background-color: var(--color-primary);
    color: #ccc;
    padding-top: 40px;
    font-size: 0.9rem;
}

.main-footer h4 {
    color: var(--color-white);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.main-footer a {
    color: #ccc;
}

.main-footer a:hover {
    color: var(--color-secondary);
}

.copyright {
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
}


/*
========================================
ESTILOS DEL FORMULARIO DE CONTACTO
========================================
*/

.contact-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; 
    gap: 50px;
    margin-top: 30px;
}

.contact-info address {
    line-height: 1.8;
    font-style: normal;
}

.simple-form label {
    font-weight: 600;
    color: var(--color-primary); 
    margin-top: 15px;
    margin-bottom: 5px;
    display: block;
    font-size: 0.95rem;
}

.simple-form input[type="text"],
.simple-form input[type="email"],
.simple-form input[type="tel"],
.simple-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #d4d4d4;
    border-radius: 4px;
    background-color: var(--color-cream); 
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); 
    color: var(--color-text);
    transition: border-color 0.3s;
}

.simple-form input:focus,
.simple-form textarea:focus {
    border-color: var(--color-secondary); 
    outline: none;
    box-shadow: 0 0 0 1px var(--color-secondary);
}

.simple-form textarea {
    resize: vertical;
    min-height: 120px;
}

.simple-form .btn-primary {
    width: 100%;
    margin-top: 15px;
}


/*
========================================
9. MEDIA QUERIES (RESPONSIVE DESIGN)
========================================
*/

@media (max-width: 900px) {
    /* Ajustes para tabletas */
    .about-us {
        flex-direction: column;
    }
    .about-us .gallery-preview {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    /* Ajustes para móviles */
    .main-header {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-urgent {
        margin-bottom: 10px;
    }
    
    /* === CAMBIO CLAVE AQUÍ: Hacemos la lista horizontal y desplazable === */
    .main-nav {
        width: 100%;
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        padding-bottom: 5px; 
    }

    .main-nav ul {
        display: flex !important; /* ¡FUERZA el modelo flexbox! */
        flex-direction: row !important; /* ¡FUERZA la orientación horizontal! */
        justify-content: flex-start; /* Alinea al inicio (necesario si no cabe todo) */
        white-space: nowrap; /* Evita el salto de línea */
        margin-top: 10px;
        padding: 0 5%; 
    }
    
    .main-nav ul li {
        margin: 0 10px; 
    }
    /* === FIN NAVEGACIÓN HORIZONTAL === */

    .hero {
        height: 50vh;
    }
    
    /* ... (resto de reglas para .hero, .hero-content, etc. permanecen iguales) ... */
    
    /* SERVICIOS DINÁMICOS (Móvil) */
    .service-details {
        flex-direction: column;
    }
    .service-details img {
        max-width: 100%;
        height: auto;
        flex-basis: auto;
        margin-bottom: 20px;
    }
    .reverse-layout {
        flex-direction: column;
    }

    /* VISTA PREVIA INDEX (Móvil) */
    #galeria-preview-dinamica {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #galeria-preview-dinamica .btn-primary {
        grid-column: 1 / -1; 
    }
    
    /* CONTACTO (Móvil) */
    .contact-details-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .map-container {
        margin-top: 30px;
    }

    /* SERVICIOS DINÁMICOS (Móvil) */
    .service-details {
        flex-direction: column;
    }
    .service-details img {
        max-width: 100%;
        height: auto;
        flex-basis: auto;
        margin-bottom: 20px;
    }
    .reverse-layout {
        flex-direction: column;
    }
}