/* ============================================================
   UP FINCAS — SISTEMA DE DISEÑO "REGISTRO"
   Dirección: editorial institucional. Filetes, no cajas.
   Ónice como suelo, arena como papel, esmeralda como acento escaso.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
    /* Superficies */
    --onyx:          #050400;
    --onyx-raised:   #12100A;
    --onyx-line:     rgba(236, 210, 183, 0.16);
    --paper:         #FAF6F0;
    --paper-warm:    #F3ECE2;
    --paper-card:    #FFFDFA;

    /* Tinta */
    --ink:           #191510;
    --ink-soft:      #5C5349;
    --ink-faint:     #6E6458;   /* AA sobre papel: se usa en etiquetas pequeñas */
    --line:          #E4D9CA;
    --line-strong:   #D3C3AE;

    /* Acento — dos registros:
       esmeralda = acción (botones, enlaces, confirmaciones)
       champán   = ornamento editorial (filetes, numerales, comillas, bordes).
       El champán solo se usa sobre ónice: sobre papel no alcanza contraste. */
    --emerald:       #1DC68B;   /* sobre ónice */
    --emerald-deep:  #16A775;
    --emerald-ink:   #0B6E4B;   /* texto sobre papel — AA */
    --champagne:     #ECD2B7;
    --champagne-dim: rgba(236, 210, 183, 0.55);
    --champagne-line:rgba(236, 210, 183, 0.28);
    --sand:          var(--champagne);

    /* Compatibilidad con utilidades heredadas del HTML */
    --color-primary: var(--onyx);
    --color-primary-dark: #000000;
    --color-secondary: var(--emerald);
    --color-secondary-dark: var(--emerald-deep);
    --color-accent: var(--emerald-deep);
    --color-sand: var(--sand);
    --color-sand-light: var(--paper);
    --color-sand-muted: var(--paper-warm);
    --color-light: var(--paper-warm);
    --color-gray: var(--ink-soft);
    --color-gray-light: var(--line);
    --color-taupe: var(--ink-faint);
    --color-dark: var(--onyx);
    --color-white: #ffffff;

    /* Tipografía */
    --font-display: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: var(--font-body);
    --font-serif: var(--font-display);

    /* Ritmo */
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --section-y: clamp(4.5rem, 9vw, 8.5rem);
    --max-width: 1220px;
    --measure: 62ch;

    /* Materia */
    --radius: 2px;
    --radius-pill: 100px;
    --border-radius: var(--radius);
    --border-radius-sm: var(--radius);
    --border-radius-pill: var(--radius-pill);

    --shadow-sm: 0 1px 2px rgba(25, 21, 16, 0.04);
    --shadow-md: 0 18px 40px -28px rgba(25, 21, 16, 0.35);
    --shadow-lg: 0 40px 80px -40px rgba(25, 21, 16, 0.42);
    --shadow-hover: 0 48px 90px -44px rgba(25, 21, 16, 0.5);

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --transition: 0.5s var(--ease);
    --transition-fast: 0.28s var(--ease);
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1.0125rem;
    line-height: 1.75;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
    overflow-x: hidden;
    counter-reset: section;
}

/* Grano de papel: da materia sin coste de red */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.55;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible {
    outline: 2px solid var(--emerald-deep);
    outline-offset: 3px;
    border-radius: 1px;
}
.section-primary :focus-visible,
.footer :focus-visible,
.cta-section :focus-visible,
.hero :focus-visible,
.branch-hero :focus-visible,
.top-bar :focus-visible,
.legal-header :focus-visible,
.page-hero :focus-visible,
.testimonials :focus-visible { outline-color: var(--emerald); }

::selection { background: var(--emerald); color: var(--onyx); }

/* Salto al contenido: invisible hasta que el teclado lo necesita */
.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10002;
    padding: 0.8rem 1.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--onyx);
    background: var(--emerald);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    transform: translateY(-160%);
    transition: transform var(--transition-fast);
}
.skip-link:focus-visible { transform: translateY(0); outline-offset: 2px; }

/* ---------- 3. TIPOGRAFÍA ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.15; }

h1, h2 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.022em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.35rem, 5.2vw, 4rem); line-height: 1.04; }
h2 { font-size: clamp(1.95rem, 3.6vw, 3rem); line-height: 1.1; }

h3 {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.35;
}
h4 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; letter-spacing: 0.01em; }

p { max-width: var(--measure); text-wrap: pretty; }
strong, b { font-weight: 600; }

.lead {
    font-size: clamp(1.08rem, 1.6vw, 1.26rem);
    line-height: 1.6;
    color: var(--ink);
    letter-spacing: -0.008em;
}

/* Microtipografía: la firma del sistema */
.overline {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-body);
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--emerald-ink);
    margin-bottom: 1.35rem;
    line-height: 1.4;
}
.overline::before {
    content: "";
    flex: none;
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}
.section-primary .overline,
.testimonials .overline,
.branch-hero .overline,
.hero .overline,
.legal-header .overline { color: var(--emerald); }
.branch-showcase-card .overline { color: var(--champagne); }

/* ---------- 4. LAYOUT ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

section { padding-block: var(--section-y); position: relative; }

.section-light { background: var(--paper-warm); }

.section-primary { background: var(--onyx); color: var(--paper); }
.section-primary h2, .section-primary h3, .section-primary h4 { color: var(--paper); }
.section-primary p { color: rgba(250, 246, 240, 0.72); }

/* Cabecera de sección: editorial, alineada a la izquierda, numerada */
.section-header {
    max-width: 46rem;
    margin-bottom: clamp(3rem, 5vw, 4.5rem);
    counter-increment: section;
    position: relative;
    padding-right: 5rem;
}
.section-header h2 { margin-bottom: 1.1rem; }
.section-header p {
    color: var(--ink-soft);
    font-size: 1.06rem;
    max-width: 42rem;
}
.section-primary .section-header p,
.testimonials .section-header p { color: rgba(250, 246, 240, 0.66); }

.section-header::after {
    content: counter(section, decimal-leading-zero);
    position: absolute;
    top: -0.5rem;
    right: 0;
    font-family: var(--font-display);
    font-size: 3.4rem;
    line-height: 1;
    font-weight: 400;
    color: var(--line-strong);
    font-feature-settings: "tnum" 1;
    pointer-events: none;
}
.section-primary .section-header::after,
.testimonials .section-header::after { color: var(--champagne); opacity: 0.38; }

