/* ==========================================================================
   FORO ESPACIOS — Centro de Salud Mental Integral y Co-work
   Design System: "Serene Minds" (Hearthstone Whisper Edition)
   Paleta orgánica + Playfair Display / Inter — ver frontend/DESIGN.md
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Superficies y fondos base */
    --surface: #fbf9f5;
    --surface-dim: #dbdad6;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f5f3f0;
    --surface-container: #efeeea;
    --surface-container-high: #e9e8e4;
    --surface-container-highest: #e4e2df;

    /* Paleta Hearthstone Whisper */
    --sandal: #A8986B;          /* Fondos de secciones / banners destacados */
    --domino: #998566;          /* Bordes, íconos lineales, subtextos */
    --avocado: #858665;         /* Verde oliva: salud y bienestar */
    --cape-palliser: #937743;   /* Ocre oscuro: títulos y menús */
    --driftwood: #B48A46;       /* Acento exclusivo para botones de acción */

    /* Roles funcionales */
    --on-surface: #1b1c1a;
    --on-surface-variant: #444842;
    --inverse-surface: #30312e;
    --inverse-on-surface: #f2f1ed;
    --outline: #998566;
    --outline-variant: #c4c8bf;

    --primary: var(--cape-palliser);
    --on-primary: #ffffff;
    --secondary: var(--domino);
    --tertiary: var(--driftwood);
    --whatsapp: #25D366;
    --whatsapp-dark: #128C7E;

    /* Tipografía */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;

    /* Formas orgánicas */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;       /* botones, inputs */
    --radius-lg: 1.5rem;     /* tarjetas, modales */
    --radius-xl: 3rem;       /* contenedores grandes / hero */
    --radius-full: 9999px;

    /* Espaciado (base 8px) */
    --container-max: 1200px;
    --container-narrow: 56rem; /* max-w-4xl: acordeón y formularios */
    --pad-mobile: 24px;
    --pad-desktop: 80px;
    --section-gap: 120px;

    /* Sombras ambientales: suaves, sin offset agresivo */
    --shadow-ambient: 0 8px 40px rgba(48, 49, 46, 0.08);
    --shadow-ambient-lg: 0 16px 60px rgba(48, 49, 46, 0.12);

    /* Tokens de movimiento (guía ui-ux-pro-max: micro-interacciones 150-300ms,
       ease-out al entrar, salidas más cortas que entradas, ritmo unificado) */
    --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-soft: cubic-bezier(0.55, 0, 0.55, 0.2);
    --dur-fast: 180ms;
    --dur-base: 280ms;
    --dur-slow: 600ms;

    --transition-soft: all var(--dur-base) var(--ease-out-soft);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
    /* clip: corta cualquier desborde lateral sin crear scroll horizontal,
       evitando que en móvil la página se pueda "alejar" o desplazar de lado */
    overflow-x: clip;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--on-surface);
    background-color: var(--surface);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Elimina el retraso de 300ms del tap en móvil (guía: tap-delay) */
a,
button {
    touch-action: manipulation;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    color: var(--primary);
    line-height: 1.3;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    user-select: none;
}

/* Selección de texto en tono de marca */
::selection {
    background: rgba(168, 152, 107, 0.35);
    color: var(--on-surface);
}

/* Accesibilidad */
.skip-link {
    position: absolute;
    top: -48px;
    left: 16px;
    z-index: 2000;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    font-weight: 600;
    transition: top 0.25s ease;
}

.skip-link:focus {
    top: 0;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    /* iteration-count: 1 evita que las animaciones infinitas (pulso, flecha)
       queden vibrando al acortarse la duración */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* El crossfade del hero es cambio de contenido, no adorno: se mantiene suave */
    .hero-slide {
        transition-duration: 1.5s !important;
    }
}

/* --------------------------------------------------------------------------
   3. LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--pad-mobile);
}

/* Contenedor angosto (max-w-4xl) para acordeón y formularios — regla del readme */
.container-narrow {
    max-width: var(--container-narrow);
}

.section-padding {
    padding: var(--section-gap) 0;
}

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

.text-center .section-subtitle {
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(32px, 4.5vw, 44px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 20px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--on-surface-variant);
    max-width: 640px;
    margin-bottom: 56px;
}

