/* =========================================
   YELOSE TECH — ESTILOS GLOBALES COMPARTIDOS
   Este archivo contiene los estilos globales y compartidos
   de toda la web corporativa.
   ========================================= */

/* =========================================
   ESTILOS GLOBALES
   ========================================= */

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

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: "Nunito", sans-serif;
    font-size: var(--font-size);
}

h1 {
    font-family: "Comfortaa", sans-serif;
    font-size: 3rem;
    font-weight: 300;
    text-align: center;
}

body > header > section h1 {
    font-size: clamp(1.65rem, 4vw + 1rem, 3rem);
}

h2 {
    font-size: 2rem;
    font-weight: 200;
}

/* =========================================
   BOTONES
   ========================================= */

a[data-type] {
    display: inline-flex;
    padding: 0.8rem 1.6rem;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: color 0.35s ease, background-color 0.35s ease, border-color 0.35s ease;
    cursor: pointer;
    color: var(--btn-text-color);
    border: 0.0625rem solid var(--btn-main-color);
}

a[data-type="primary"] {
    --btn-main-color: var(--color-primary-500);
    --btn-hover-color: var(--color-primary-500);
    --btn-text-color: var(--color-primary-500);
    color: var(--color-primary-500);
    background-color: var(--color-white);
    border-color: var(--color-primary-500);
}

a[data-type="primary"]:hover {
    color: var(--color-white);
    background-color: var(--color-primary-500);
    border-color: var(--color-primary-500);
}

a[data-type="secondary"] {
    --btn-main-color: var(--color-secondary-500);
    --btn-hover-color: var(--color-secondary-600);
    --btn-text-color: var(--color-white);
}

a[data-type="white"] {
    --btn-main-color: var(--color-white);
    --btn-hover-color: var(--color-white);
    --btn-text-color: var(--color-white);
}

a[data-type]:hover {
    background-color: var(--btn-hover-color);
    border-color: var(--btn-hover-color);
}

a[data-variant="stroked"] {
    color: var(--btn-main-color);
    background-color: transparent;
    border: 0.0625rem solid var(--btn-main-color);
}

a[data-variant="stroked"]:hover {
    color: var(--btn-text-color);
    background-color: var(--btn-main-color);
}

a[data-type="white"][data-variant="stroked"]:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

a[data-type]:focus-visible {
    outline: 0.125rem solid var(--color-secondary-500);
    outline-offset: 0.25rem;
}

/* =========================================
   NAVEGACIÓN
   ========================================= */

body > nav {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    padding: 0.7rem clamp(1.25rem, 4vw, 3rem);
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-white);
}

body > nav > a {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

body > nav > a:focus-visible {
    outline: 0.125rem solid var(--color-secondary-500);
    outline-offset: 0.25rem;
}

body > nav > a > img {
    width: 2.2rem;
    height: auto;
}

body > nav > a > span {
    font-weight: 600;
}

body > nav > ul {
    display: flex;
    position: absolute;
    left: 50%;
    gap: clamp(1.25rem, 2vw, 2rem);
    align-items: center;
    transform: translateX(-50%);
    list-style: none;
}

body > nav > ul > li > a {
    position: relative;
    padding: 0.4rem 0;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.35s ease;
}

body > nav > ul > li > a:hover {
    color: var(--color-secondary-500);
}

body > nav > ul > li > a::after {
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(100% - 0.6rem);
    height: 0.2rem;
    background-color: var(--color-secondary-500);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
    content: "";
}

body > nav > ul > li > a:hover::after {
    transform: scaleX(1);
}

body > nav > ul > li > a::before {
    position: absolute;
    right: 0;
    bottom: -0.25rem;
    width: 0.35rem;
    height: 0.35rem;
    background-color: var(--color-white);
    border: 0.2rem solid var(--color-secondary-500);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.15s ease, transform 0.15s ease;
    content: "";
}

body > nav > ul > li > a:hover::before {
    opacity: 1;
    transform: scale(1);
    transition:
        opacity 0.15s ease 0.25s,
        transform 0.15s ease 0.25s;
}

body > nav > ul > li > a[aria-current="page"] {
    font-weight: 700;
    color: var(--color-secondary-500);
}

body > nav > ul > li > a[aria-current="page"]::after {
    transform: scaleX(1);
}

body > nav > ul > li > a[aria-current="page"]::before {
    opacity: 1;
    transform: scale(1);
    transition:
        opacity 0.15s ease 0.25s,
        transform 0.15s ease 0.25s;
}

body > nav > ul > li > a:focus-visible {
    outline: 0.125rem solid var(--color-secondary-500);
    outline-offset: 0.25rem;
}

body > nav > button[aria-label="Buscar"] {
    position: absolute;
    right: clamp(1.25rem, 4vw, 3rem);
    cursor: pointer;
}

body > nav > button[aria-label="Buscar"] > svg {
    width: 1.5rem;
    height: 1.5rem;
}

body > nav > button[aria-label="Buscar"] circle {
    fill: none;
    stroke: var(--color-secondary-500);
    stroke-width: 2;
}

body > nav > button[aria-label="Buscar"] path {
    fill: none;
    stroke: var(--color-secondary-500);
    stroke-width: 2;
    stroke-linecap: round;
}

body > nav > form[role="search"] {
    display: none;
    position: absolute;
    top: 50%;
    right: calc(clamp(1.25rem, 4vw, 3rem) + 2.75rem);
    z-index: 12;
    width: min(16rem, calc(100% - 9rem));
    transform: translateY(-50%);
}

body > nav > form[role="search"][data-open] {
    display: block;
}

body > nav > form[role="search"] > input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 0.4rem 0.75rem;
    font: inherit;
    color: var(--color-secondary-500);
    background-color: var(--color-white);
    border: 0.0625rem solid var(--color-secondary-500);
    border-radius: 0.25rem;
}