/* ---------- 5. BOTONES ---------- */
.btn,
.btn-hero-primary,
.btn-hero-secondary {
    --btn-bg: var(--onyx);
    --btn-fg: var(--paper);
    --btn-line: var(--onyx);
    --btn-sweep: var(--emerald);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1.02rem 2.1rem;
    font-family: var(--font-body);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    line-height: 1;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-line);
    border-radius: var(--radius);
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    text-align: center;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
/* Barrido de esmeralda: el único gesto "brillante" del sistema */
.btn::after,
.btn-hero-primary::after,
.btn-hero-secondary::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--btn-sweep);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.55s var(--ease);
}
.btn:hover::after,
.btn-hero-primary:hover::after,
.btn-hero-secondary:hover::after { transform: scaleX(1); transform-origin: left; }
.btn:hover,
.btn-hero-primary:hover,
.btn-hero-secondary:hover { color: var(--onyx); border-color: var(--emerald); }
.btn i { font-size: 0.85em; }

.btn-primary, .btn-hero-primary { --btn-bg: var(--onyx); --btn-fg: var(--paper); --btn-line: var(--onyx); }

.btn-secondary, .btn-hero-secondary {
    --btn-bg: transparent;
    --btn-fg: var(--paper);
    --btn-line: var(--champagne-dim);
}

.btn-outline { --btn-bg: transparent; --btn-fg: var(--ink); --btn-line: var(--line-strong); }

/* Sobre ónice, el primario se invierte a esmeralda y barre a arena */
.cta-section .btn-primary,
.section-primary .btn-primary {
    --btn-bg: var(--emerald);
    --btn-fg: var(--onyx);
    --btn-line: var(--emerald);
    --btn-sweep: var(--paper);
}
.cta-section .btn-primary:hover,
.section-primary .btn-primary:hover { color: var(--onyx); border-color: var(--paper); }

/* Enlace de texto con filete que se despliega */
.text-link, .service-link, .blog-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--emerald-ink);
    padding-bottom: 0.3rem;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size var(--transition-fast);
}
.text-link:hover, .service-link:hover, .blog-link:hover { background-size: 100% 1px; }
.text-link i, .service-link i, .blog-link i { font-size: 0.72em; transition: transform var(--transition-fast); }
.text-link:hover i, .service-link:hover i, .blog-link:hover i { transform: translateX(4px); }
.section-primary .text-link,
.branch-showcase-card .text-link { color: var(--emerald); }

/* ---------- 6. BARRA SUPERIOR ---------- */
.top-bar {
    background: var(--onyx);
    color: rgba(250, 246, 240, 0.66);
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    padding-block: 0.7rem;
    border-bottom: 1px solid var(--onyx-line);
}
.top-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.top-bar-info { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.top-bar-info span { display: inline-flex; align-items: center; gap: 0.55rem; }
.top-bar-info i { color: var(--champagne); font-size: 0.78em; }
.top-bar-social { display: flex; align-items: center; gap: 0.4rem; }
.top-bar-social a {
    width: 1.9rem;
    height: 1.9rem;
    display: grid;
    place-items: center;
    font-size: 0.76rem;
    color: rgba(250, 246, 240, 0.6);
    border: 1px solid transparent;
    border-radius: 50%;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.top-bar-social a:hover { color: var(--champagne); border-color: var(--champagne-line); }

/* ---------- 7. NAVEGACIÓN ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(250, 246, 240, 0.86);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow var(--transition-fast), background-color var(--transition-fast);
}
.navbar.scrolled {
    background: rgba(250, 246, 240, 0.96);
    box-shadow: 0 1px 0 var(--line), 0 20px 40px -34px rgba(25, 21, 16, 0.5);
}
.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding-block: 1.05rem;
}
.logo { display: inline-flex; align-items: center; gap: 0.9rem; }
.brand-logo { height: 42px; width: auto; max-width: 230px; }
.brand-logo-footer { height: 46px; width: auto; max-width: 250px; }
.logo-icon {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--onyx);
    color: var(--emerald);
    font-weight: 700;
    letter-spacing: -0.05em;
}
.logo-text strong { display: block; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.12em; }
.logo-text small { display: block; font-size: 0.56rem; letter-spacing: 0.2em; color: var(--ink-faint); text-transform: uppercase; }

.nav-menu { display: flex; align-items: center; gap: 2.1rem; }
.nav-menu > li { position: relative; }
.nav-menu a {
    position: relative;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink);
    padding-block: 0.4rem;
    transition: color var(--transition-fast);
}
.nav-menu a::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: var(--emerald-deep);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-fast);
}
.nav-menu a:hover { color: var(--emerald-ink); }
.nav-menu a:hover::after,
.nav-menu a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-menu a.active { color: var(--emerald-ink); }
.nav-menu .fa-chevron-down { font-size: 0.55em; margin-left: 0.35rem; transition: transform var(--transition-fast); }
.nav-dropdown[data-open="true"] .fa-chevron-down { transform: rotate(180deg); }

.nav-cta-pill {
    padding: 0.72rem 1.5rem !important;
    background: var(--onyx);
    color: var(--paper) !important;
    border: 1px solid var(--onyx);
    border-radius: var(--radius-pill);
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.nav-cta-pill::after { display: none; }
.nav-cta-pill:hover { background: var(--emerald); border-color: var(--emerald); color: var(--onyx) !important; }

.nav-submenu {
    position: absolute;
    top: calc(100% + 0.85rem);
    left: -1rem;
    min-width: 13rem;
    padding: 0.6rem;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}
.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu,
.nav-dropdown[data-open="true"] .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-submenu a {
    display: block;
    padding: 0.62rem 0.9rem;
    letter-spacing: 0.12em;
    border-radius: var(--radius);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.nav-submenu a::after { display: none; }
.nav-submenu a:hover { background: var(--paper-warm); color: var(--emerald-ink); }

.mobile-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    font-size: 1.15rem;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), color var(--transition-fast);
}
.mobile-toggle:hover { border-color: var(--emerald-deep); color: var(--emerald-ink); }

/* ---------- 8. HERO PORTADA ---------- */
.hero {
    position: relative;
    color: var(--paper);
    padding-block: clamp(5.5rem, 12vw, 10.5rem) clamp(8rem, 14vw, 12rem);
    overflow: hidden;

    /* Fotografía de arquitectura bajo dos velos: uno direccional que protege
       la lectura del titular y otro que unifica la temperatura de color.
       Las opacidades son variables porque en móvil el texto ocupa todo el
       ancho y necesita más velo por la derecha. */
    --veil-a: 0.97;
    --veil-b: 0.90;
    --veil-c: 0.58;
    background-color: var(--onyx);
    background-image:
        linear-gradient(100deg, rgba(5, 4, 0, var(--veil-a)) 0%, rgba(5, 4, 0, var(--veil-b)) 42%, rgba(5, 4, 0, var(--veil-c)) 100%),
        linear-gradient(0deg, rgba(24, 19, 12, 0.5), rgba(24, 19, 12, 0.5)),
        url("https://images.unsplash.com/photo-1497366216548-37526070297c?w=1920&q=75&auto=format&fit=crop");
    background-size: cover;
    background-position: center, center, center 35%;
    background-repeat: no-repeat;
}
/* Donde se pueda mezclar, la foto se desatura para no competir con la paleta */
@supports (background-blend-mode: saturation) {
    .hero {
        background-image:
            linear-gradient(100deg, rgba(5, 4, 0, var(--veil-a)) 0%, rgba(5, 4, 0, var(--veil-b)) 42%, rgba(5, 4, 0, var(--veil-c)) 100%),
            linear-gradient(0deg, rgb(140, 140, 140), rgb(140, 140, 140)),
            url("https://images.unsplash.com/photo-1497366216548-37526070297c?w=1920&q=75&auto=format&fit=crop");
        background-blend-mode: normal, saturation, normal;
    }
}
/* Retícula arquitectónica tenue + halo esmeralda: atmósfera, no decoración */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--onyx-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--onyx-line) 1px, transparent 1px);
    background-size: 96px 96px;
    mask-image: radial-gradient(ellipse 90% 70% at 78% 18%, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 78% 18%, #000 0%, transparent 72%);
    opacity: 0.55;
    pointer-events: none;
}
.hero::after {
    content: "";
    position: absolute;
    top: -22%; right: -8%;
    width: 46rem; height: 46rem;
    background:
        radial-gradient(circle at 60% 40%, rgba(29, 198, 139, 0.13) 0%, transparent 60%),
        radial-gradient(circle at 30% 70%, rgba(236, 210, 183, 0.11) 0%, transparent 62%);
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-content { max-width: 54rem; }
/* Filete champán: abre el titular como la cabecera de un documento */
.hero-content::before {
    content: "";
    display: block;
    width: 4.5rem;
    height: 1px;
    margin-bottom: 2.2rem;
    background: var(--champagne);
}
.hero h1 {
    color: var(--paper);
    font-size: clamp(2.5rem, 6vw, 4.6rem);
    line-height: 1.02;
    margin-bottom: 1.9rem;
}
.hero h1 span {
    font-style: italic;
    color: var(--emerald);
}
.hero-subtitle {
    font-size: clamp(1.05rem, 1.7vw, 1.28rem);
    line-height: 1.62;
    color: rgba(250, 246, 240, 0.74);
    max-width: 40rem;
    margin-bottom: 2.8rem;
}
.hero-buttons { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero .btn-hero-primary { --btn-bg: var(--emerald); --btn-fg: var(--onyx); --btn-line: var(--emerald); --btn-sweep: var(--paper); }
.hero .btn-hero-primary:hover { border-color: var(--paper); }

/* ---------- 9. TARJETAS FLOTANTES ---------- */
.hero-features-wrapper { position: relative; z-index: 5; margin-top: clamp(-6rem, -7vw, -4rem); }
.hero-features-grid {
    display: grid;
    /* Cuatro tarjetas: se reparten 4 / 2 / 1. Con auto-fit quedaban 3+1 en
       pantallas intermedias, dejando una tarjeta suelta en la segunda fila. */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-top: 2px solid var(--champagne);
    box-shadow: var(--shadow-lg);
}
.hero-feature-card {
    display: block;
    padding: clamp(1.9rem, 2.6vw, 2.6rem);
    border-right: 1px solid var(--line);
    position: relative;
    isolation: isolate;
    transition: color var(--transition-fast);
}
.hero-feature-card:last-child { border-right: 0; }
.hero-feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--onyx);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform var(--transition);
}
.hero-feature-card:hover::before { transform: scaleY(1); transform-origin: top; }
.hero-feature-card:hover { color: var(--paper); }
.hero-feature-card:hover h3 { color: var(--paper); }
.hero-feature-card:hover p { color: rgba(250, 246, 240, 0.7); }
.hero-feature-icon {
    width: 2.9rem; height: 2.9rem;
    display: grid; place-items: center;
    margin-bottom: 1.4rem;
    font-size: 1.05rem;
    color: var(--emerald-ink);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}