/* --------------------------------------------------------------------------
   4. BOTONES (pill, Driftwood exclusivo para acciones)
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    transition: var(--transition-soft);
    white-space: nowrap;
}

.btn .material-symbols-outlined {
    font-size: 20px;
}

/* Micro-interacción: elevación suave al hover, escala sutil al presionar
   (guía ui-ux-pro-max: scale-feedback 0.95-1.05, respuesta < 100ms) */
.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0) scale(0.97);
    transition-duration: var(--dur-fast);
}

/* Acción principal: Driftwood (Reservar Box / Contactar / Agendar Hora) */
.btn-primary {
    background: var(--driftwood);
    color: var(--on-primary);
}

.btn-primary:hover {
    background: #a37c3c;
    box-shadow: var(--shadow-ambient);
}

/* Secundario: contorno Domino */
.btn-outline {
    background: transparent;
    color: var(--cape-palliser);
    border: 1.5px solid var(--domino);
}

.btn-outline:hover {
    background: var(--surface-container);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: #ffffff;
}

.btn-whatsapp:hover {
    background: var(--whatsapp-dark);
}

.whatsapp-svg-icon {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   5. SCROLL PROGRESS BAR
   -------------------------------------------------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--avocado), var(--driftwood));
    z-index: 1500;
}

/* --------------------------------------------------------------------------
   6. HEADER & NAV
   -------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 14px 0;
    border-bottom: 1px solid transparent;
    transition: var(--transition-soft);
}

/* El fondo translúcido con blur vive en un pseudo-elemento: si el blur
   estuviera en .header, este se volvería containing block y el drawer
   móvil position:fixed quedaría atrapado dentro del header (bug).
   Arriba del todo el header es transparente y se funde con el hero;
   al hacer scroll aparece el fondo claro con blur. */
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(251, 249, 245, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    transition: opacity var(--dur-base) ease;
}

.header.scrolled {
    padding: 8px 0;
    box-shadow: var(--shadow-ambient);
    border-bottom-color: transparent;
}

.header.scrolled::before {
    opacity: 1;
}

/* Sobre el hero (sin scroll): logo y controles en blanco */
.header:not(.scrolled) .logo-foro {
    color: #ffffff;
}

.header:not(.scrolled) .logo-espacios {
    color: rgba(255, 255, 255, 0.85);
}

.header:not(.scrolled) .hamburger span {
    background: #ffffff;
}

@media (min-width: 901px) {
    .header:not(.scrolled) .nav-link {
        color: #ffffff;
    }

    .header:not(.scrolled) .nav-link:hover {
        background: rgba(255, 255, 255, 0.14);
    }

    .header:not(.scrolled) .nav-link.active {
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
    }
}

/* En PC el header va pegado a las esquinas: contenido a todo el ancho */
.header .container {
    max-width: none;
}

@media (min-width: 1024px) {
    .header .container {
        padding: 0 32px;
    }
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Logo: imagen con animación de entrada + wordmark en dos tipografías */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: #ffffff;
    box-shadow: var(--shadow-ambient);
    animation: logoSpinIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: transform 0.5s ease;
}

.logo:hover .logo-img {
    transform: rotate(14deg) scale(1.07);
}

@keyframes logoSpinIn {
    from { opacity: 0; transform: rotate(-40deg) scale(0.5); }
    to { opacity: 1; transform: rotate(0) scale(1); }
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
    animation: heroFadeUp 0.8s ease 0.25s both;
}

.logo-foro {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--cape-palliser);
}

.logo-espacios {
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--domino);
    margin-top: 3px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: var(--cape-palliser);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-soft);
}

.nav-link:hover {
    background: var(--surface-container);
}

.nav-link.active {
    background: var(--surface-container-high);
    color: var(--cape-palliser);
    font-weight: 600;
}

.nav-close {
    display: none;
}

/* "Agendar Hora" como ítem de menú: solo visible en el drawer móvil */
.nav-item-cta {
    display: none;
}

.nav-link-cta {
    color: var(--driftwood);
    font-weight: 600;
}

/* Scrim del drawer móvil (guía: 40-60% para aislar el contenido en foco) */
.nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(27, 28, 26, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base) ease;
}

.nav-scrim.open {
    opacity: 1;
    pointer-events: auto;
}

