/* ══════════════════════════════════════════
   NOSOTROS v5.0
   ══════════════════════════════════════════ */

/* ── SHARED HEADING WRAPPER ── */
.nos-hd {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.nos-hd .sec-h2 { margin-bottom: 0; }
.nos-hd .sec-lbl { margin-bottom: 0; }
.nos-hd-sub {
    font-size: .97rem;
    font-weight: 300;
    color: var(--nc-light);
    max-width: 64ch;
    line-height: 1.7;
    text-wrap: pretty;
}

/* ── HERO ── */
.hero-nos {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 0 4rem 6rem;
    overflow: hidden;
    margin-top: 66px;
}
.hn-bg {
    position: absolute;
    inset: 0;
}
.hn-bg img,
.hn-bg picture {
    width: 100%;
    height: 100%;
    display: block;
}
.hn-bg img {
    object-fit: cover;
    filter: brightness(.5) saturate(.62);
}
.hn-ov {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(10,10,10,.9) 0%, rgba(10,10,10,.45) 55%, rgba(10,10,10,0) 100%),
        linear-gradient(to top, rgba(10,10,10,.78) 0%, transparent 50%);
}
.hn-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
}
.hero-nos .hero-h1 {
    font-size: clamp(2.8rem, 6vw, 5.8rem);
}

.hn-p {
    font-size: 1rem;
    font-weight: 300;
    color: var(--nc-light);
    line-height: 1.65;
    max-width: 600px;
    margin-bottom: 2.5rem;
    text-wrap: pretty;
}
.hn-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.hn-btns .btn-g {
    padding: .85rem 1.8rem;
    border: 1px solid var(--nc-steel);
    transition: color .2s, border-color .2s;
}
.hn-btns .btn-g:hover {
    border-color: var(--nc-ash);
    gap: .7rem;
}

/* ── STATS ── */
.stats-nos {
    background: var(--nc-black);
    border-top: 1px solid var(--nc-steel);
    border-bottom: 1px solid var(--nc-steel);
    padding: 0 4rem;
}
.sn-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.sn-item {
    padding: 4.5rem 0 4.5rem 3rem;
    border-right: 1px solid var(--nc-steel);
    position: relative;
    overflow: hidden;
    transition: background .3s;
}
.sn-item:last-child { border-right: none; }
.sn-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--nc-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .55s var(--expo);
}
.sn-item:hover::before { transform: scaleX(1); }
.sn-item:hover { background: rgba(255,255,255,.015); }
.sn-num {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: clamp(3.2rem, 4.5vw, 5rem);
    color: var(--nc-white);
    letter-spacing: -.02em;
    line-height: 1;
    margin-bottom: .65rem;
    display: flex;
    align-items: baseline;
    gap: .2rem;
}
.sn-num em {
    color: var(--nc-red-hot);
    font-style: normal;
    font-weight: 900;
    font-size: clamp(1.1rem, 1.6vw, 1.6rem);
}
.sn-label {
    font-family: var(--font-m);
    font-size: .62rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--nc-ash);
}
.sn-desc {
    font-size: .8rem;
    font-weight: 300;
    color: var(--nc-ash);
    line-height: 1.5;
    margin-top: .45rem;
}

/* ── QUÉ HACEMOS ── */
.qh-sec {
    background: var(--nc-carbon);
    border-bottom: 1px solid var(--nc-steel);
}
.qh-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}
.qh-intro .nos-hd { margin-bottom: 0; }

.qh-areas {
    display: flex;
    flex-direction: column;
}
.qh-area {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 1.25rem;
    align-items: start;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--nc-steel);
    position: relative;
    transition: padding-left .3s var(--expo);
}
.qh-area:first-child {
    border-top: 1px solid var(--nc-steel);
}
.qh-area::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: transparent;
    transition: background .3s;
}
.qh-area:hover { padding-left: .65rem; }
.qh-area:hover::before { background: var(--nc-red); }
.qh-n {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: 2.8rem;
    color: var(--nc-ash);
    opacity: .7;
    line-height: 1;
    transition: color .3s, opacity .3s;
    margin-top: -.2rem;
}
.qh-area:hover .qh-n { color: var(--nc-red-hot); opacity: 1; }
.qh-area-title {
    font-family: var(--font-d);
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--nc-white);
    margin-bottom: .5rem;
    line-height: 1.1;
}
.qh-area-desc {
    font-size: .86rem;
    font-weight: 300;
    color: var(--nc-light);
    line-height: 1.65;
}