.hero-feature-card:hover .hero-feature-icon { color: var(--emerald); border-color: var(--emerald); }
.hero-feature-card h3 { margin-bottom: 0.7rem; transition: color var(--transition-fast); }
.hero-feature-card p { font-size: 0.94rem; line-height: 1.65; color: var(--ink-soft); transition: color var(--transition-fast); }

/* ---------- 10. SERVICIOS (asiento de registro, no tarjeta) ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    counter-reset: svc;
}
.service-card {
    position: relative;
    padding: clamp(2.2rem, 3vw, 3rem) clamp(1.6rem, 2.4vw, 2.4rem) clamp(2.2rem, 3vw, 3rem) 0;
    border-bottom: 1px solid var(--line);
    counter-increment: svc;
    transition: background-color var(--transition-fast);
}
.service-card::before {
    content: counter(svc, decimal-leading-zero);
    position: absolute;
    top: clamp(2.2rem, 3vw, 3rem);
    right: clamp(1.6rem, 2.4vw, 2.4rem);
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--ink-faint);
    font-feature-settings: "tnum" 1;
    transition: color var(--transition-fast);
}
.service-card:hover::before { color: var(--emerald-ink); }
.service-icon {
    width: 3.1rem; height: 3.1rem;
    display: grid; place-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
    color: var(--emerald-ink);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.service-card:hover .service-icon {
    background: var(--onyx);
    border-color: var(--onyx);
    color: var(--emerald);
    transform: translateY(-3px);
}
.service-card h3 { margin-bottom: 0.85rem; padding-right: 2.5rem; }
.service-card p { color: var(--ink-soft); font-size: 0.97rem; }
.service-card ul { margin-top: 1.1rem; }
.service-card ul li {
    position: relative;
    padding-left: 1.1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
}
.service-card ul li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.72em;
    width: 4px; height: 1px;
    background: var(--emerald-deep);
}
.service-link { margin-top: 1.5rem; }

/* ---------- 11. DELEGACIONES (portada) ---------- */
.branch-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}
.branch-showcase-card {
    display: block;
    position: relative;
    padding: clamp(2.5rem, 4vw, 3.8rem);
    background: var(--onyx);
    color: var(--paper);
    overflow: hidden;
    isolation: isolate;
}
.branch-showcase-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--onyx-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--onyx-line) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.5;
    transition: opacity var(--transition), transform 0.9s var(--ease);
}
.branch-showcase-card:hover::before { opacity: 1; transform: scale(1.08); }
.branch-showcase-madrid { background: var(--onyx); }
.branch-showcase-levante { background: var(--onyx-raised); }
.branch-showcase-card h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    letter-spacing: -0.02em;
    color: var(--paper);
    margin-bottom: 1rem;
}
.branch-showcase-card p { color: rgba(250, 246, 240, 0.7); margin-bottom: 1.9rem; font-size: 0.99rem; }

