/* ==========================================================================
   Royal Ingeniería — sitio web
   Estilos compartidos por todas las páginas; lo propio de cada una va en css/pages/.
   1. Variables  2. Base  3. Utilidades  4. Componentes  5. Secciones
   6. Movimiento (transiciones, aparición al hacer scroll)  7. Responsive
   ========================================================================== */

/* 1. Variables ------------------------------------------------------------ */
:root {
    --red: #BF0021;
    --red-dark: #9E001B;
    --ink: #57575A;
    --muted: #727176;
    --line: #ECECEC;
    --line-strong: #D9D9D9;
    --soft: #F5F5F5;
    --placeholder: #F0F0F0;
    --placeholder-dark: #E6E6E6;
    --square-off: #E2E2E2;
    --night: #231F20;
    --night-line: #3D393A;
    --white: #FFFFFF;
    --green: #1E6B45; /* estados "cumple" o "vigente" y siembra de árboles */

    --font: "Montserrat", "Gotham", Arial, sans-serif;
    --container: 1440px;
    --gutter: 24px;
    --radius: 6px;
    --radius-sm: 4px;
    --header-h: 67px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --fast: 180ms;
    --medium: 420ms;
    --slow: 800ms;
}

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--white);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

/* Lo que entra de lado (data-reveal="right") no ensancha la página antes de aparecer. */
main { overflow-x: clip; }

/* Los filtros esconden con el atributo hidden; ningún display de componente lo pisa. */
[hidden] { display: none !important; }

a {
    color: var(--ink);
    text-decoration: none;
    transition: color var(--fast) ease;
}
a:hover { color: var(--red); }

:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
    border-radius: 2px;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); font-weight: 700; }
strong { font-weight: 600; color: var(--ink); }

/* Anchors land below the sticky header */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
.has-subnav [id] { scroll-margin-top: calc(var(--header-h) + 72px); }

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--red);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: top var(--fast) ease;
}
.skip-link:focus { top: 12px; color: var(--white); }

/* 3. Utilidades ---------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    /* Mismo margen que el header, para que el contenido arranque a la altura del logo. */
    padding-left: clamp(var(--gutter), 3vw, 48px);
    padding-right: clamp(var(--gutter), 3vw, 48px);
}

.stack { display: flex; flex-direction: column; }
.muted { color: var(--muted); }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.grid-auto {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(var(--min, 300px), 1fr));
}

/* 4. Componentes --------------------------------------------------------- */

/* Los tres cuadros de la marca */
.squares { display: inline-flex; gap: 4px; flex: none; }
.squares > span { width: 8px; height: 8px; background: var(--red); }
.squares--lg { gap: 5px; }
.squares--lg > span { width: 12px; height: 12px; }
.squares--md { gap: 5px; }
.squares--md > span { width: 14px; height: 14px; }
.squares--sm { gap: 3px; }
.squares--sm > span { width: 9px; height: 9px; }
.squares > span.off { background: var(--square-off); }
.squares--white > span { background: var(--white); }

/* Rótulo de sección */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--red);
}
.eyebrow--plain { color: var(--muted); }
.eyebrow--white { color: var(--white); }

.label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Títulos */
.display {
    font-size: clamp(36px, 4.6vw, 62px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.display--sm { font-size: clamp(34px, 4.6vw, 54px); }
.title {
    font-size: clamp(28px, 3.4vw, 42px);
    line-height: 1.12;
}
.title--sm { font-size: clamp(26px, 3vw, 38px); line-height: 1.15; }
.title--xs { font-size: clamp(24px, 2.8vw, 34px); line-height: 1.2; }
.lead { font-size: 19px; color: var(--muted); }

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    background: transparent;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background-color var(--fast) ease,
        border-color var(--fast) ease,
        color var(--fast) ease,
        transform var(--fast) var(--ease),
        box-shadow var(--medium) var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn svg { transition: transform var(--medium) var(--ease); }
.btn:hover svg.arrow { transform: translateX(4px); }

.btn--primary { background: var(--red); color: var(--white); }
.btn--primary:hover {
    background: var(--red-dark);
    color: var(--white);
    box-shadow: 0 10px 24px -12px rgba(191, 0, 33, 0.6);
    transform: translateY(-1px);
}
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--white); }
.btn--outline-white { border-color: var(--white); color: var(--white); }
.btn--outline-white:hover { background: var(--white); color: var(--ink); }
.btn--white { background: var(--white); color: var(--ink); font-weight: 700; }
.btn--white:hover { color: var(--red); transform: translateY(-1px); box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.45); }
.btn--sm { min-height: 44px; padding: 10px 18px; font-size: 14px; }
.btn--md { min-height: 46px; padding: 12px 22px; }