/* ── PRESENCIA REGIONAL ── */
.presencia-sec {
    background: var(--nc-black);
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--nc-steel);
}
.pres-machine {
    position: absolute;
    top: 0; right: -8%; bottom: 0;
    width: 62%;
    z-index: 0;
    pointer-events: none;
}
.pres-machine img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: .055;
    filter: saturate(.2) brightness(.7);
}
.presencia-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 5rem;
    align-items: center;
}
.pres-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.pres-alliance {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.pres-brand {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--nc-red-hot);
}
.pres-x {
    font-family: var(--font-m);
    font-size: .85rem;
    color: var(--nc-ash);
}
.pres-partner {
    font-family: var(--font-d);
    font-weight: 700;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--nc-ash);
}
.pres-left .nos-hd { margin-bottom: 0; }
.pres-ps {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.pres-ps p {
    font-size: .9rem;
    font-weight: 300;
    color: var(--nc-light);
    line-height: 1.72;
    text-wrap: pretty;
}

/* País block */
.pais-block {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--nc-steel);
}
.pais-num-row {
    display: flex;
    align-items: baseline;
    gap: .65rem;
}
.pais-count {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: 3.8rem;
    color: var(--nc-white);
    line-height: 1;
    letter-spacing: -.03em;
}
.pais-label {
    font-family: var(--font-d);
    font-weight: 700;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--nc-red-hot);
}
.pais-sub {
    font-size: .86rem;
    font-weight: 300;
    color: var(--nc-ash);
    line-height: 1.6;
    max-width: 28ch;
}

/* Right column */
.pres-right {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.pres-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--nc-steel);
    border-bottom: 1px solid var(--nc-steel);
}
.pstat {
    padding: 1.5rem 0 1.5rem 1.25rem;
    border-right: 1px solid var(--nc-steel);
    position: relative;
    overflow: hidden;
    transition: background .3s;
}
.pstat:last-child { border-right: none; }
.pstat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--nc-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--expo);
}
.pstat:hover::before { transform: scaleX(1); }
.pstat-num {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    color: var(--nc-white);
    letter-spacing: -.02em;
    line-height: 1;
    margin-bottom: .35rem;
    display: flex;
    align-items: baseline;
    gap: .15rem;
}
.pstat-num em {
    color: var(--nc-red-hot);
    font-style: normal;
    font-size: clamp(.8rem, 1.1vw, 1rem);
}
.pstat-lbl {
    font-family: var(--font-m);
    font-size: .58rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--nc-ash);
}

/* Mapa presencia */
.pres-map {
    width: 100%;
}
.pres-map-img {
    width: 100%;
    height: auto;
    display: block;
    filter: url(#brandRed);
}
.sa-map {
    width: 100%;
    height: auto;
    display: block;
}
.cont-fill {
    fill: rgba(255,255,255,.03);
    stroke: rgba(255,255,255,.09);
    stroke-width: .5;
}
.china-fill {
    fill: rgba(193,18,31,.06);
    stroke: rgba(193,18,31,.22);
    stroke-width: .6;
}
.sa-line {
    stroke: var(--nc-red);
    stroke-width: .85;
    stroke-linecap: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    opacity: .72;
    transition: stroke-dashoffset 1.4s var(--expo);
    fill: none;
}
.sl-china {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
}
.pres-map.in .sl-china { stroke-dashoffset: 0; transition-delay: 0s; }
.pres-map.in .sl1 { stroke-dashoffset: 0; transition-delay: .35s; }
.pres-map.in .sl2 { stroke-dashoffset: 0; transition-delay: .55s; }
.pres-map.in .sl3 { stroke-dashoffset: 0; transition-delay: .75s; }
.pres-map.in .sl4 { stroke-dashoffset: 0; transition-delay: .95s; }
.pres-map.in .sl5 { stroke-dashoffset: 0; transition-delay: 1.15s; }
.cm-dot { fill: var(--nc-red); }
.hub-dot { fill: var(--nc-red-hot); }
.cm-pulse {
    fill: rgba(193,18,31,.18);
    animation: cmPulse 3s ease-out infinite;
}
@keyframes cmPulse {
    0% { opacity: .6; }
    70%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sa-line { transition: none; }
    .cm-pulse { animation: none; }
}

/* ── LÍNEA PROFESIONAL ── */
.linea-sec {
    background: var(--nc-carbon);
    border-top: 1px solid var(--nc-steel);
}
.linea-hd .nos-hd { margin-bottom: 3rem; }

.linea-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
}
.linea-item {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--nc-steel);
    position: relative;
    transition: padding-left .3s var(--expo);
}
.linea-item:first-child { border-top: 1px solid var(--nc-steel); }
.linea-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: transparent;
    transition: background .3s;
}
.linea-item:hover { padding-left: .65rem; }
.linea-item:hover::before { background: var(--nc-red); }
.linea-n {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: 2.8rem;
    color: var(--nc-ash);
    opacity: .7;
    line-height: 1;
    transition: color .3s, opacity .3s;
}
.linea-item:hover .linea-n { color: var(--nc-red-hot); opacity: 1; }
.linea-title {
    font-family: var(--font-d);
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--nc-white);
    margin-bottom: .45rem;
    line-height: 1.1;
}
.linea-desc {
    font-size: .85rem;
    font-weight: 300;
    color: var(--nc-light);
    line-height: 1.65;
}
.linea-link {
    color: var(--nc-steel);
    transition: color .3s, transform .3s var(--expo);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: .5rem;
}
.linea-item:hover .linea-link {
    color: var(--nc-red-hot);
    transform: translateX(5px);
}
.linea-cta { display: flex; }
.linea-cta .btn-g {
    padding: .85rem 1.8rem;
    border: 1px solid var(--nc-steel);
    transition: color .2s, border-color .2s;
}
.linea-cta .btn-g:hover {
    border-color: var(--nc-ash);
    gap: .7rem;
}