/* ---------- 12. SOBRE NOSOTROS ---------- */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 6vw, 5.5rem);
    align-items: center;
}
.about-image { position: relative; }
.about-image img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    filter: grayscale(1) contrast(1.04);
    transition: filter 0.8s var(--ease);
}
.about-image:hover img { filter: grayscale(0) contrast(1); }
.about-image-overlay {
    position: absolute;
    right: clamp(-1rem, -2vw, -2rem);
    bottom: clamp(1.5rem, 3vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1.5rem 1.8rem;
    background: var(--onyx);
    color: var(--paper);
    border-left: 2px solid var(--champagne);
}
.about-image-overlay .years {
    font-family: var(--font-display);
    font-size: 2.9rem;
    line-height: 1;
    color: var(--emerald);
}
.about-image-overlay span:last-child {
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(250, 246, 240, 0.68);
}
.about-content h2 { margin-bottom: 1.4rem; }
.about-content .lead { margin-bottom: 1.2rem; }
.about-content > p { color: var(--ink-soft); margin-bottom: 1.2rem; }
.about-features { margin: 2.2rem 0; border-top: 1px solid var(--line); }
.about-features li {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--line);
}
.about-features i { color: var(--emerald-ink); font-size: 0.95rem; margin-top: 0.35rem; }
.about-features strong { display: block; font-size: 0.98rem; margin-bottom: 0.1rem; }
.about-features span { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- 13. VALORES ---------- */
.values-grid {
    display: grid;
    /* Mismo criterio que .hero-features-grid: 4 / 2 / 1, nunca 3+1 */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--onyx-line);
    border: 1px solid var(--onyx-line);
}
.value-card {
    padding: clamp(2rem, 3vw, 2.8rem);
    background: var(--onyx);
    transition: background-color var(--transition);
}
.value-card:hover { background: var(--onyx-raised); }
.value-icon {
    width: 2.9rem; height: 2.9rem;
    display: grid; place-items: center;
    margin-bottom: 1.4rem;
    font-size: 1.05rem;
    color: var(--emerald);
    border: 1px solid var(--onyx-line);
    border-radius: 50%;
    transition: border-color var(--transition);
}
.value-card:hover .value-icon { border-color: var(--emerald); }
.value-card h4 { margin-bottom: 0.6rem; font-size: 1.05rem; }
.value-card p { font-size: 0.93rem; line-height: 1.65; }

/* ---------- 14. TESTIMONIOS ---------- */
.testimonials { background: var(--onyx-raised); color: var(--paper); }
.testimonials h2 { color: var(--paper); }
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1px;
    background: var(--onyx-line);
    border: 1px solid var(--onyx-line);
}
.testimonial-card {
    position: relative;
    padding: clamp(2.2rem, 3vw, 3rem);
    background: var(--onyx-raised);
    transition: background-color var(--transition);
}
.testimonial-card:hover { background: var(--onyx); }
.testimonial-card::before {
    content: "\201C";
    position: absolute;
    top: 1rem; right: 1.8rem;
    font-family: var(--font-display);
    font-size: 6rem;
    line-height: 1;
    color: var(--champagne);
    opacity: 0.2;
    pointer-events: none;
}
.testimonial-stars { display: flex; gap: 0.28rem; margin-bottom: 1.4rem; color: var(--emerald); font-size: 0.76rem; }
.testimonial-text {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-style: italic;
    line-height: 1.6;
    color: rgba(250, 246, 240, 0.9);
    margin-bottom: 2rem;
}
.testimonial-author { display: flex; align-items: center; gap: 0.9rem; padding-top: 1.4rem; border-top: 1px solid var(--onyx-line); }
.testimonial-avatar {
    width: 2.7rem; height: 2.7rem;
    flex: none;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid var(--champagne-line);
    color: var(--champagne);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}
.testimonial-info strong { display: block; font-size: 0.95rem; color: var(--paper); }
.testimonial-info span { font-size: 0.78rem; color: rgba(250, 246, 240, 0.55); letter-spacing: 0.04em; }

/* ---------- 15. CTA ---------- */
.cta-section {
    position: relative;
    background: var(--onyx);
    color: var(--paper);
    text-align: center;
    overflow: hidden;
}
.cta-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 100% at 38% 100%, rgba(29, 198, 139, 0.12) 0%, transparent 68%),
        radial-gradient(ellipse 55% 100% at 66% 100%, rgba(236, 210, 183, 0.1) 0%, transparent 68%);
    pointer-events: none;
}
.cta-section .container { position: relative; z-index: 1; }
.cta-section h2 { color: var(--paper); margin-bottom: 1.2rem; }
.cta-section p {
    color: rgba(250, 246, 240, 0.7);
    max-width: 40rem;
    margin: 0 auto 2.6rem;
    font-size: 1.06rem;
}
.cta-buttons { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* ---------- 16. CABECERAS DE PÁGINA ---------- */
.page-hero, .legal-header {
    position: relative;
    background: var(--onyx);
    color: var(--paper);
    padding-block: clamp(4rem, 8vw, 7rem) clamp(3rem, 6vw, 5rem);
    overflow: hidden;
}
.page-hero::before, .legal-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--onyx-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--onyx-line) 1px, transparent 1px);
    background-size: 88px 88px;
    mask-image: radial-gradient(ellipse 80% 90% at 85% 10%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at 85% 10%, #000 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}
.page-hero .container, .legal-header .container { position: relative; z-index: 1; }
/* Mismo filete champán que abre la portada: firma común a todas las cabeceras */
.page-hero .container::before {
    content: "";
    display: block;
    width: 3.5rem;
    height: 1px;
    margin-bottom: 1.6rem;
    background: var(--champagne);
}
.page-hero h1, .legal-header h1 { color: var(--paper); margin-bottom: 1.1rem; }
.legal-header p { color: rgba(250, 246, 240, 0.7); max-width: 46rem; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(250, 246, 240, 0.55);
}
.breadcrumb a { color: var(--emerald); transition: opacity var(--transition-fast); }
.breadcrumb a:hover { opacity: 0.75; }
.breadcrumb i { font-size: 0.5rem; opacity: 0.5; }

/* ---------- 17. HERO DE DELEGACIÓN ---------- */
.branch-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(30rem, 62vh, 40rem);
    background: var(--onyx);
    color: var(--paper);
    overflow: hidden;
}
.branch-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--onyx-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--onyx-line) 1px, transparent 1px);
    background-size: 92px 92px;
    opacity: 0.5;
    mask-image: radial-gradient(ellipse 85% 80% at 80% 20%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 85% 80% at 80% 20%, #000 0%, transparent 70%);
}
.branch-hero::after {
    content: "";
    position: absolute;
    top: -20%; right: -10%;
    width: 42rem; height: 42rem;
    border-radius: 50%;
    pointer-events: none;
}
.branch-hero-madrid::after { background: radial-gradient(circle, rgba(29, 198, 139, 0.15) 0%, transparent 62%); }
.branch-hero-levante::after { background: radial-gradient(circle, rgba(236, 210, 183, 0.14) 0%, transparent 62%); }