/* Hamburger (se transforma en X al abrir) */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--cape-palliser);
    border-radius: 2px;
    transition: transform var(--dur-base) var(--ease-out-soft), opacity var(--dur-fast) ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   7. HERO (slideshow full-bleed con crossfade + Ken Burns)
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 140px 0 96px;
    overflow: hidden;
    background: var(--inverse-surface);
}

.hero-slideshow {
    position: absolute;
    inset: 0;
}

/* Crossfade ultra-suave: curva cubic-bezier diseñada para que la
   opacidad suba gradualmente sin "parpadeo" ni cortes visibles.
   2s de duración con curva asimétrica (arranque lento → caída suave) */
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.hero-slide.is-active {
    opacity: 1;
}

.hero-slide picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Accesibilidad: usuarios con movimiento reducido ven cambio instantáneo */
@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: opacity 0.5s ease;
    }
}

/* Overlay cálido simétrico: oscurece para legibilidad del texto centrado */
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(27, 28, 26, 0.55) 0%, rgba(27, 28, 26, 0.42) 50%, rgba(27, 28, 26, 0.55) 100%);
}

.hero .container {
    position: relative;
    z-index: 1;
}

/* Contenido centrado, todo en blanco sobre la fotografía */
.hero-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

/* Título protagonista: grande, blanco y con sombra en capas para
   destacar sobre cualquier fotografía del slideshow */
.hero-title {
    font-size: clamp(52px, 8vw, 92px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 24px;
    color: #ffffff;
    text-shadow:
        0 2px 6px rgba(27, 28, 26, 0.45),
        0 8px 32px rgba(27, 28, 26, 0.5);
}

.hero-title-sub {
    display: block;
    font-size: clamp(24px, 3.2vw, 40px);
    font-weight: 500;
    font-style: italic;
    color: #ffffff;
    margin-top: 14px;
    text-shadow: 0 2px 12px rgba(27, 28, 26, 0.5);
}

.hero-desc {
    font-size: clamp(18px, 1.8vw, 21px);
    color: #ffffff;
    max-width: 620px;
    margin: 0 auto;
    text-shadow: 0 1px 8px rgba(27, 28, 26, 0.55);
}

/* Indicadores del slideshow */
.hero-dots {
    position: absolute;
    bottom: 36px;
    right: 48px;
    z-index: 1;
    display: flex;
    gap: 10px;
}

.hero-dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    background: rgba(251, 249, 245, 0.35);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-dot.active {
    background: var(--sandal);
    width: 26px;
}

/* Indicador de scroll con flotación suave */
.hero-scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(251, 249, 245, 0.4);
    border-radius: var(--radius-full);
    color: rgba(251, 249, 245, 0.85);
    transition: var(--transition-soft);
}

.hero-scroll-hint:hover {
    background: rgba(251, 249, 245, 0.14);
}

.hero-scroll-hint .material-symbols-outlined {
    animation: gentleBounce 2.4s ease-in-out infinite;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(-2px); }
    50% { transform: translateY(4px); }
}

/* Entrada escalonada del contenido del hero (suave, una sola vez al cargar) */
.hero-anim {
    opacity: 0;
    animation: heroFadeUp 0.9s ease forwards;
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-anim-2 { animation-delay: 0.3s; }
.hero-anim-3 { animation-delay: 0.45s; }
.hero-anim-5 { animation-delay: 0.95s; }

.glass-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-ambient);
}

/* --------------------------------------------------------------------------
   8. NUESTRO COMPROMISO
   -------------------------------------------------------------------------- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    align-items: center;
    gap: 72px;
}

.about-image-wrapper {
    position: relative;
}

.about-image-container {
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    box-shadow: var(--shadow-ambient-lg);
}

.about-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text {
    font-size: 17px;
    color: var(--on-surface-variant);
    margin-bottom: 18px;
}

.about-text strong {
    color: var(--cape-palliser);
}

.about-text .accent {
    color: var(--avocado);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   9. ARRIENDO DE BOXS (galería + servicio incluido)
   -------------------------------------------------------------------------- */
.rental {
    background: var(--surface-container-low);
}

/* El margen superior lo aporta el subtítulo de la sección (margin-bottom 56px) */
.boxes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.box-tile {
    margin: 0;
    text-align: center;
}

.box-photo {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-container);
    box-shadow: var(--shadow-ambient);
}

.box-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-soft);
}

.box-tile:hover .box-photo img {
    transform: scale(1.05);
}