/* ── FORMACIÓN ── */
.form-sec {
    position: relative;
    overflow: hidden;
}
.form-bg {
    position: absolute;
    inset: 0;
}
.form-bg img,
.form-bg picture {
    width: 100%;
    height: 100%;
    display: block;
}
.form-bg img {
    object-fit: cover;
    filter: brightness(.5) saturate(.62);
}
.form-ov {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(10,10,10,.9) 0%, rgba(10,10,10,.5) 60%, rgba(10,10,10,0) 100%),
        linear-gradient(to top, rgba(10,10,10,.78) 0%, transparent 50%);
}
.form-content {
    position: relative;
    z-index: 2;
    max-width: 860px;
}
.form-content .nos-hd { margin-bottom: 2.5rem; }
.form-h2 {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: clamp(2.4rem, 4.2vw, 4rem);
    line-height: .95;
    letter-spacing: -.025em;
    text-transform: uppercase;
    color: var(--nc-white);
    margin-bottom: 0;
    text-wrap: balance;
}
.form-sub {
    font-family: var(--font-m);
    font-size: .62rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--nc-red-hot);
}
.form-body {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    margin-bottom: 2.5rem;
}
.form-body p {
    font-size: .92rem;
    font-weight: 300;
    color: var(--nc-light);
    line-height: 1.75;
    max-width: 68ch;
    text-wrap: pretty;
}

/* ── NUESTRO SISTEMA ── */
.sns-sec {
    background: var(--nc-black);
    border-top: 1px solid var(--nc-steel);
}
.sns-hd .nos-hd { margin-bottom: 3rem; }
.sns-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--nc-steel);
    border-bottom: 1px solid var(--nc-steel);
    margin-bottom: 3rem;
}
.sns-stage {
    padding: 2.5rem 2rem;
    border-right: 1px solid var(--nc-steel);
    position: relative;
    overflow: hidden;
    transition: background .3s;
}
.sns-stage:first-child { padding-left: 0; }
.sns-stage:last-child { border-right: none; padding-right: 0; }
.sns-stage::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--nc-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .55s var(--expo);
}
.sns-stage:hover::before { transform: scaleX(1); }
.sns-stage:hover { background: rgba(255,255,255,.015); }
.sns-n {
    font-family: var(--font-m);
    font-size: .58rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--nc-red-hot);
    margin-bottom: 1rem;
}
.sns-name {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: 1.45rem;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--nc-white);
    margin-bottom: .75rem;
    line-height: 1;
}
.sns-desc {
    font-size: .82rem;
    font-weight: 300;
    color: var(--nc-light);
    line-height: 1.65;
}
.sns-cta { display: flex; }
.sns-cta .btn-g {
    padding: .85rem 1.8rem;
    border: 1px solid var(--nc-steel);
    transition: color .2s, border-color .2s;
}
.sns-cta .btn-g:hover {
    border-color: var(--nc-ash);
    gap: .7rem;
}