/* Fotografía de cabecera por delegación, bajo el mismo velo que la portada:
   uno direccional que protege la lectura y otro que unifica la temperatura.
   Las opacidades son variables porque en móvil el texto ocupa todo el ancho. */
.branch-hero-madrid,
.branch-hero-levante {
    --veil-a: 0.97;
    --veil-b: 0.91;
    --veil-c: 0.60;
    background-size: cover;
    background-position: center, center, center 40%;
    background-repeat: no-repeat;
}
.branch-hero-madrid {
    background-image:
        linear-gradient(100deg, rgba(5, 4, 0, var(--veil-a)) 0%, rgba(5, 4, 0, var(--veil-b)) 44%, rgba(5, 4, 0, var(--veil-c)) 100%),
        linear-gradient(0deg, rgba(24, 19, 12, 0.5), rgba(24, 19, 12, 0.5)),
        url("https://images.unsplash.com/photo-1554469384-e58fac16e23a?w=1920&q=75&auto=format&fit=crop");
}
.branch-hero-levante {
    background-image:
        linear-gradient(100deg, rgba(5, 4, 0, var(--veil-a)) 0%, rgba(5, 4, 0, var(--veil-b)) 44%, rgba(5, 4, 0, var(--veil-c)) 100%),
        linear-gradient(0deg, rgba(24, 19, 12, 0.5), rgba(24, 19, 12, 0.5)),
        url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?w=1920&q=75&auto=format&fit=crop");
}
@supports (background-blend-mode: saturation) {
    .branch-hero-madrid {
        background-image:
            linear-gradient(100deg, rgba(5, 4, 0, var(--veil-a)) 0%, rgba(5, 4, 0, var(--veil-b)) 44%, rgba(5, 4, 0, var(--veil-c)) 100%),
            linear-gradient(0deg, rgb(140, 140, 140), rgb(140, 140, 140)),
            url("https://images.unsplash.com/photo-1554469384-e58fac16e23a?w=1920&q=75&auto=format&fit=crop");
        background-blend-mode: normal, saturation, normal;
    }
    .branch-hero-levante {
        background-image:
            linear-gradient(100deg, rgba(5, 4, 0, var(--veil-a)) 0%, rgba(5, 4, 0, var(--veil-b)) 44%, rgba(5, 4, 0, var(--veil-c)) 100%),
            linear-gradient(0deg, rgb(140, 140, 140), rgb(140, 140, 140)),
            url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?w=1920&q=75&auto=format&fit=crop");
        background-blend-mode: normal, saturation, normal;
    }
}
.branch-hero .container { position: relative; z-index: 1; }
.branch-hero-content { max-width: 52rem; padding-block: clamp(4rem, 8vw, 6rem); }
.branch-hero-content h1 { color: var(--paper); margin-bottom: 1.5rem; }
.branch-hero-content p {
    font-size: clamp(1.02rem, 1.5vw, 1.18rem);
    color: rgba(250, 246, 240, 0.72);
    max-width: 42rem;
    margin-bottom: 2.5rem;
}
.branch-hero .btn-primary { --btn-bg: var(--emerald); --btn-fg: var(--onyx); --btn-line: var(--emerald); --btn-sweep: var(--paper); }
.branch-hero .btn-primary:hover { border-color: var(--paper); }

.branch-intro {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.branch-intro h2 { margin-bottom: 0; }
.branch-intro p { color: var(--ink-soft); }
.branch-intro .lead { margin-bottom: 1.1rem; color: var(--ink); }

/* Servicios de delegación: celdas con caja propia, no los "asientos de registro"
   de la portada. Tres columnas exactas para que seis tarjetas llenen dos filas
   completas, en lugar de dejar una fila coja con hueco a la derecha. */
.branch-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}
.branch-cards .service-card {
    display: flex;
    flex-direction: column;
    padding: clamp(1.9rem, 2.4vw, 2.5rem);
    background: var(--paper);
    border-bottom: 0;
}
.branch-cards .service-card:hover { background: var(--paper-card); }
/* El numeral se alinea con el icono y respeta el margen de la celda */
.branch-cards .service-card::before {
    top: clamp(1.9rem, 2.4vw, 2.5rem);
    right: clamp(1.9rem, 2.4vw, 2.5rem);
}
.branch-cards .service-card h3 { padding-right: 2.75rem; }
.branch-cards .service-card p { color: var(--ink-soft); }

@media (max-width: 1080px) {
    .branch-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 18. PROBLEMA / SOLUCIÓN ---------- */
.pain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}
/* Cada tarjeta cede sus dos filas —cabecera y solución— a la rejilla padre,
   de modo que todos los bloques de solución comparten altura y quedan alineados
   entre sí en lugar de crecer cada uno según su texto. */
.pain-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    background: var(--paper);
    transition: background-color var(--transition);
}
/* Sin soporte de subgrid se mantiene el comportamiento anterior */
@supports not (grid-template-rows: subgrid) {
    .pain-card { display: flex; flex-direction: column; }
    .pain-header { flex: 1; }
}
.pain-card:hover { background: var(--paper-card); }
.pain-header { padding: clamp(1.9rem, 2.6vw, 2.5rem); }
.pain-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.19em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 1.1rem;
}
.pain-tag i { color: #B4541F; font-size: 0.85em; }
.pain-title { font-size: 1.13rem; margin-bottom: 0.85rem; }
.pain-problem { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.68; max-width: none; }
.pain-solution {
    padding: clamp(1.5rem, 2.2vw, 2rem) clamp(1.9rem, 2.6vw, 2.5rem);
    background: var(--onyx);
    color: rgba(250, 246, 240, 0.78);
    font-size: 0.93rem;
    line-height: 1.68;
    border-top: 1px solid var(--emerald);
}
.pain-solution strong {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--emerald);
}
.pain-solution i { font-size: 0.9em; }