.box-label {
    margin-top: 16px;
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--cape-palliser);
}

/* Lista de lo que incluye el servicio de arriendo */
.rental-includes {
    max-width: var(--container-narrow);
    margin: 88px auto 0;
    text-align: center;
}

.rental-includes-title {
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 600;
    margin-bottom: 28px;
}

/* Detalle del servicio: lista con viñetas, alineada a la izquierda
   y centrada como bloque bajo el título */
.includes-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: fit-content;
    margin: 0 auto;
    text-align: left;
    list-style: disc;
    padding-left: 1.2em;
}

.includes-text li {
    display: list-item;
    font-size: 17px;
    color: var(--on-surface-variant);
}

.includes-text li::marker {
    color: var(--driftwood);
}

.includes-note {
    color: var(--domino);
    font-size: 15px;
}

.rental-includes-cta {
    text-align: center;
}

.rental-cta {
    margin-top: 64px;
}

/* Collage bento original (clúster tarjeta + sus fotos), sin el clúster
   del medio (Mobiliario) */
.service-collage {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(200px, auto);
    grid-template-areas:
        "p1 c1 p3 c2"
        "p1 p2 p3 p4"
        "p7 p7 p8 p8";
    gap: 18px;
    margin-top: 48px;
}

.area-p1 { grid-area: p1; }
.area-p2 { grid-area: p2; }
.area-p3 { grid-area: p3; }
.area-p4 { grid-area: p4; }
.area-p7 { grid-area: p7; }
.area-p8 { grid-area: p8; }
.area-c1 { grid-area: c1; }
.area-c2 { grid-area: c2; }

/* Tarjetas del collage (versión para fondo claro de la sección) */
.amenity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-soft);
}

.amenity-card:hover {
    transform: translateY(-6px);
    border-color: var(--domino);
    box-shadow: var(--shadow-ambient-lg);
}

.amenity-icon {
    font-size: 40px;
    color: var(--avocado);
    margin-bottom: 16px;
    display: inline-block;
    transition: transform 0.45s ease;
}

.amenity-card:hover .amenity-icon {
    transform: translateY(-5px) scale(1.08);
}

.amenity-card h3 {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 600;
    color: var(--cape-palliser);
    margin-bottom: 10px;
}

.amenity-card p {
    font-size: 14.5px;
    color: var(--on-surface-variant);
}

/* Fotos del collage: zoom suave + velo cálido al hover */
.collage-photo {
    position: relative;
    margin: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.collage-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease-out-soft);
}

.collage-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(27, 28, 26, 0.28) 100%);
    opacity: 0;
    transition: opacity var(--dur-base) ease;
}

.collage-photo:hover img {
    transform: scale(1.06);
}

.collage-photo:hover::after {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   11. ÁREAS DE ATENCIÓN (tarjetas minimalistas: icono + nombre)
   -------------------------------------------------------------------------- */
/* Alternancia de fondos tras el reordenamiento de secciones:
   compromiso (surface) → áreas (low) → equipo (surface) → arriendo (low) */
.specialties {
    background: var(--surface-container-low);
}

/* Contenedor más ancho que el estándar: las tarjetas e ilustraciones
   son protagonistas de la sección */
.specialties .container {
    max-width: 1340px;
}

/* El margen superior lo aporta el subtítulo de la sección */
.areas-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px;
}

.area-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 52px 20px;
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-soft);
}

.area-card:hover {
    transform: translateY(-6px);
    border-color: var(--domino);
    box-shadow: var(--shadow-ambient);
}

/* Ilustraciones de línea (fondo blanco, mismo set visual del cliente) */
.area-illus {
    width: min(100%, 190px);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    transition: transform 0.45s ease;
}

.area-card:hover .area-illus {
    transform: translateY(-4px) scale(1.06);
}

.area-card h3 {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 500;
    color: var(--cape-palliser);
    line-height: 1.35;
}

/* --------------------------------------------------------------------------
   12. EQUIPO
   -------------------------------------------------------------------------- */
.team-slider-wrapper {
    touch-action: pan-y;
    margin-top: 48px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    align-items: stretch;
}

.team-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-container-lowest);
    border: 1px solid var(--domino);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: cardFadeIn 0.5s ease both;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.team-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-ambient-lg);
}

.team-card:hover .team-photo img {
    transform: scale(1.04);
}

