/* ==========================================================
   CENTRO PSICOLÓGICO CLARIDAD
   ESTILOS GLOBALES

   Este archivo contiene estilos reutilizables en todo el sitio:
   - Variables
   - Reset y configuración base
   - Contenedores
   - Utilidades
   - Imágenes
   - Botones
   - Header / Navbar
   - Footer
   - Responsividad global

   No colocar aquí estilos exclusivos de una página.
   ========================================================== */


/* ==========================================================
   1. VARIABLES GLOBALES
   ========================================================== */

:root {
    --primary-dark: #0f2a3a;

    --accent-mint: #00a88f;
    --accent-mint-light: #e6f6f4;

    --text-main: #374151;
    --text-muted: #6b7280;

    --bg-light: #f9fafb;
    --white: #ffffff;

    --font-family: 'Plus Jakarta Sans', sans-serif;

    /*
        Altura de referencia del header.
        También se utiliza para el menú móvil y los enlaces internos.
    */
    --navbar-height: 72px;
}


/* ==========================================================
   2. RESET Y CONFIGURACIÓN GENERAL
   ========================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;

    /*
        Evita que el header sticky cubra el título de una sección
        cuando se navega mediante enlaces como #servicios.
    */
    scroll-padding-top: calc(var(--navbar-height) + 20px);
}


body {
    min-height: 100vh;

    font-family: var(--font-family);
    color: var(--text-main);

    background-color: var(--bg-light);

    line-height: 1.6;

    /*
        Evita desbordamiento horizontal accidental.
        De todos modos, los elementos responsive deben corregirse
        correctamente y no depender solamente de esta propiedad.
    */
    overflow-x: hidden;
}


/*
    Los controles de formularios futuros utilizarán
    la misma tipografía que el resto de la página.
*/
button,
input,
textarea,
select {
    font: inherit;
}


/*
    Comportamiento base de imágenes.
*/
img {
    display: block;
    max-width: 100%;
}


/* ==========================================================
   3. CONTENEDOR GLOBAL
   ========================================================== */

.container {
    width: 100%;
    max-width: 1200px;

    margin-left: auto;
    margin-right: auto;

    padding-left: 24px;
    padding-right: 24px;
}


/* ==========================================================
   4. UTILIDADES GLOBALES
   ========================================================== */

.text-highlight {
    color: var(--accent-mint);
}


.text-center {
    text-align: center;
}


/*
    Etiqueta pequeña utilizada antes de títulos de sección.
    Ejemplo:
    SOBRE NOSOTROS
    SERVICIOS
*/
.section-tag {
    display: block;

    margin-bottom: 10px;

    font-size: 0.85rem;
    font-weight: 700;

    letter-spacing: 1px;

    color: var(--accent-mint);
}


/*
    Título principal reutilizable de secciones.
*/
.section-title {
    margin-bottom: 50px;

    font-size: 2.5rem;
    line-height: 1.2;

    color: var(--primary-dark);
}


/* ==========================================================
   5. IMÁGENES Y CONTENEDORES VISUALES
   ========================================================== */

/*
    Contenedor reutilizable para imágenes que deben llenar
    completamente una zona sin deformarse.
*/
.image-placeholder {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    overflow: hidden;

    background-color: #e5e7eb;
}


.image-placeholder img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;
}


/* ==========================================================
   6. BOTONES GLOBALES
   ========================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    max-width: 100%;

    padding: 12px 24px;

    border: none;
    border-radius: 30px;

    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;

    line-height: 1.2;

    text-decoration: none;
    text-align: center;

    white-space: nowrap;

    cursor: pointer;

    transition:
        transform 0.3s ease,
        opacity 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        background-color 0.3s ease,
        color 0.3s ease;
}


/*
    Actualmente primary y secondary tienen la misma apariencia,
    pero conservamos ambas clases porque representan funciones
    semánticamente distintas y podrán diferenciarse más adelante.
*/
.btn-primary,
.btn-secondary {
    background-color: var(--primary-dark);
    color: var(--white);
}


.btn-accent {
    background-color: var(--accent-mint);
    color: var(--white);
}


.btn-link {
    background: none;
    color: var(--primary-dark);
}


.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


/* ==========================================================
   7. ACCESIBILIDAD - FOCO DE TECLADO
   ========================================================== */

.btn:focus-visible,
.nav-link:focus-visible,
.menu-toggle:focus-visible,
.footer-link:focus-visible {
    outline: 3px solid rgba(0, 168, 143, 0.35);
    outline-offset: 3px;
}


/* ==========================================================
   8. HEADER / NAVBAR
   ========================================================== */