/* ---------- 19. LOCALIZACIÓN ---------- */
.branch-location {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
.branch-location h2 { margin-bottom: 1.2rem; }
.branch-location p { color: var(--ink-soft); margin-bottom: 1.2rem; }
.branch-location strong { color: var(--ink); }
.location-panel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: clamp(2.2rem, 3.5vw, 3.2rem);
    background: var(--onyx);
    color: var(--paper);
    border-left: 2px solid var(--emerald);
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    line-height: 1.15;
}
.location-panel-levante { border-left-color: var(--sand); }
.location-panel small {
    display: block;
    margin-top: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(250, 246, 240, 0.55);
    line-height: 1.6;
}
.location-pin {
    flex: none;
    width: 3.2rem; height: 3.2rem;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid var(--onyx-line);
    color: var(--emerald);
    font-size: 1.1rem;
}
.location-panel-levante .location-pin { color: var(--sand); }

/* ---------- 20. FAQ ---------- */
.faq-list { max-width: 52rem; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.6rem 0.25rem;
    cursor: pointer;
    font-size: 1.04rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: color var(--transition-fast);
}
.faq-question:hover { color: var(--emerald-ink); }
.faq-question i {
    flex: none;
    font-size: 0.7rem;
    color: var(--emerald-ink);
    transition: transform var(--transition);
}
.faq-item.active .faq-question i { transform: rotate(180deg); }
.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--transition);
}
.faq-item.active .faq-answer { grid-template-rows: 1fr; }
.faq-answer-content {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.75;
    max-width: 46rem;
}
.faq-item.active .faq-answer-content { padding-bottom: 1.7rem; }

/* ---------- 21. CONTACTO Y FORMULARIOS ---------- */
.form-section { background: var(--paper-warm); }
.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: start;
}
.contact-info-card {
    display: flex;
    gap: 1.4rem;
    padding: 1.7rem 0;
    border-bottom: 1px solid var(--line);
}
.contact-info-card:first-child { border-top: 1px solid var(--line); }
.contact-info-icon {
    flex: none;
    width: 3rem; height: 3rem;
    display: grid; place-items: center;
    font-size: 1.05rem;
    color: var(--emerald-ink);
    background: var(--paper-card);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.contact-info-card:hover .contact-info-icon {
    background: var(--onyx);
    border-color: var(--onyx);
    color: var(--emerald);
}
.contact-info-content h4 { margin-bottom: 0.3rem; font-size: 1rem; }
.contact-info-content p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }
.contact-info-content a {
    color: var(--ink);
    font-weight: 600;
    background-image: linear-gradient(var(--emerald-deep), var(--emerald-deep));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size var(--transition-fast), color var(--transition-fast);
}
.contact-info-content a:hover { color: var(--emerald-ink); background-size: 100% 1px; }

.contact-form {
    padding: clamp(2rem, 3.5vw, 3.2rem);
    background: var(--paper-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
}
.contact-form h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.5rem, 2.4vw, 1.95rem);
    letter-spacing: -0.02em;
    margin-bottom: 1.9rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--line);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.form-group { margin-bottom: 1.35rem; }
.form-group label {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.92rem 1rem;
    font-size: 0.98rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-group textarea { min-height: 9.5rem; resize: vertical; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--ink-faint); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--paper-card);
    border-color: var(--emerald-deep);
    box-shadow: 0 0 0 3px rgba(29, 198, 139, 0.14);
}
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C5349' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.6rem;
}
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.7rem;
    font-size: 0.87rem;
    line-height: 1.6;
    color: var(--ink-soft);
}
.checkbox-group input[type="checkbox"] {
    flex: none;
    width: 1.05rem; height: 1.05rem;
    margin-top: 0.25rem;
    accent-color: var(--emerald-deep);
    cursor: pointer;
}
.checkbox-group label { cursor: pointer; }
.checkbox-group a { color: var(--emerald-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Estado del envío: sustituye a los alert() y es anunciado por lectores de pantalla */
.form-status {
    display: none;
    margin-top: 1.2rem;
    padding: 0.95rem 1.15rem;
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: none;
    border-left: 2px solid var(--line-strong);
    background: var(--paper-warm);
    color: var(--ink-soft);
}
.form-status.is-visible { display: block; }
.form-status[data-estado="ok"] {
    border-left-color: var(--emerald-deep);
    color: var(--emerald-ink);
    background: rgba(29, 198, 139, 0.08);
}
.form-status[data-estado="error"] {
    border-left-color: #B4541F;
    color: #8A3F17;
    background: rgba(180, 84, 31, 0.07);
}
/* Trampa antispam: fuera de la vista pero no display:none, que los bots detectan */
.form-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none;
}
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
/* Formulario en línea (newsletter) */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    max-width: 34rem;
    margin: 2rem auto 0;
}
.form-inline input[type="email"] {
    flex: 1 1 16rem;
    padding: 0.95rem 1.1rem;
    font-size: 0.96rem;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--champagne-dim);
    border-radius: var(--radius);
}
.form-inline input[type="email"]:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(29, 198, 139, 0.2);
}
.form-inline .form-status { flex: 1 0 100%; }
.cta-section .form-status { background: rgba(250, 246, 240, 0.06); color: rgba(250, 246, 240, 0.85); text-align: left; }
.cta-section .form-status[data-estado="ok"] { color: var(--emerald); }

.map-section { padding: 0; line-height: 0; border-block: 1px solid var(--line); }
.map-section iframe { width: 100%; height: clamp(20rem, 40vh, 27rem); border: 0; filter: grayscale(1) contrast(1.05); transition: filter 0.8s var(--ease); }
.map-section:hover iframe { filter: grayscale(0); }