.team-photo img {
    transition: transform 0.6s ease;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.team-photo {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--surface-container);
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Placeholder con iniciales para profesionales sin foto */
.team-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sandal) 0%, var(--avocado) 100%);
}

.team-photo-placeholder span {
    font-family: var(--font-serif);
    font-size: 64px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.team-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 28px;
}

.team-name {
    font-size: 21px;
    margin-bottom: 12px;
}

.team-desc {
    color: var(--on-surface-variant);
    font-size: 15px;
    margin-bottom: 8px;
}

/* Descripción extendida: colapsada por defecto, se expande con "Ver más".
   Las tarjetas sin descripción aún tienen el div vacío (estructura preparada). */
.team-desc-ext {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-slow) var(--ease-out-soft);
}

.team-desc-ext p {
    color: var(--on-surface-variant);
    font-size: 15px;
    padding-bottom: 8px;
}

.team-more {
    align-self: flex-start;
    padding: 4px 0;
    margin-bottom: 16px;
    color: var(--driftwood);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.team-more.hidden {
    display: none;
}

.team-actions {
    margin-top: auto;
}

.btn-card {
    width: 100%;
    background: var(--driftwood);
    color: var(--on-primary);
    padding: 12px 20px;
    font-size: 14.5px;
}

.btn-card:hover {
    background: #a37c3c;
    box-shadow: var(--shadow-ambient);
}

/* Controles del slider */
.team-slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 48px;
}

.slider-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--domino);
    color: var(--cape-palliser);
    background: var(--surface-container-lowest);
    transition: var(--transition-soft);
}

.slider-arrow:hover:not(:disabled) {
    background: var(--surface-container-high);
    transform: scale(1.08);
}

.slider-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.slider-pages {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--outline-variant);
    background: var(--surface-container-lowest);
    color: var(--on-surface-variant);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-soft);
}

.page-dot.active {
    background: var(--driftwood);
    border-color: var(--driftwood);
    color: #ffffff;
}

.page-dot.dot-small {
    width: 16px;
    height: 16px;
    padding: 0;
}

/* --------------------------------------------------------------------------
   13. FORMULARIO DE CONTACTO
   -------------------------------------------------------------------------- */
.contact-form {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    padding: 48px;
    box-shadow: var(--shadow-ambient);
}

.contact-form.fade-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cape-palliser);
    letter-spacing: 0.03em;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    font-family: var(--font-sans);
    font-size: 15.5px;
    color: var(--on-surface);
    background: rgba(153, 133, 102, 0.08); /* Domino baja opacidad */
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-soft);
}

.form-input::placeholder {
    color: var(--domino);
}

.form-input:focus {
    border-color: var(--avocado);
    background: var(--surface-container-lowest);
}

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

.form-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 28px;
    font-size: 14px;
    color: var(--on-surface-variant);
    cursor: pointer;
}

.form-consent input {
    margin-top: 3px;
    accent-color: var(--avocado);
}

.form-consent a {
    color: var(--driftwood);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Tarjeta de éxito */
.form-success-card {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 56px 48px;
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-ambient);
}

.form-success-card .success-icon {
    font-size: 52px;
    color: var(--avocado);
    font-variation-settings: 'FILL' 1, 'wght' 300;
}

.form-success-card h3 {
    font-size: 26px;
}

.form-success-card p {
    color: var(--on-surface-variant);
    max-width: 420px;
}

.btn-success-close {
    color: var(--domino);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   14. ENCUÉNTRANOS (mapa centrado + WhatsApp + Instagram)
   -------------------------------------------------------------------------- */
.contact-info-section {
    background: var(--surface-container-low);
}

.location-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.map-container {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-ambient);
    margin-bottom: 36px;
}

.map-container iframe {
    display: block;
}

/* Grilla de casillas de contacto estructuradas */
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
}

.contact-info-card {
    background: var(--surface-container-lowest);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-ambient);
    transition: transform var(--dur-base) var(--ease-out-soft), box-shadow var(--dur-base) var(--ease-out-soft), border-color var(--dur-base) var(--ease-out-soft);
}

.contact-link-card {
    text-decoration: none;
    cursor: pointer;
}

.contact-link-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-ambient-lg);
    border-color: var(--domino);
}