.navbar {
    position: sticky;
    top: 0;

    z-index: 1000;

    min-height: var(--navbar-height);

    padding: 16px 0;

    background-color: var(--white);

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}


/* ----------------------------------------------------------
   ESTRUCTURA DEL HEADER
   ---------------------------------------------------------- */

.nav-container {
    display: flex;
    align-items: center;

    gap: 24px;
}


/* ----------------------------------------------------------
   IDENTIDAD / LOGO
   ---------------------------------------------------------- */

.logo {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


.logo-text {
    display: flex;
    flex-direction: column;

    text-align: center;
}


.brand-name {
    font-size: 1.4rem;
    font-weight: 700;

    line-height: 1.1;

    color: var(--primary-dark);
}


.brand-sub {
    margin-top: 2px;

    font-size: 0.55rem;
    font-weight: 600;

    letter-spacing: 0.5px;

    color: var(--text-muted);
}


/* ----------------------------------------------------------
   NAVEGACIÓN
   ---------------------------------------------------------- */

.nav-menu {
    display: flex;
    align-items: center;

    /*
        El espacio se adapta según la pantalla.
        Evita depender de un gap fijo de 30px.
    */
    gap: clamp(14px, 2vw, 30px);

    margin-left: auto;
}


.nav-link {
    position: relative;

    font-size: 0.95rem;
    font-weight: 500;

    text-decoration: none;

    white-space: nowrap;

    color: var(--text-main);

    transition: color 0.3s ease;
}


.nav-link:hover,
.nav-link.active {
    color: var(--accent-mint);
}


/* ----------------------------------------------------------
   BOTÓN DE AGENDA EN ESCRITORIO
   ---------------------------------------------------------- */

.nav-actions {
    flex-shrink: 0;
}


/* ----------------------------------------------------------
   BOTÓN DE AGENDA DEL MENÚ MÓVIL
   ---------------------------------------------------------- */

.btn-nav-mobile {
    display: none;
}


/* ==========================================================
   9. BOTÓN HAMBURGUESA
   ========================================================== */

.menu-toggle {
    display: none;

    flex-direction: column;
    justify-content: space-between;

    width: 26px;
    height: 18px;

    margin-left: auto;

    background: none;
    border: none;

    cursor: pointer;

    z-index: 1100;
}


.menu-toggle span {
    display: block;

    width: 100%;
    height: 3px;

    border-radius: 2px;

    background-color: var(--primary-dark);

    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}


/* ==========================================================
   10. FOOTER
   ========================================================== */

.footer {
    padding-top: 60px;

    color: var(--white);

    background-color: var(--primary-dark);
}


/* ----------------------------------------------------------
   ESTRUCTURA PRINCIPAL
   ---------------------------------------------------------- */

.footer-grid {
    display: grid;

    grid-template-columns: 1.2fr 1fr 1fr;

    gap: 50px;

    align-items: start;
}


/* ----------------------------------------------------------
   IDENTIDAD
   ---------------------------------------------------------- */

.footer-brand {
    min-width: 0;
}


.footer-logo {
    margin-bottom: 18px;
}


.footer-logo .logo-text {
    text-align: left;
}


.brand-name-white {
    display: block;

    font-size: 1.4rem;
    font-weight: 700;

    line-height: 1.2;

    color: var(--white);
}


.brand-sub-white {
    display: block;

    margin-top: 6px;

    font-size: 0.55rem;
    font-weight: 600;

    letter-spacing: 0.5px;

    color: #94a3b8;
}


.footer-slogan {
    max-width: 380px;

    font-size: 0.9rem;

    line-height: 1.7;

    color: #94a3b8;
}


/* ----------------------------------------------------------
   COLUMNAS DEL FOOTER
   ---------------------------------------------------------- */

.footer-column {
    display: flex;
    flex-direction: column;

    align-items: flex-start;

    min-width: 0;

    gap: 12px;
}


.footer-column h3 {
    margin-bottom: 6px;

    font-size: 1rem;
    font-weight: 600;

    color: var(--white);
}


/* ----------------------------------------------------------
   CONTACTO
   ---------------------------------------------------------- */

.footer-link,
.footer-info {
    display: flex;

    align-items: flex-start;

    gap: 8px;

    max-width: 100%;

    font-size: 0.9rem;

    line-height: 1.5;

    color: #cbd5e1;
}


.footer-link {
    text-decoration: none;

    transition: color 0.3s ease;
}


.footer-link span:last-child {
    /*
        Permite que correos largos se adapten en pantallas
        pequeñas sin desbordarse.
    */
    overflow-wrap: anywhere;
}


.footer-link:hover {
    color: var(--accent-mint);
}


/* ----------------------------------------------------------
   ICONOS DE CONTACTO
   ---------------------------------------------------------- */

.footer-contact-icon {
    flex-shrink: 0;

    font-size: 1.05rem;

    line-height: 1.5;

    color: var(--accent-mint);
}


/* ----------------------------------------------------------
   BOTÓN DE AGENDA DEL FOOTER
   ---------------------------------------------------------- */

.footer-agenda {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin-top: 8px;
}


/* ----------------------------------------------------------
   PARTE INFERIOR DEL FOOTER
   ---------------------------------------------------------- */

.footer-bottom {
    margin-top: 45px;

    padding-top: 20px;
    padding-bottom: 25px;

    border-top: 1px solid rgba(255, 255, 255, 0.1);

    text-align: center;
}


.footer-bottom p {
    font-size: 0.8rem;

    color: #94a3b8;
}


/* ==========================================================
   11. RESPONSIVIDAD GLOBAL
   ========================================================== */


/* ----------------------------------------------------------
   TABLETS / LAPTOPS PEQUEÑAS
   ---------------------------------------------------------- */

@media (max-width: 1024px) {

    /*
        El bloque de identidad ocupa todo el ancho.
        Contacto y horario quedan debajo en dos columnas.
    */
    .footer-grid {
        grid-template-columns: 1fr 1fr;

        gap: 40px;
    }


    .footer-brand {
        grid-column: 1 / -1;
    }

}


/* ----------------------------------------------------------
   NAVBAR RESPONSIVE
   Equivalente aproximado al breakpoint "lg" de Bootstrap.
   ---------------------------------------------------------- */

@media (max-width: 992px) {

    .nav-actions {
        display: none;
    }


    .menu-toggle {
        display: flex;
    }


    .nav-menu {
        position: fixed;

        top: var(--navbar-height);
        left: 0;

        display: flex;
        flex-direction: column;

        align-items: center;
        justify-content: center;

        width: 100%;

        /*
            100vh queda como respaldo para navegadores antiguos.
            100dvh responde mejor a las barras del navegador móvil.
        */
        height: calc(100vh - var(--navbar-height));
        height: calc(100dvh - var(--navbar-height));

        margin-left: 0;

        padding: 40px 24px;

        gap: 25px;

        background-color: var(--white);

        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);

        transform: translateX(100%);

        transition: transform 0.4s ease-in-out;

        overflow-y: auto;
    }


    /* Menú desplegado */
    .nav-menu.open {
        transform: translateX(0);
    }


    .nav-link {
        width: 100%;

        font-size: 1.2rem;

        text-align: center;
    }


    .btn-nav-mobile {
        display: inline-flex;

        width: 100%;
        max-width: 280px;
    }


    /* Animación del botón hamburguesa a X */
    .menu-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }


    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }


    .menu-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

}