/* ---------- 22. PÁGINAS LEGALES ---------- */
.legal-content { padding-block: var(--section-y); background: var(--paper); }
.legal-box { max-width: 52rem; }
.legal-alert {
    padding: 1.6rem 1.8rem;
    margin-bottom: 3rem;
    background: var(--paper-warm);
    border-left: 2px solid var(--emerald-deep);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink-soft);
}
.legal-alert strong { color: var(--ink); }
.legal-box h2 {
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    margin: 3rem 0 1.1rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line);
}
.legal-box h2:first-of-type { margin-top: 0; }
.legal-box h3 { margin: 2rem 0 0.7rem; font-size: 1.05rem; }
.legal-box p { color: var(--ink-soft); margin-bottom: 1.1rem; max-width: none; }
.legal-box ul { margin: 0 0 1.5rem; }
.legal-box ul li {
    position: relative;
    padding-left: 1.3rem;
    margin-bottom: 0.6rem;
    color: var(--ink-soft);
    line-height: 1.7;
}
.legal-box ul li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.85em;
    width: 6px; height: 1px;
    background: var(--emerald-deep);
}
.legal-box strong { color: var(--ink); }
.legal-box a { color: var(--emerald-ink); text-decoration: underline; text-underline-offset: 2px; }
/* La tabla desborda en móvil: se desplaza dentro de su propio carril */
.table-scroll {
    margin: 1.5rem 0 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--line);
}
.legal-box table {
    width: 100%;
    min-width: 34rem;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.9rem;
}
.legal-box th, .legal-box td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.legal-box th {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--paper-warm);
    border-bottom-color: var(--line-strong);
}
.legal-box td { color: var(--ink-soft); }
.legal-box code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.86em;
    padding: 0.12em 0.4em;
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
}

/* ---------- 23. BLOG ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
}
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--paper-card);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.blog-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.blog-image { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-warm); }
.blog-image img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter 0.7s var(--ease), transform 0.9s var(--ease); }
.blog-card:hover .blog-image img { filter: grayscale(0); transform: scale(1.04); }
.blog-category {
    position: absolute;
    top: 1rem; left: 1rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: var(--onyx);
    color: var(--emerald);
}
.blog-content { display: flex; flex-direction: column; flex: 1; padding: 1.8rem; }
.blog-date {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.8rem;
}
.blog-content h3 { margin-bottom: 0.7rem; }
.blog-content p { font-size: 0.94rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.blog-link { margin-top: auto; align-self: flex-start; }

/* ---------- 24. PIE ---------- */
.footer {
    background: var(--onyx);
    color: rgba(250, 246, 240, 0.62);
    padding-block: clamp(3.5rem, 7vw, 5.5rem) 0;
    font-size: 0.93rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.footer-logo { margin-bottom: 1.4rem; }
.footer-col > p { line-height: 1.75; max-width: 30ch; }
.footer-col h4 {
    margin-bottom: 1.5rem;
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--champagne);
}
.footer-col ul li { margin-bottom: 0.7rem; }
.footer-col ul a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(250, 246, 240, 0.62);
    transition: color var(--transition-fast), gap var(--transition-fast);
}
.footer-col ul a:hover { color: var(--emerald); gap: 0.9rem; }
.footer-col ul i { font-size: 0.5rem; opacity: 0.55; }
.footer-social { display: flex; gap: 0.55rem; margin-top: 1.6rem; }
.footer-social a {
    width: 2.35rem; height: 2.35rem;
    display: grid; place-items: center;
    font-size: 0.82rem;
    color: rgba(250, 246, 240, 0.62);
    border: 1px solid var(--onyx-line);
    border-radius: 50%;
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}
.footer-social a:hover { color: var(--onyx); background: var(--emerald); border-color: var(--emerald); }
.footer-contact { display: flex; flex-direction: column; gap: 1.05rem; }
.footer-contact-item { display: flex; gap: 0.9rem; line-height: 1.65; }
.footer-contact-item i { flex: none; margin-top: 0.4rem; font-size: 0.85rem; color: var(--champagne); }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding-block: 1.6rem;
    border-top: 1px solid var(--onyx-line);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: rgba(250, 246, 240, 0.45);
}
.footer-bottom p { max-width: none; }
/* Crédito de autoría: presente pero por debajo del aviso legal en jerarquía */
.footer-credit {
    display: inline-block;
    margin-left: 0.9rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--onyx-line);
    color: rgba(250, 246, 240, 0.35);
}
.footer-credit a {
    color: rgba(250, 246, 240, 0.55);
    transition: color var(--transition-fast);
}
.footer-credit a:hover { color: var(--champagne); }
.footer-bottom-links { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.footer-bottom-links a { transition: color var(--transition-fast); }
.footer-bottom-links a:hover { color: var(--emerald); }

/* ---------- 24b. BOTÓN FLOTANTE DE WHATSAPP ---------- */
.whatsapp-float {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    display: grid;
    place-items: center;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    font-size: 1.9rem;
    box-shadow: 0 6px 20px rgba(5, 4, 0, 0.28);
    z-index: 9000;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.whatsapp-float:hover,
.whatsapp-float:focus-visible {
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 8px 26px rgba(5, 4, 0, 0.35);
}
@media (max-width: 767px) {
    .whatsapp-float {
        right: 1rem;
        bottom: 1rem;
        width: 3.2rem;
        height: 3.2rem;
        font-size: 1.7rem;
    }
}
@media print {
    .whatsapp-float { display: none !important; }
}

/* ---------- 25. COOKIES (inyectado por JS) ---------- */
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 10000;
    padding: 1.5rem 0;
    background: var(--onyx);
    color: rgba(250, 246, 240, 0.75);
    border-top: 1px solid var(--emerald);
    transform: translateY(110%);
    transition: transform 0.6s var(--ease);
}
.cookie-banner.active { transform: translateY(0); }
.cookie-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.cookie-banner-text { flex: 1 1 26rem; font-size: 0.88rem; line-height: 1.65; }
.cookie-banner-text strong { color: var(--paper); }
.cookie-banner-text a { color: var(--emerald); text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-cookie-accept, .btn-cookie-reject, .btn-cookie-settings {
    padding: 0.72rem 1.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.btn-cookie-accept { background: var(--emerald); color: var(--onyx); border-color: var(--emerald); }
.btn-cookie-accept:hover { background: var(--paper); border-color: var(--paper); }
.btn-cookie-reject, .btn-cookie-settings { background: transparent; color: rgba(250, 246, 240, 0.8); border-color: var(--onyx-line); }
.btn-cookie-reject:hover, .btn-cookie-settings:hover { border-color: var(--emerald); color: var(--emerald); }

.cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: grid;
    place-items: center;
    padding: var(--gutter);
    background: rgba(5, 4, 0, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}
.cookie-modal-backdrop.active { opacity: 1; visibility: visible; }
.cookie-modal {
    width: min(34rem, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateY(14px);
    transition: transform var(--transition);
}
.cookie-modal-backdrop.active .cookie-modal { transform: translateY(0); }
.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.8rem;
    border-bottom: 1px solid var(--line);
}
.cookie-modal-header h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; }
.cookie-modal-close { font-size: 1.6rem; line-height: 1; color: var(--ink-faint); transition: color var(--transition-fast); }
.cookie-modal-close:hover { color: var(--ink); }
.cookie-modal-body { padding: 1.8rem; overflow-y: auto; }
.cookie-modal-body > p { max-width: none; }
.cookie-modal-intro { font-size: 0.91rem; line-height: 1.7; color: var(--ink-soft); margin-bottom: 1.4rem; }
.badge-always { background: var(--emerald); color: var(--onyx); }
.cookie-switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.cookie-switch input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--emerald-deep); cursor: pointer; }
.cookie-switch span { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; }
.cookie-group { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.cookie-group p { font-size: 0.88rem; line-height: 1.65; color: var(--ink-soft); max-width: none; }
.cookie-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}
.cookie-group-header .badge {
    padding: 0.28rem 0.7rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
}
.cookie-modal-footer { padding: 1.3rem 1.8rem; border-top: 1px solid var(--line); background: var(--paper-warm); }