.contact-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: var(--radius-full);
    margin-bottom: 20px;
    box-shadow: var(--shadow-ambient);
    transition: transform 0.3s ease;
}

/* Casilla Dirección (Icono de localización de Google) */
.location-icon {
    background: rgba(147, 119, 67, 0.1);
    color: var(--driftwood);
}

.location-icon .material-symbols-outlined {
    font-size: 28px;
}

/* Casilla WhatsApp (Icono y color de WhatsApp) */
.whatsapp-card-icon {
    background: var(--whatsapp);
    color: #ffffff;
}

.whatsapp-card-icon .whatsapp-svg-icon {
    width: 26px;
    height: 26px;
}

/* Casilla Instagram (Icono con degradado original oficial) */
.instagram-card-icon {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeB 90%);
    color: #ffffff;
    border-radius: 16px; /* Forma de la app de instagram */
    box-shadow: 0 4px 12px rgba(214, 36, 159, 0.25);
}

.instagram-card-icon .instagram-svg-icon {
    width: 28px;
    height: 28px;
}

/* Animación de rotación/escala de iconos al pasar el ratón */
.contact-link-card:hover .contact-card-icon {
    transform: scale(1.1) rotate(2deg);
}

.contact-info-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--cape-palliser);
    margin-bottom: 10px;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-address-text,
.card-link-text {
    font-size: 14.5px;
    color: var(--on-surface-variant);
    line-height: 1.5;
    margin-bottom: 8px;
    flex-grow: 1;
}

.card-link-text {
    font-family: var(--font-serif);
    font-size: 18.5px;
    font-weight: 600;
    color: var(--driftwood);
}

/* Ajuste de tipografía para el username de Instagram */
.contact-info-card:nth-child(3) .card-link-text {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--cape-palliser);
}

.card-metro-text,
.card-action-text {
    font-size: 13px;
    color: var(--domino);
}

.card-action-text {
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    color: var(--driftwood);
}

/* --------------------------------------------------------------------------
   15. FOOTER
   -------------------------------------------------------------------------- */
.footer {
    background: var(--inverse-surface);
    color: var(--inverse-on-surface);
    padding: 72px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(242, 241, 237, 0.15);
}

.footer-logo {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 600;
    color: var(--sandal);
    margin-bottom: 14px;
}

.footer-brand-list li {
    color: rgba(242, 241, 237, 0.75);
    font-size: 15px;
    margin-bottom: 8px;
}

.footer h4 {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sandal);
    margin-bottom: 18px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-link {
    display: inline-block;
    color: rgba(242, 241, 237, 0.75);
    font-size: 15px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-link:hover {
    color: #ffffff;
}

.footer-links .footer-link:hover {
    transform: translateX(4px);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    color: rgba(242, 241, 237, 0.75);
    font-size: 14.5px;
}

.footer-contact-item .material-symbols-outlined {
    font-size: 20px;
    color: var(--sandal);
}

.footer-contact-item svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--sandal);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 28px;
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(242, 241, 237, 0.25);
    border-radius: var(--radius-full);
    color: rgba(242, 241, 237, 0.8);
    transition: var(--transition-soft);
}

.social-icon:hover {
    background: var(--sandal);
    border-color: var(--sandal);
    color: #ffffff;
    transform: translateY(-2px);
}

.copyright {
    color: rgba(242, 241, 237, 0.6);
    font-size: 13.5px;
    text-align: center;
}

.copyright .footer-link {
    font-size: 13.5px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   16. FLOATING WHATSAPP
   -------------------------------------------------------------------------- */
.floating-whatsapp {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: var(--whatsapp);
    color: #ffffff;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--shadow-ambient-lg);
    opacity: 0;
    /* Parte desde arriba-izquierda: simula que el botón del hero se desliza a la esquina */
    transform: translate(-48px, -80px) scale(0.85);
    pointer-events: none;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease, background-color 0.35s ease;
}

.floating-whatsapp.visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    pointer-events: auto;
    animation: gentlePulse 3.5s ease-in-out 0.8s infinite;
}

/* Pulso sutil para invitar al contacto sin ser agresivo */
@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 16px 60px rgba(48, 49, 46, 0.12), 0 0 0 0 rgba(37, 211, 102, 0.35); }
    50% { box-shadow: 0 16px 60px rgba(48, 49, 46, 0.12), 0 0 0 10px rgba(37, 211, 102, 0); }
}