body > nav > form[role="search"] > input:focus-visible {
    outline: 0.125rem solid var(--color-secondary-500);
    outline-offset: 0.25rem;
}

body > nav > button {
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: 0;
}

body > nav > button:is([aria-label="Abrir menú"], [aria-label="Cerrar menú"]) {
    display: none;
}

body > nav > button:is([aria-label="Abrir menú"], [aria-label="Cerrar menú"]) > svg {
    width: 1.5rem;
    height: 1.5rem;
}

body > nav > button:is([aria-label="Abrir menú"], [aria-label="Cerrar menú"]) path {
    fill: none;
    stroke: var(--color-secondary-500);
    stroke-width: 2;
    stroke-linecap: round;
}

body > nav > button:focus-visible {
    outline: 0.125rem solid var(--color-secondary-500);
    outline-offset: 0.25rem;
}

/* =========================================
   HEADER / HERO
   ========================================= */

body > header {
    position: relative;
    width: 100%;
    height: calc(100dvh - 3rem);
    background-color: rgb(223, 223, 223);
}

body > header > picture > img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body > header > section {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0 7dvw;
    gap: 7dvh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    background-color: rgba(0, 0, 0, 0.5);
}

body > header > section > hgroup {
    display: flex;
    gap: 3dvh;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@keyframes hero-content-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body > header > section > hgroup,
body > header > section > a {
    animation: hero-content-fade-in 1.2s ease both;
}

/* =========================================
   MAIN
   ========================================= */

body > main {
    display: flex;
    width: 100%;
    flex-direction: column;
    overflow-x: clip;
}

body > main > section {
    width: 100%;
    gap: 2rem;
}

/* =========================================
   CONTACTO
   ========================================= */

body > main > section[data-section="contacto"] {
    display: grid;
    justify-items: center;
    gap: 1.25rem;
    text-align: center;
    background-color: var(--color-white);
}

body > main > section[data-section="contacto"] > h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 200;
    line-height: 1.2;
    color: var(--color-black);
}

body > main > section[data-section="contacto"] > p {
    max-width: 45rem;
    font-weight: 300;
    line-height: 1.7;
}

body > main > section[data-section="contacto"] > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    padding: 0.6rem 1.4rem;
    font-weight: 600;
    color: var(--color-white);
    text-decoration: none;
    background-color: var(--color-primary-500);
    border: 0.0625rem solid var(--color-primary-500);
    border-radius: 0.25rem;
    transition: color 0.35s ease, background-color 0.35s ease;
}

body > main > section[data-section="contacto"] > a:hover {
    color: var(--color-primary-500);
    background-color: var(--color-white);
}

body > main > section[data-section="contacto"] > a:focus-visible {
    outline: 0.125rem solid var(--color-secondary-500);
    outline-offset: 0.25rem;
}

/* =========================================
   FOOTER
   ========================================= */

footer {
    display: grid;
    position: relative;
    overflow-x: clip;
    padding: 5% 28% 2% var(--content-padding-inline);
    row-gap: 2rem;
    color: var(--color-white);
    background-color: var(--color-primary-500);
}

footer nav {
    display: grid;
    position: relative;
    z-index: 1;
    width: 100%;
    row-gap: 1.5rem;
    column-gap: 5%;
    grid-template-columns: repeat(3, 1fr);
}

footer nav > div:nth-child(1) {
    justify-self: start;
    text-align: left;
}

footer nav > div:nth-child(2) {
    justify-self: center;
    text-align: center;
}

footer nav > div:nth-child(3) {
    justify-self: end;
    text-align: right;
}