/* ---------- 26. MOVIMIENTO ---------- */
.animate-on-scroll { opacity: 1; }
html.js .animate-on-scroll {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
html.js .animate-on-scroll.visible { opacity: 1; transform: none; }

/* Escalonado en rejillas: la entrada se lee como una secuencia */
html.js .services-grid .animate-on-scroll:nth-child(2),
html.js .hero-features-grid .animate-on-scroll:nth-child(2),
html.js .values-grid .animate-on-scroll:nth-child(2),
html.js .pain-grid .animate-on-scroll:nth-child(2),
html.js .testimonial-grid .animate-on-scroll:nth-child(2),
html.js .blog-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.09s; }
html.js .services-grid .animate-on-scroll:nth-child(3),
html.js .hero-features-grid .animate-on-scroll:nth-child(3),
html.js .values-grid .animate-on-scroll:nth-child(3),
html.js .pain-grid .animate-on-scroll:nth-child(3),
html.js .testimonial-grid .animate-on-scroll:nth-child(3),
html.js .blog-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.18s; }
html.js .services-grid .animate-on-scroll:nth-child(4),
html.js .hero-features-grid .animate-on-scroll:nth-child(4),
html.js .values-grid .animate-on-scroll:nth-child(4),
html.js .pain-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.27s; }
html.js .services-grid .animate-on-scroll:nth-child(5),
html.js .pain-grid .animate-on-scroll:nth-child(5) { transition-delay: 0.36s; }
html.js .services-grid .animate-on-scroll:nth-child(6),
html.js .pain-grid .animate-on-scroll:nth-child(6) { transition-delay: 0.45s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html.js .animate-on-scroll { opacity: 1; transform: none; }
}

/* ---------- 27. RESPONSIVE ---------- */
@media (max-width: 1080px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 992px) {
    /* El menú horizontal deja de caber antes de los 768px: colapsa ya aquí */
    .mobile-toggle { display: grid; }
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.75rem var(--gutter) 1.5rem;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.5s var(--ease), opacity var(--transition-fast), visibility var(--transition-fast);
    }
    .nav-menu.active { max-height: 32rem; opacity: 1; visibility: visible; overflow-y: auto; }
    .nav-menu > li { border-bottom: 1px solid var(--line); }
    .nav-menu > li:last-child { border-bottom: 0; }
    .nav-menu a { display: block; padding: 1rem 0.25rem; }
    .nav-menu a::after { display: none; }
    .nav-cta-pill {
        margin-top: 1rem;
        text-align: center;
        padding: 0.95rem 1.5rem !important;
    }
    .nav-dropdown > a { display: flex !important; align-items: center; justify-content: space-between; }

    .nav-submenu {
        position: static;
        min-width: 0;
        padding: 0 0 0.5rem 1rem;
        background: transparent;
        border: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    .nav-dropdown[data-open="true"] .nav-submenu { display: block; }
    .nav-dropdown:hover .nav-submenu:not([data-open]) { display: none; }
    .nav-dropdown[data-open="true"] .nav-submenu { display: block; }
    .nav-submenu a { padding: 0.7rem 0.25rem; opacity: 0.85; }

    .about-grid,
    .branch-intro,
    .branch-location,
    .contact-grid { grid-template-columns: 1fr; }
    .about-image { max-width: 30rem; }
    .about-image-overlay { right: 1.5rem; }
    .hero-features-grid,
    .values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-feature-card { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 768px) {
    .top-bar-content { justify-content: center; text-align: center; }
    .top-bar-info { gap: 1.1rem; justify-content: center; font-size: 0.68rem; }


    /* El numeral se mantiene arriba a la derecha, junto al overline.
       Solo el overline cede espacio: el titular usa el ancho completo. */
    /* El titular ocupa todo el ancho: más velo por la derecha */
    .hero,
    .branch-hero-madrid,
    .branch-hero-levante { --veil-b: 0.93; --veil-c: 0.84; }

    .section-header { padding-right: 0; }
    .section-header .overline { padding-right: 3.5rem; }
    .section-header::after { top: -0.5rem; font-size: 2rem; }

    .services-grid,
    .pain-grid,
    .values-grid,
    .hero-features-grid,
    .testimonial-grid,
    .branch-showcase-grid,
    .branch-cards { grid-template-columns: 1fr; }
    .service-card { padding-right: 0; }
    .service-card h3 { padding-right: 3rem; }
    .service-card::before { right: 0; }

    .form-row { grid-template-columns: 1fr; gap: 0; }
    .hero-buttons, .cta-buttons { flex-direction: column; align-items: stretch; }
    .hero-buttons .btn, .cta-buttons .btn,
    .hero-buttons .btn-hero-primary, .hero-buttons .btn-hero-secondary { width: 100%; }

    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-bottom-links { justify-content: center; gap: 1.1rem; }

    .location-panel { flex-direction: column; align-items: flex-start; gap: 1.1rem; }
    .about-image-overlay { right: 1rem; bottom: 1rem; padding: 1.1rem 1.3rem; }
    .about-image-overlay .years { font-size: 2.2rem; }

    .cookie-banner-content { flex-direction: column; align-items: stretch; gap: 1.2rem; }
    .cookie-banner-actions .btn-cookie-accept,
    .cookie-banner-actions .btn-cookie-reject,
    .cookie-banner-actions .btn-cookie-settings { flex: 1 1 auto; }
}

@media (max-width: 480px) {
    .top-bar-info span:nth-child(3) { display: none; }
    .testimonial-card::before { font-size: 4rem; }
}

/* ---------- 28. IMPRESIÓN ---------- */
@media print {
    body::before, .top-bar, .navbar, .cookie-banner, .cookie-modal-backdrop, .cta-section, .map-section { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .hero, .page-hero, .legal-header, .footer, .section-primary { background: #fff !important; color: #000 !important; }
    .hero h1, .page-hero h1, .legal-header h1 { color: #000 !important; }
    a { text-decoration: underline; }
}