/* ----------------------------------------------------------
   CELULARES / TABLETS VERTICALES
   ---------------------------------------------------------- */

@media (max-width: 768px) {

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }


    .section-title {
        margin-bottom: 35px;

        font-size: 2rem;
    }


    /* Footer en una sola columna */
    .footer-grid {
        grid-template-columns: 1fr;

        gap: 35px;

        text-align: center;
    }


    .footer-brand {
        grid-column: auto;

        display: flex;
        flex-direction: column;

        align-items: center;
    }


    .footer-logo .logo-text {
        text-align: center;
    }


    .footer-column {
        align-items: center;
    }


    .footer-link,
    .footer-info {
        justify-content: center;

        text-align: center;
    }


    .footer-slogan {
        margin-left: auto;
        margin-right: auto;
    }


    .footer-agenda {
        width: 100%;
        max-width: 280px;
    }


    .footer-bottom {
        margin-top: 35px;
    }

}


/* ----------------------------------------------------------
   CELULARES PEQUEÑOS
   ---------------------------------------------------------- */

@media (max-width: 480px) {

    .container {
        padding-left: 16px;
        padding-right: 16px;
    }


    .brand-name {
        font-size: 1.2rem;
    }


    /*
        Permite que los textos de botones largos puedan
        dividirse en dos líneas si el dispositivo es muy estrecho.
    */
    .btn {
        white-space: normal;
    }

}


/* ==========================================================
   12. PREFERENCIAS DE ACCESIBILIDAD
   ========================================================== */

/*
    Reduce animaciones si el usuario tiene habilitada
    esta preferencia en su sistema operativo.
*/
@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }


    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

}