footer h2 {
    padding-bottom: 1.25rem;
    font-family: "Comfortaa", sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
}

footer ul {
    display: grid;
    padding: 0;
    row-gap: 0.75rem;
    list-style: none;
}

footer a {
    font-family: "Nunito", sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-white);
    text-decoration: none;
    white-space: nowrap;
}

footer a:hover {
    opacity: 0.7;
}

footer a:focus-visible {
    outline: 0.125rem solid var(--color-secondary-500);
    outline-offset: 0.25rem;
}

footer > p {
    position: relative;
    z-index: 1;
    padding-top: 1.5rem;
    font-size: 0.85rem;
    text-align: center;
    border-top: 0.1rem solid rgb(255 255 255 / 20%);
}

footer::before {
    position: absolute;
    top: -8.5rem;
    right: 0;
    z-index: 0;
    width: min(100%, max(40%, 26rem));
    height: calc(100% + 8.5rem);
    background-color: var(--color-secondary-500);
    clip-path: shape(from 100% 0%,
            line to 100% 100%,
            line to 0% 120%,
            curve to 100% 15% with 68% 55% / 88% 30%,
            close);
    pointer-events: none;
    content: "";
}

footer > svg {
    position: absolute;
    top: -0.9rem;
    right: -1.5%;
    z-index: 1;
    width: 33%;
    height: calc(100% + 8.5rem);
    transform: scale(0.7);
    transform-origin: top right;
    pointer-events: none;
}