/* Tarjetas */
.card {
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition:
        transform var(--medium) var(--ease),
        box-shadow var(--medium) var(--ease),
        border-color var(--medium) ease;
}
.card--line { border: 1px solid var(--line); background: var(--white); }
.card--white { background: var(--white); }
.card--soft { background: var(--soft); }
.card--sm { padding: 22px; gap: 6px; }
.card--md { padding: 24px; gap: 6px; }
a.card, .card--hover { color: var(--ink); }
a.card:hover, .card--hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px -24px rgba(35, 31, 32, 0.35);
}
.card--line.card--hover:hover { border-color: var(--line-strong); }

/* Listas con cuadro */
.ticks {
    margin: 0;
    padding: 14px 0 0;
    list-style: none;
    border-top: 1px solid var(--placeholder);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
}
.ticks li, .ticks a { display: flex; gap: 10px; align-items: center; }
.ticks li::before, .ticks a::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--red);
    flex: none;
}
.ticks li:has(> a)::before { display: none; }
.ticks a { color: var(--ink); width: 100%; }
.ticks a svg { margin-left: auto; transition: transform var(--medium) var(--ease); }
.ticks a:hover svg { transform: translateX(4px); }

.bullets {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Espacio para foto */
.photo-ph {
    border-radius: var(--radius);
    background: var(--placeholder);
    color: var(--muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 16px;
    overflow: hidden;
    position: relative;
}
.photo-ph--dark { background: var(--placeholder-dark); font-size: 13px; }
.photo-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Cifras */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat__value {
    font-weight: 800;
    font-size: 40px;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.stat__value--red { color: var(--red); }
.stat__value--xl { font-size: 52px; }
.stat__value--lg { font-size: 36px; line-height: 1.1; }
.stat__value--md { font-size: 28px; line-height: 1.1; }
.stat__label { font-size: 14px; font-weight: 500; }
.stat__label--muted { font-size: 13px; font-weight: 400; color: var(--muted); }

/* Etiquetas */
.tag {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    font-size: 14px;
    font-weight: 500;
}

/* Filtros (proyectos y materiales) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--line-strong);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: var(--white); font-weight: 600; }
.chips--dark .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }

/* Encabezado de sección */
.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}
.section-head__text { display: flex; flex-direction: column; gap: 12px; max-width: 680px; }

/* 5. Secciones ----------------------------------------------------------- */

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    transition: box-shadow var(--medium) ease;
    view-transition-name: site-header;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(35, 31, 32, 0.35); }
/* A todo el ancho: logo al inicio, menú al centro y Ingresar/Comprar al final */
.site-header__inner {
    padding: 12px clamp(var(--gutter), 3vw, 48px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 20px;
    transition: padding var(--medium) var(--ease);
}
.site-header.is-scrolled .site-header__inner { padding-top: 8px; padding-bottom: 8px; }
.brand { flex: none; justify-self: start; }
.brand img { height: 42px; width: auto; transition: height var(--medium) var(--ease); }
.site-header.is-scrolled .brand img { height: 36px; }

.main-nav { display: contents; font-size: 14px; font-weight: 500; }
.main-nav__links { display: flex; align-items: center; gap: 14px; }
.main-nav__actions { display: flex; align-items: center; gap: 12px; justify-self: end; }
.main-nav a { color: var(--ink); }
.main-nav a:hover { color: var(--red); }
.nav-link, .dd-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; position: relative; }
.nav-link[data-current], .dd[data-current] > .dd-btn { color: var(--red); font-weight: 600; }
.dd > .dd-btn:not(.nav-login):not(.nav-buy)::after, .nav-link:not(.nav-verify)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--medium) var(--ease);
}
.dd:hover > .dd-btn::after, .nav-link:hover::after,
.dd[data-current] > .dd-btn::after, .nav-link[data-current]::after { transform: scaleX(1); transform-origin: left; }
.chev { transition: transform var(--medium) var(--ease); }
.dd:hover .chev, .dd:focus-within .chev, .dd.is-open .chev { transform: rotate(180deg); }