/* ── CTA ── */
.cta-nos {
    position: relative;
    min-height: 62vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 4rem;
    overflow: hidden;
}
.cta-nos::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--nc-red);
    z-index: 3;
}
.cta-nos-bg {
    position: absolute; inset: 0; z-index: 0;
}
.cta-nos-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(.18) saturate(.5);
}
.cta-nos-ov {
    position: absolute; inset: 0; z-index: 1;
    background:
        radial-gradient(ellipse 80% 60% at 50% 60%, rgba(10,10,10,.3) 0%, rgba(10,10,10,.88) 100%),
        linear-gradient(to top, rgba(10,10,10,.98) 0%, transparent 60%);
}
.cta-nos-content {
    position: relative; z-index: 2;
    width: 100%; max-width: 700px;
}
.cta-nos-h2 {
    font-family: var(--font-d);
    font-weight: 900;
    font-size: clamp(2.4rem, 4.2vw, 3.8rem);
    line-height: .95;
    letter-spacing: -.025em;
    text-transform: uppercase;
    color: var(--nc-white);
    margin-bottom: 1.5rem;
    text-wrap: balance;
}
.cta-nos-h2 span { color: var(--nc-red-hot); }
.cta-nos-sub {
    font-size: 1rem;
    font-weight: 300;
    color: var(--nc-light);
    line-height: 1.65;
    max-width: 72ch;
    margin: 0 auto 2.75rem;
}
.cta-nos-acts {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
    .hero-nos,
    .stats-nos { padding-left: 2rem; padding-right: 2rem; }
    .qh-layout { gap: 3rem; }
    .presencia-layout { gap: 3rem; }
}

@media (max-width: 900px) {
    .hero-nos {
        padding: 0 1.5rem;
        min-height: 72vh;
        justify-content: flex-start;
        text-align: left;
    }
    .hn-ov {
        background: rgba(10,10,10,.8);
    }
    .hn-content { max-width: 100%; }
    .hn-p { max-width: 100%; }
    .hn-btns { justify-content: flex-start; }
    /* hero h1 sized to match the other pages' hero titles (e.g. Capacitaciones).
       Shorter mobile lines ("Especialistas / en pisos de / Hormigón / Hace más de 30 años")
       allow a bigger size. !important overrides the global `.hero-h1 { …!important }`. */
    .hero-nos .hero-h1 { font-size: clamp(2.9rem, 13.4vw, 3.6rem) !important; line-height: 1.02; }
    /* full-bleed counters: section padding 0 so the grid spans edge to edge */
    .stats-nos { padding: 0; }

    /* Restore horizontal padding the global `.sec { padding: 4rem 0 !important }`
       strips on mobile — otherwise headings, text, grids and the map touch the edges. */
    .sec { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

    .sn-grid { grid-template-columns: 1fr 1fr; }
    /* uniform side padding so text keeps a margin on both columns when full-bleed */
    .sn-item {
        padding: 2.5rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--nc-steel);
    }
    .sn-item:nth-child(odd) { border-right: 1px solid var(--nc-steel); }
    .sn-item:nth-child(3), .sn-item:nth-child(4) { border-bottom: none; }

    .qh-layout { grid-template-columns: 1fr; gap: 2rem; }
    .qh-intro .nos-hd { margin-bottom: 0; }

    /* flatten the two columns into one flow so heading → text → stats → map → +países
       can be ordered individually (display:contents drops the wrapper boxes) */
    /* align-items:flex-start beats the base grid's align-items:center, which would
       otherwise horizontally-center the narrower items (heading, +países) */
    .presencia-layout { display: flex; flex-direction: column; align-items: flex-start; gap: 2rem; }
    .pres-left, .pres-right { display: contents; }
    .pres-left .nos-hd { order: 1; }
    .pres-ps        { order: 2; }
    .pres-stats     { order: 3; }
    .pres-map       { order: 4; max-width: 100%; }
    .pais-block     { order: 5; }
    .pres-machine { display: none; }
    /* left-align all copy in this section */
    .presencia-sec { text-align: left; }
    .presencia-sec .pais-num-row,
    .presencia-sec .pres-stats { justify-content: flex-start; }

    .linea-item {
        grid-template-columns: 44px 1fr auto;
        gap: 1rem;
    }

    /* full-bleed: negative margin cancels the section's 1.5rem padding so the grid
       reaches the screen edges; the stage's own 1.5rem padding keeps the text inset. */
    .sns-grid { grid-template-columns: 1fr; margin-left: -1.5rem; margin-right: -1.5rem; }
    .sns-stage {
        padding: 2rem 1.5rem !important;
        border-right: none;
        border-bottom: 1px solid var(--nc-steel);
    }
    .sns-stage:last-child { border-bottom: none; }

    .cta-nos { padding: 4rem 1.5rem; min-height: 50vh; }
    .form-content { max-width: 100%; }
    .form-body p { max-width: 100%; }
    .sns-hd .nos-hd { margin-bottom: 2rem; }
}

@media (max-width: 600px) {
    .linea-item { grid-template-columns: 40px 1fr; }
    .linea-link { display: none; }
    .qh-area { grid-template-columns: 44px 1fr; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .sn-item::before,
    .sn-item,
    .qh-area::before,
    .qh-area,
    .linea-item::before,
    .linea-item,
    .linea-link,
    .sns-stage::before { transition: none; }
}