footer > svg .circuit-line {
    opacity: 0.8;
    fill: none;
    stroke: var(--color-white);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

footer > svg .circuit-node {
    opacity: 0.8;
    fill: transparent;
    stroke: var(--color-white);
    stroke-width: 2.5;
}

/* =========================================
   RESPONSIVE — NAVEGACIÓN Y FOOTER
   ========================================= */

@media (max-width: 80rem) {
    body > nav {
        top: -0.0625rem;
    }
}

@media (min-width: 48rem) and (max-width: 80rem) {
    body > nav > a > img {
        width: 3rem;
    }

    body > nav > a > span,
    body > nav > ul > li > a {
        font-size: 1.5rem;
    }

    body > nav > button[aria-label="Buscar"] {
        width: 2.5rem;
        height: 2.5rem;
    }

    body > nav > button[aria-label="Buscar"] > svg {
        width: 2.5rem;
        height: 2.5rem;
    }

    body > nav > ul {
        width: max-content;
    }

    body a[data-type] {
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }
}

@media (max-width: 48rem) {
    body > nav > ul {
        display: none;
        top: 100%;
        left: 0;
        right: auto;
        z-index: 11;
        width: 100%;
        padding: 1rem clamp(1.25rem, 4vw, 3rem);
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        background-color: var(--color-white);
        transform: none;
    }

    body > nav:has(button[aria-expanded="true"]) > ul {
        display: flex;
    }

    body > nav > ul > li {
        width: 100%;
    }

    body > nav > ul > li > a {
        display: block;
        width: 100%;
    }

    body > nav > a > img {
        width: 3rem;
    }

    body > nav > a > span {
        font-size: 1.5rem;
    }

    body > nav > button[aria-label="Buscar"] {
        right: 3.5rem;
        width: 2.5rem;
        height: 2.5rem;
        transform: translate(-1rem, -0.2rem);
    }

    body > nav > button[aria-label="Buscar"] > svg {
        width: 2.5rem;
        height: 2.5rem;
    }

    body > nav > form[role="search"] {
        right: 6.75rem;
        width: min(14rem, calc(100% - 10.5rem));
    }

    body > nav > button:is([aria-label="Abrir menú"], [aria-label="Cerrar menú"]) {
        display: flex;
        position: absolute;
        right: 1.25rem;
        width: 2.75rem;
        height: 2.75rem;
        align-items: center;
        justify-content: center;
    }

    body > nav > button:is([aria-label="Abrir menú"], [aria-label="Cerrar menú"]) > svg {
        width: 2.5rem;
        height: 2.5rem;
    }

    body > header > section a[data-type="white"][data-variant="stroked"] {
        color: var(--btn-text-color);
        background-color: rgba(255, 255, 255, 0.3);
        border-color: var(--btn-hover-color);
    }

    footer nav {
        justify-items: start;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    }

    footer nav > div:nth-child(1),
    footer nav > div:nth-child(2),
    footer nav > div:nth-child(3) {
        justify-self: start;
        text-align: left;
    }

    footer a {
        white-space: normal;
    }

    footer > svg {
        top: 6.5rem;
        right: 0;
        width: 100%;
        transform: scale(0.5);
        transform-origin: top right;
    }

    footer > p {
        width: calc(100% * 80 / 62);
    }
}

@media (max-width: 47.9375rem) {
    body > nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: auto;
        z-index: 1000;
    }

    body > header {
        height: calc(100dvh - 4.4rem);
        min-height: calc(100dvh - 4.4rem);
        margin-top: 4.4rem;
    }

    body > nav:has(button[aria-expanded="true"]) > ul {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 30;
        width: auto;
        max-height: 100svh;
        max-height: 100dvh;
        padding-top: calc(4.4rem + 1rem);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body > nav:has(button[aria-expanded="true"]) > a {
        position: relative;
        z-index: 31;
    }

    body > nav:has(button[aria-expanded="true"]) > button,
    body > nav:has(button[aria-expanded="true"]) > form[role="search"] {
        z-index: 31;
    }

    /* Ajuste visual de 1px para evitar línea visible en la franja decorativa. Mantener en px. */
    footer::before {
        right: 0;
        width: 100%;
        transform: translateX(1px);
    }

    footer > p {
        padding-top: 0.5rem;
        width: 20.25rem;
        white-space: nowrap;
    }
}

@media (max-width: 23.4375rem) {
    footer > p {
        left: calc(40vw - 10.125rem);
    }
}

@media (min-width: 25rem) and (max-width: 26.5rem) {
    footer > p {
        width: 23rem;
        left: calc(40vw - 11.5rem);
        font-size: 0.95rem;
    }
}

@media (min-width: 26.5rem) and (max-width: 47.9375rem) {
    body > nav > ul > li > a {
        font-size: 1.125rem;
    }

    footer > p {
        width: 23rem;
        left: calc(40vw - 11.5rem);
        font-size: 0.95rem;
        white-space: nowrap;
    }
}

@media (min-width: 48rem) {
    body > header > section a[data-type="white"][data-variant="stroked"] {
        color: var(--btn-main-color);
        background-color: transparent;
        border-color: var(--btn-main-color);
    }

    body > header > section a[data-type="white"][data-variant="stroked"]:hover {
        color: var(--btn-text-color);
        background-color: rgba(255, 255, 255, 0.3);
        border-color: var(--btn-hover-color);
    }
}

@media (min-width: 48rem) and (max-width: 53.3125rem) {
    :root {
        --paragraph-size: clamp(1.05rem, 1.4vw + 0.55rem, 1.35rem);
    }

    body > main p {
        font-size: var(--paragraph-size);
    }

    body > main header > p {
        font-size: var(--font-size);
    }

    body > main section[data-section="legal"] > header > p:last-of-type {
        font-size: var(--paragraph-size);
    }
}

@media (min-width: 60rem) and (max-width: 64.5rem) and (orientation: portrait) {
    :root {
        --paragraph-size: clamp(1.05rem, 1.4vw + 0.55rem, 1.35rem);
    }

    body > main p {
        font-size: var(--paragraph-size);
    }

    body > main header > p {
        font-size: var(--font-size);
    }

    body > main section[data-section="legal"] > header > p:last-of-type {
        font-size: var(--paragraph-size);
    }
}

@media (min-width: 53.375rem) and (max-width: 80rem) and (orientation: portrait) {
    body > header {
        height: min(calc(100dvh - 3rem), 40rem);
    }

    body > header > section {
        gap: 1.75rem;
    }
}

@media (min-width: 48rem) and (max-width: 64rem) and (orientation: portrait) {
    body > main > section[data-section]:last-child {
        align-content: start;
        min-height: 0;
        padding-block-end: calc(8% + 3rem);
    }
}

@media (min-width: 64.0625rem) and (max-width: 80rem) and (orientation: portrait) {
    html body > main > section[data-section]:last-child {
        padding-block-end: 8%;
    }
}

@media (min-width: 53.375rem) and (max-width: 80rem) and (orientation: portrait) {
    html body > main > section[data-section="proceso"] > div[data-wave="bottom"],
    html body > main > section[data-section="por-que-yelose"] > div[data-wave="bottom"],
    html body > main > section[data-section="equipo"] > div[data-wave="bottom"],
    html body > main > section[data-section="pilares"] > div[data-wave="bottom"],
    html body > main > section[data-section="legal"] > div[data-wave="bottom"],
    html body > main > section[data-section="ficha"] > div[data-wave="bottom"],
    html body > main > section[data-section="identidad"] > div[data-wave="bottom"],
    html body > main > section[data-section="soluciones"] > div[data-wave="bottom"] {
        width: calc(112% + 16rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    a[data-type],
    body > nav > ul > li > a,
    body > nav > ul > li > a::after,
    body > nav > ul > li > a::before,
    body > main > section[data-section="contacto"] > a {
        transition: none;
    }

    body > header > section > hgroup,
    body > header > section > a {
        animation: none;
    }
}