.floating-whatsapp:hover {
    background: var(--whatsapp-dark);
}

.floating-whatsapp-icon {
    display: flex;
}

.floating-whatsapp .whatsapp-svg-icon {
    width: 22px;
    height: 22px;
}

/* --------------------------------------------------------------------------
   17. ANIMACIONES DE REVEAL
   -------------------------------------------------------------------------- */
/* Entradas al hacer scroll: ease-out, distancia corta, ritmo unificado */
.reveal,
.reveal-left,
.reveal-right {
    opacity: 0;
    transition: opacity var(--dur-slow) var(--ease-out-soft), transform var(--dur-slow) var(--ease-out-soft);
}

.reveal { transform: translateY(22px); }
.reveal-left { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }

.reveal-active {
    opacity: 1;
    transform: translate(0, 0);
}

/* Stagger sutil entre elementos hermanos (guía: 30-50ms por ítem) */
.delay-100 { transition-delay: 0.05s; }
.delay-200 { transition-delay: 0.1s; }
.delay-300 { transition-delay: 0.15s; }
.delay-400 { transition-delay: 0.2s; }

/* --------------------------------------------------------------------------
   18. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .container {
        padding: 0 var(--pad-desktop);
    }
}

@media (max-width: 1024px) {
    :root {
        --section-gap: 88px;
    }

    .boxes-grid {
        grid-template-columns: 1fr;
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .areas-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .service-collage {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: minmax(190px, auto);
        grid-template-areas:
            "p1 c1"
            "p1 p2"
            "p3 c2"
            "p3 p4"
            "p7 p7"
            "p8 p8";
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 900px) {
    /* Nav móvil tipo drawer */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1100;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: min(78vw, 320px);
        padding: 88px 28px 28px;
        background: var(--surface);
        box-shadow: var(--shadow-ambient-lg);
        overflow-y: auto;
        transform: translateX(105%);
        transition: transform 0.38s var(--ease-out-soft);
    }

    .nav-menu.open {
        transform: translateX(0);
    }

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

    .nav-link {
        width: 100%;
        padding: 14px 16px;
        font-size: 17px;
    }

    .nav-close {
        display: flex;
        position: absolute;
        top: 20px;
        right: 20px;
        color: var(--cape-palliser);
    }

    .nav-close .material-symbols-outlined {
        font-size: 28px;
    }

    .nav-cta {
        display: none;
    }

    .nav-item-cta {
        display: block;
    }

    .hamburger {
        display: flex;
    }

    .hero {
        padding: 128px 0 110px;
    }

    .hero-dots {
        right: 24px;
        bottom: 30px;
    }

    .contact-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 64px;
    }

    .about-image-wrapper {
        max-width: 440px;
        margin: 0 auto;
        width: 100%;
    }

    .team-grid {
        grid-template-columns: 1fr;
        max-width: 440px;
        margin: 0 auto;
    }

}

@media (max-width: 640px) {
    :root {
        --section-gap: 72px;
    }

    .section-title {
        font-size: 30px;
    }

    .hero-title {
        font-size: 46px;
    }

    .hero-title-sub {
        font-size: 23px;
    }


    .areas-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    /* La quinta área ocupa el ancho completo para no quedar coja */
    .area-card:last-child {
        grid-column: 1 / -1;
    }

    /* Collage móvil: cada clúster mantiene sus fotos junto a su tarjeta */
    .service-collage {
        grid-auto-rows: minmax(150px, auto);
        gap: 14px;
        margin-top: 40px;
        grid-template-areas:
            "p1 p2"
            "c1 c1"
            "p3 p4"
            "c2 c2"
            "p7 p7"
            "p8 p8";
    }

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

    .contact-form,
    .form-success-card {
        padding: 32px 24px;
        border-radius: var(--radius-lg);
    }

    .map-container iframe {
        height: 280px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .floating-whatsapp-text {
        display: none;
    }

    .floating-whatsapp {
        padding: 16px;
    }

    /* Logo compacto en móvil */
    .logo-img {
        width: 38px;
        height: 38px;
    }

    .logo-foro {
        font-size: 19px;
    }

    .logo-espacios {
        font-size: 10px;
        letter-spacing: 0.24em;
    }

    .footer-bottom {
        flex-direction: column;
        justify-content: center;
    }
}