.nav-verify > span { display: inline-flex; flex-direction: column; line-height: 1.15; }
.nav-verify small { font-size: 12px; font-weight: 500; color: var(--muted); }
.nav-login { padding: 8px 12px; border: 1.5px solid var(--red); border-radius: var(--radius-sm); color: var(--red) !important; font-weight: 700; transition: background-color var(--fast) ease, color var(--fast) ease; }
.nav-login:hover { background: var(--red); color: var(--white) !important; }
.nav-buy { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--red); color: var(--white) !important; font-weight: 700; transition: background-color var(--fast) ease, box-shadow var(--medium) var(--ease); }
.nav-buy:hover { background: var(--red-dark); box-shadow: 0 10px 24px -12px rgba(191, 0, 33, 0.6); }

/* Submenús: aparecen con un deslizamiento corto al pasar el mouse o con el teclado */
.dd { position: relative; display: inline-flex; }
.dd-menu {
    position: absolute;
    top: 100%;
    left: -18px;
    min-width: 250px;
    padding: 8px 0;
    background: var(--white);
    border: 1px solid var(--line);
    border-top: 3px solid var(--red);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 12px 28px rgba(35, 31, 32, 0.12);
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--fast) ease, transform var(--medium) var(--ease), visibility 0s linear var(--medium);
}
.dd:hover .dd-menu, .dd:focus-within .dd-menu, .dd.is-open .dd-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--fast) ease, transform var(--medium) var(--ease), visibility 0s;
}
.dd-menu--right { left: auto; right: 0; }
.dd-menu a { display: block; padding: 12px 22px; font-weight: 500; white-space: nowrap; transition: background-color var(--fast) ease, color var(--fast) ease, padding var(--medium) var(--ease); }
.dd-menu a:hover { background: var(--soft); color: var(--red); padding-left: 26px; }
.dd-h { display: block; padding: 12px 22px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
}
.nav-toggle span {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 2px;
    background: var(--ink);
    transition: transform var(--medium) var(--ease), opacity var(--fast) ease;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Botones flotantes: WhatsApp a la derecha, Volver a la izquierda */
.float-btn {
    position: fixed;
    bottom: 20px;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 6px 20px 6px 6px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(35, 31, 32, 0.18);
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    transition: transform var(--medium) var(--ease), box-shadow var(--medium) var(--ease);
    animation: float-in 700ms var(--ease) 600ms both;
}
.float-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(35, 31, 32, 0.24); color: var(--ink); }
.float-btn--wa { right: 20px; }
.float-btn--back { left: 20px; min-height: 52px; padding: 4px 18px 4px 4px; font-size: 14px; }
.float-btn__icon { width: 44px; height: 44px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--white); }
.float-btn--wa .float-btn__icon { background: #25D366; }
.float-btn--back .float-btn__icon { background: var(--ink); }
.float-btn--back .float-btn__text { display: inline-flex; flex-direction: column; line-height: 1.15; }
.float-btn--back small { font-size: 12px; font-weight: 500; color: var(--muted); }
@keyframes float-in { from { opacity: 0; transform: translateY(16px) scale(0.92); } }

/* Secciones */
.section { padding-top: 96px; padding-bottom: 96px; }
.section--sm { padding-top: 72px; padding-bottom: 72px; }
.section--md { padding-top: 88px; padding-bottom: 88px; }
.band-soft { background: var(--soft); }
.band-ink { background: var(--ink); color: var(--white); }
.band-ink h2, .band-ink h3 { color: var(--white); }

/* Hero */
.hero { padding-top: 80px; padding-bottom: 64px; display: flex; flex-wrap: wrap; gap: 56px; align-items: stretch; }
.hero__text { flex: 1 1 500px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.hero__aside { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hero__claim { font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; letter-spacing: 0.01em; color: var(--red); }
.hero__intro { font-size: 19px; color: var(--muted); max-width: 600px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.page-hero {
    padding-top: 80px;
    padding-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px 48px;
    align-items: flex-end;
    justify-content: space-between;
}
.page-hero__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.page-hero__intro { flex: 1 1 340px; min-width: 0; color: var(--muted); font-size: 17px; }

.services-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.services-box .label { padding-bottom: 8px; }
.services-box__row { display: flex; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--placeholder); }
.services-box__row > span:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.services-box__row b { font-weight: 700; }
.services-box__row small { font-size: 13px; color: var(--muted); }
.services-box__cta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--red);
    color: var(--white);
    font-weight: 700;
}
.services-box__cta:hover { color: var(--white); background: var(--red-dark); }
.services-box__cta svg { transition: transform var(--slow) var(--ease); }
.services-box__cta:hover svg { transform: rotate(-180deg); }

/* Banda de cifras */
.stats-band { background: var(--soft); }
.stats-band .container { padding-top: 40px; padding-bottom: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px; }

/* Servicios */
.service-num { font-weight: 800; font-size: 14px; letter-spacing: 0.1em; color: var(--red); }
.service-title { font-size: 22px; line-height: 1.25; }
.service-text { color: var(--muted); font-size: 15px; }

/* Productos R */
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.split__main { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.split__side { flex: 1 1 400px; min-width: 0; }
.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    border-top: 1px solid var(--square-off);
    padding-top: 32px;
}
.benefit { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.benefit svg { flex: none; margin-top: 2px; color: var(--red); }

/* Nosotros */
.statement {
    border-left: 3px solid var(--red);
    background: var(--soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 30px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.statement--ink { border-left-color: var(--ink); }
.statement p { font-weight: 500; font-size: 19px; line-height: 1.5; }
.statement .label { color: var(--red); letter-spacing: 0.16em; }
.statement--ink .label { color: var(--ink); }

/* Proyectos */
.project { display: flex; flex-direction: column; gap: 14px; }
.project .photo-ph { height: 220px; transition: transform var(--slow) var(--ease); }
.project:hover .photo-ph { transform: scale(1.02); }
.project__tag { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--red); }
.band-ink .project .photo-ph { background: #6A6A6D; color: var(--square-off); }
.band-ink .project__tag { color: var(--square-off); font-weight: 600; }
.project h3 { font-size: 19px; }
.projects-page .project .photo-ph { height: 240px; }
.projects-page .project h2 { font-size: 20px; line-height: 1.3; }

/* Reconocimientos */
.award { border-top: 3px solid var(--red); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.award--pending { border-top-style: dashed; border-top-color: #B5B5B8; }
.award b { font-weight: 700; font-size: 17px; }
.award span { font-size: 14px; color: var(--muted); }

/* Novedades */
.news { background: var(--white); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.news .photo-ph { height: 180px; border-radius: 0; background: var(--placeholder-dark); font-size: 13px; }
.news__body { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.news__meta { font-size: 13px; font-weight: 500; color: var(--muted); }
.news h3 { font-size: 19px; line-height: 1.3; }

/* Contacto */
.contact { display: flex; flex-wrap: wrap; gap: 56px; }
.contact__text { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.contact__mail { display: inline-flex; gap: 12px; align-items: center; font-size: 18px; font-weight: 600; }
.contact-form {
    flex: 1 1 460px;
    min-width: 0;
    background: var(--soft);
    border-radius: var(--radius);
    padding: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field--full, .contact-form .btn, .contact-form__note { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    background: var(--white);
    transition: border-color var(--fast) ease, box-shadow var(--fast) ease;
}
.field textarea { padding: 12px 14px; resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(87, 87, 90, 0.12);
}
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--red); }
.consent { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--red); flex: none; }
.consent.is-invalid { color: var(--red); }
.contact-form .btn { height: 52px; font-weight: 700; letter-spacing: 0.04em; }
.contact-form__note { font-size: 13px; color: var(--muted); min-height: 1em; }

/* Footer */
.site-footer { background: var(--night); color: var(--line-strong); }
.site-footer a { color: var(--line-strong); }
.site-footer a:hover { color: var(--white); }
.site-footer__grid { padding-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; font-size: 14px; }
.site-footer__grid nav, .site-footer__grid > div { display: flex; flex-direction: column; gap: 8px; }
.site-footer__grid .site-footer__brand { gap: 16px; }
.site-footer__title { color: var(--white); font-weight: 700; }
.site-footer__logo { height: 46px; width: auto; align-self: flex-start; }
.site-footer__bottom { margin-top: 40px; padding: 20px 0 32px; border-top: 1px solid var(--night-line); font-size: 13px; color: #B5B5B8; }
.site-footer--compact .container { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; font-size: 14px; }
.site-footer--compact img { height: 40px; width: auto; }

/* Sostenibilidad */
.badge-note {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    background: var(--soft);
    font-size: 13px;
    font-weight: 600;
}
.badge-note::before { content: ""; flex: none; width: 8px; height: 8px; background: var(--red); }

.subnav {
    position: sticky;
    top: var(--header-h);
    z-index: 40;
    background: var(--white);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: top var(--medium) var(--ease);
}
/* Submenú de las páginas de Nosotros (Quiénes somos, Noticias, Proyectos, Trabaja con nosotros) */
.ab-subnav { background: var(--soft); border-bottom: 1px solid var(--line); }
.ab-subnav .container { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; font-size: 15px; }
.ab-subnav .container::-webkit-scrollbar { display: none; }
.ab-subnav a { flex: none; min-height: 48px; display: inline-flex; align-items: center; border-bottom: 3px solid transparent; font-weight: 500; color: var(--muted); transition: color var(--fast) ease, border-color var(--medium) var(--ease); }
.ab-subnav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.ab-subnav a[aria-current="page"] { border-bottom-color: var(--red); font-weight: 700; color: var(--ink); }
.ab-h1 { font-size: clamp(32px, 4.2vw, 50px); line-height: 1.1; }

.subnav .container { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; font-size: 15px; font-weight: 500; }
.subnav .container::-webkit-scrollbar { display: none; }
.subnav a { position: relative; padding: 14px 12px; white-space: nowrap; }
.subnav a::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    background: var(--red);
    transform: scaleX(0);
    transition: transform var(--medium) var(--ease);
}
.subnav a.is-active { color: var(--red); }
.subnav a.is-active::after { transform: scaleX(1); }

.pillar { border-top: 3px solid var(--red); padding: 24px; gap: 10px; }
.pillar__num { font-weight: 800; font-size: 14px; color: var(--red); }
.pillar__name { font-weight: 700; font-size: 18px; }
.pillar__text { font-size: 14px; color: var(--muted); }

.esg-head { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.esg-cols { display: flex; flex-wrap: wrap; gap: 32px; }
.esg-cols__main { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.esg-cols__side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.do-item { border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; }
.do-item b { font-weight: 600; }
.do-item span { font-size: 15px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi { border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi--wide { grid-column: span 2; padding: 22px; }
.status { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--red); }
.status--pending { color: var(--muted); }

.timeline { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.timeline li { border-top: 3px solid var(--ink); padding: 18px 20px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.timeline li b { font-weight: 700; }
.timeline li span { color: var(--muted); }
.timeline li.is-now { border-top-color: var(--red); }
.timeline li.is-now b { color: var(--red); }
.timeline li.is-next { border-top: 3px dashed #B5B5B8; }
.timeline li.is-next b { color: var(--muted); }

.logo-ph { width: 64px; height: 64px; border-radius: var(--radius-sm); background: var(--placeholder); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }

.policies { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.policy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    transition: background-color var(--medium) ease, padding var(--medium) var(--ease);
}
.policy:hover { background: var(--soft); padding-left: 12px; padding-right: 12px; }
.policy svg { color: var(--red); flex: none; }
.policy__text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.policy__text b { font-weight: 600; font-size: 17px; }
.policy__text span { font-size: 14px; color: var(--muted); }
.policy__code { font-size: 13px; color: var(--muted); min-width: 120px; }

.banner {
    border-radius: var(--radius);
    padding: 48px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
    align-items: center;
    justify-content: space-between;
}
.banner--ink { background: var(--ink); color: var(--white); }
.banner--red { background: var(--red); color: var(--white); }
.banner h2 { color: var(--white); }
.banner__text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.banner__text p { color: var(--square-off); }

/* Materiales */
.tabs { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.material { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; gap: 20px; align-items: flex-start; }
.material img { width: 104px; height: 104px; object-fit: cover; border-radius: var(--radius-sm); flex: none; transition: transform var(--slow) var(--ease); }
.material:hover img { transform: scale(1.05) rotate(-1deg); }
.material__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.material__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.material__cat { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--red); }
.material__ref { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.material h2 { font-size: 21px; line-height: 1.25; }
.material p { font-size: 15px; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill { padding: 4px 10px; border-radius: 3px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 500; }
.pill--dark { background: var(--ink); border-color: var(--ink); color: var(--white); font-weight: 600; }
.pills__label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); padding-right: 4px; }
.specs { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-top: 4px; font-size: 13px; }
.specs span span { color: var(--muted); }

/* Galería */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 180px; gap: 12px; }
.gallery .photo-ph { background: var(--placeholder-dark); font-size: 13px; }
.gallery .span-2 { grid-column: span 2; }
.gallery .span-2x2 { grid-column: span 2; grid-row: span 2; }

.clients { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.client {
    height: 76px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
    transition: color var(--fast) ease, border-color var(--fast) ease;
}
.client:hover { color: var(--ink); border-color: var(--line-strong); }

/* Componentes compartidos de la versión 2 ----------------------------------- */
.card__cta { margin-top: auto; }
.link-more { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--red); }
.link-more span { transition: transform var(--medium) var(--ease); }
.link-more:hover span { transform: translateX(4px); }
.also-note { padding-top: 28px; border-top: 1px solid var(--line); color: var(--muted); }
.also-note a { color: var(--ink); font-weight: 600; text-decoration: underline; }

.news__img { height: 230px; overflow: hidden; }
.news__img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--slow) var(--ease); }
.news:hover .news__img img { transform: scale(1.04); }
.news--soft { background: var(--soft); }

.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.steps li { display: flex; flex-direction: column; gap: 10px; }
.steps b { font-size: 19px; }
.steps li > span:last-child { font-size: 15px; color: var(--muted); }
.steps__num { font-weight: 800; font-size: 44px; line-height: 1; color: var(--red); }

.award__logo { height: 44px; width: auto; max-width: 160px; object-fit: contain; }

.seal-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); transition: border-color var(--fast) ease, box-shadow var(--medium) var(--ease); }
.seal-pill:hover { border-color: var(--line-strong); box-shadow: 0 8px 20px -14px rgba(35, 31, 32, 0.4); }
.seal-pill img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.seal-pill span { display: flex; flex-direction: column; line-height: 1.2; }
.seal-pill b { font-size: 12px; font-weight: 700; color: var(--ink); }
.seal-pill small { font-size: 11px; color: var(--muted); }

/* La foto ocupa todo el alto del texto en vez de quedar como una tarjeta centrada. */
.hero__media { flex: 1 1 440px; min-width: 0; display: flex; }
.hero__media img { flex: 1; width: 100%; height: auto; min-height: 460px; object-fit: cover; object-position: 60% 50%; border-radius: var(--radius); }
/* Debajo de ~1100px la foto pasa abajo del texto: alto fijo para que no crezca a todo el ancho. */
@media (max-width: 1099px) { .hero__media img { height: 420px; min-height: 0; } }

/* 6. Movimiento ---------------------------------------------------------- */

/* Paso entre páginas: el header se queda quieto y el contenido se funde y sube.
   Navegadores sin soporte simplemente cambian de página como siempre. */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: page-out 260ms var(--ease-in-out) both; }
::view-transition-new(root) { animation: page-in 520ms var(--ease) both; }
::view-transition-group(site-header) { animation-duration: 0s; }

@keyframes page-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }

/* Aparición al hacer scroll: solo si hay JavaScript (html.js), para que sin él se vea todo. */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity var(--slow) var(--ease),
        transform var(--slow) var(--ease);
    transition-delay: var(--delay, 0ms);
}
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="left"] { transform: translateX(-28px); }
.js [data-reveal="right"] { transform: translateX(28px); }
.js [data-reveal="zoom"] { transform: scale(0.96); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* La portada entra en cascada al cargar */
.js .hero [data-reveal], .js .page-hero [data-reveal] { transition-duration: 1s; }

/* Los cuadros de la marca se encienden uno a uno */
.js .squares--lg.is-visible > span, .js .eyebrow.is-visible .squares > span {
    animation: square-in 600ms var(--ease) both;
}
.js .squares--lg.is-visible > span:nth-child(2), .js .eyebrow.is-visible .squares > span:nth-child(2) { animation-delay: 120ms; }
.js .squares--lg.is-visible > span:nth-child(3), .js .eyebrow.is-visible .squares > span:nth-child(3) { animation-delay: 240ms; }
@keyframes square-in { from { opacity: 0; transform: translateY(-10px) scale(0.6); } }

/* Filtros: lo que entra aparece suave */
.is-filtering-in { animation: filter-in 460ms var(--ease) both; animation-delay: var(--delay, 0ms); }
@keyframes filter-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* Menú móvil */
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }

/* Quien pide menos movimiento no ve animaciones */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 1ms !important;
        animation-delay: 0ms !important;
        transition-duration: 1ms !important;
        transition-delay: 0ms !important;
    }
    .js [data-reveal] { opacity: 1; transform: none; }
    @view-transition { navigation: none; }
}

/* 7. Responsive ---------------------------------------------------------- */
@media (max-width: 1279px) {
    .site-header__inner { display: flex; justify-content: space-between; }
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 8px var(--gutter) 24px;
        background: var(--white);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 18px 30px -24px rgba(35, 31, 32, 0.4);
        font-size: 15px;
    }
    .nav-open .main-nav { display: flex; animation: menu-in 320ms var(--ease) both; }
    .main-nav__links, .main-nav__actions { flex-direction: column; align-items: stretch; gap: 0; }
    .dd { display: block; border-bottom: 1px solid var(--placeholder); }
    .nav-link { border-bottom: 1px solid var(--placeholder); }
    .dd-btn, .nav-link { width: 100%; justify-content: space-between; }
    .nav-verify { justify-content: flex-start; gap: 10px; }
    .nav-verify > span { flex-direction: row; gap: 6px; align-items: baseline; }
    .dd > .dd-btn::after, .nav-link::after { display: none; }
    .dd-menu {
        position: static;
        display: none;
        min-width: 0;
        padding: 0 0 8px;
        border: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }
    .dd:hover .dd-menu, .dd:focus-within .dd-menu { display: none; }
    .dd.is-open .dd-menu { display: block; animation: menu-in 280ms var(--ease) both; }
    .dd-menu a { padding: 10px 14px; }
    .dd:hover .chev, .dd:focus-within .chev { transform: none; }
    .dd.is-open .chev { transform: rotate(180deg); }
    .nav-login, .nav-buy { margin-top: 12px; justify-content: center; }
    .dd[data-nav="portal"], .dd[data-nav="comprar"] { border-bottom: 0; }
}

@media (max-width: 720px) {
    /* El botón flotante de WhatsApp no tapa el copyright al final de la página */
    .site-footer__bottom { padding-bottom: 96px; }
    :root { --gutter: 16px; }
    .section, .section--md { padding-top: 64px; padding-bottom: 64px; }
    .section--sm { padding-top: 48px; padding-bottom: 48px; }
    .hero, .page-hero { padding-top: 48px; }
    .card, .contact-form { padding: 24px; }
    .banner { padding: 32px 24px; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; }
    .material { flex-direction: column; }
    .material img { width: 100%; height: 160px; }
    .stat__value--xl { font-size: 44px; }
    .hero__media img { height: 280px; min-height: 0; }
    .float-btn { min-height: 52px; padding-right: 16px; font-size: 14px; }
    .float-btn--back .float-btn__text { display: none; }
    .float-btn--back { padding: 4px; }
    .kpi--wide .stat__value--lg { font-size: 30px; }
}
