/*
 * Gestión de fletes.
 * Concepto: contenedores de carga. Lámina corrugada, rotulación en esténcil, un
 * contenedor que se carga en el hero y un convoy de contenedores acoplados.
 */
[data-function-layout="freight"] {
    --gf-cobalt: #1d4e89;
    --gf-cobalt-dark: #143a68;
    --gf-steel: #8b97a5;
    --gf-sheet: #eef1f4;
    --gf-ink: #041f49;
    --gf-load: #fac63f;
    --gf-rust: #b54a2a;
    --gf-wood: #d9b98a;
    --gf-line: #dbe1e7;
    --gf-muted: #4a5568;
    --gf-display: "Big Shoulders", "Big Shoulders Display", "Hanken Grotesk", ui-sans-serif, sans-serif;
    --gf-stencil: "Big Shoulders Stencil", "Big Shoulders Stencil Display", var(--gf-display);
    --gf-ribs: repeating-linear-gradient(90deg, rgb(255 255 255 / .09) 0 6px, rgb(0 0 0 / .1) 6px 9px, transparent 9px 16px);
    --gf-ease: cubic-bezier(.2, .7, .2, 1);
}

[data-function-layout="freight"] .cv-section-title,
[data-function-layout="freight"] .cv-card-title,
[data-function-layout="freight"] .cv-form-title {
    font-family: var(--gf-display);
    letter-spacing: .005em;
}
[data-function-layout="freight"] .cv-section-title { font-size: clamp(2.2rem, 4.2vw, 3.3rem); font-weight: 800; line-height: 1; }

/* ---------- Reveal: solo opacidad ---------- */
.gf-reveal-ready [data-function-layout="freight"] [data-gf-reveal] {
    opacity: 0;
    transition: opacity .7s ease;
}
.gf-reveal-ready [data-function-layout="freight"] [data-gf-reveal].is-visible { opacity: 1; }

/* ---------- Superficies ---------- */
[data-function-layout="freight"] .gf-sheet,
[data-function-layout="freight"] #capacidades-function { background: var(--gf-sheet); }
[data-function-layout="freight"] .gf-yard {
    background:
        repeating-linear-gradient(90deg, rgb(4 31 73 / .035) 0 6px, transparent 6px 16px),
        #f6f7f9;
}

/* ---------- Hero ---------- */
[data-function-layout="freight"] #inicio {
    padding-block: clamp(2.5rem, 6vw, 5rem);
    background: linear-gradient(150deg, #041f49 0%, #0d2c58 60%, #1d3f6c 100%);
}
[data-function-layout="freight"] .function-hero__overlay {
    background: linear-gradient(90deg, rgb(4 31 73 / .95) 0%, rgb(4 31 73 / .84) 45%, rgb(4 31 73 / .4) 100%);
}
[data-function-layout="freight"] .rh-hero-layout { align-items: center; }
[data-function-layout="freight"] #inicio .cv-eyebrow,
[data-function-layout="freight"] #inicio .cv-eyebrow .cv-icon { color: var(--gf-load); }
[data-function-layout="freight"] #inicio .cv-hero-title {
    max-width: 10ch;
    color: #fff;
    font-family: var(--gf-stencil);
    font-size: clamp(3.4rem, 7.4vw, 6.4rem);
    font-weight: 900;
    line-height: .9;
    letter-spacing: .01em;
}
[data-function-layout="freight"] #inicio .cv-hero-description { color: rgb(255 255 255 / .84); }
[data-function-layout="freight"] #inicio .cv-hero-copy p.text-sm { color: rgb(255 255 255 / .62); }
[data-function-layout="freight"] #inicio .cv-primary-button {
    border-color: var(--gf-load);
    background: var(--gf-load);
    color: var(--gf-ink);
    box-shadow: 0 14px 30px rgb(0 0 0 / .25);
}
[data-function-layout="freight"] #inicio .cv-primary-button:hover,
[data-function-layout="freight"] #inicio .cv-primary-button:focus-visible { background: #ffd666; }
[data-function-layout="freight"] #inicio .cv-secondary-button { border-color: rgb(255 255 255 / .7); background: transparent; color: #fff; }
[data-function-layout="freight"] #inicio .cv-secondary-button:hover,
[data-function-layout="freight"] #inicio .cv-secondary-button:focus-visible { background: #fff; color: var(--gf-ink); }
[data-function-layout="freight"] #inicio .cv-primary-button:focus-visible,
[data-function-layout="freight"] #inicio .cv-secondary-button:focus-visible { outline: 3px solid var(--gf-load); outline-offset: 3px; }

/* Contenedor: costado rotulado y bodega donde entra la carga. */
[data-function-layout="freight"] .gf-container {
    justify-self: center;
    width: 100%;
    max-width: 31rem;
    overflow: hidden;
    border: 6px solid var(--gf-cobalt-dark);
    border-radius: .35rem;
    background: var(--gf-cobalt);
    box-shadow: 0 30px 60px rgb(0 0 0 / .4);
    animation: gf-fade .6s ease .1s both;
}
[data-function-layout="freight"] .gf-container__side {
    padding: 1.25rem 1.5rem;
    border-bottom: 6px solid var(--gf-cobalt-dark);
    background: var(--gf-ribs), var(--gf-cobalt);
}
[data-function-layout="freight"] .gf-container__mark {
    margin: 0;
    color: #fff;
    font-family: var(--gf-stencil);
    font-size: clamp(2.6rem, 6vw, 3.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: .06em;
    opacity: .92;
}
[data-function-layout="freight"] .gf-container__bay {
    position: relative;
    min-height: 13rem;
    padding: 1.25rem 4.5rem 1.25rem 1.25rem;
    background:
        linear-gradient(180deg, rgb(0 0 0 / .35), rgb(0 0 0 / .1) 30%, transparent),
        repeating-linear-gradient(90deg, #1b2a3e 0 2px, #223450 2px 26px);
}
[data-function-layout="freight"] .gf-container__cargo {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: .6rem;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
[data-function-layout="freight"] .gf-container__cargo li {
    display: grid;
    place-items: center;
    min-width: 7.25rem;
    min-height: 5.25rem;
    padding: .75rem;
    border: 2px solid #b89466;
    background:
        linear-gradient(45deg, transparent 47%, rgb(122 86 44 / .35) 47% 53%, transparent 53%),
        repeating-linear-gradient(180deg, var(--gf-wood) 0 16px, #c9a676 16px 18px);
    color: var(--gf-ink);
    font-family: var(--gf-display);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    animation: gf-load 0.75s cubic-bezier(.3, .8, .3, 1) both;
    animation-delay: calc(.6s + var(--i) * .45s);
}
[data-function-layout="freight"] .gf-container__cargo li:last-child { border-color: var(--gf-ink); background: var(--gf-load); }
[data-function-layout="freight"] .gf-container__door {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3.75rem;
    border-left: 4px solid var(--gf-cobalt-dark);
    background:
        linear-gradient(90deg, transparent 0 40%, #c9d1da 40% 48%, transparent 48% 70%, #c9d1da 70% 78%, transparent 78%),
        var(--gf-ribs), var(--gf-cobalt);
    transform-origin: right;
    animation: gf-door 1s ease-in-out 2.2s both;
}

/* ---------- Definición: cajas apiladas ---------- */
[data-function-layout="freight"] .gf-overview { display: grid; gap: 3rem 4rem; align-items: center; }
[data-function-layout="freight"] .gf-overview .cv-section-intro {
    color: #1f2a3d;
    font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
    line-height: 1.75;
}
[data-function-layout="freight"] .gf-crates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    max-width: 28rem;
    margin: 0;
    padding: 0 0 .75rem;
    border-bottom: 10px solid var(--gf-steel);
    list-style: none;
    justify-self: center;
    width: 100%;
}
[data-function-layout="freight"] .gf-crates li {
    display: grid;
    place-items: center;
    min-height: 7rem;
    padding: 1rem;
    border: 3px solid #a88458;
    background:
        linear-gradient(45deg, transparent 48%, rgb(122 86 44 / .3) 48% 52%, transparent 52%),
        repeating-linear-gradient(180deg, var(--gf-wood) 0 22px, #c9a676 22px 25px);
    color: var(--gf-ink);
    font-family: var(--gf-display);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}
[data-function-layout="freight"] .gf-crates li:last-child { border-color: var(--gf-ink); background: var(--gf-load); }

/* ---------- Problema: enganche roto entre remolques ---------- */
[data-function-layout="freight"] .gf-problem { display: grid; gap: 3rem 4rem; align-items: center; }
[data-function-layout="freight"] .gf-problem .cv-section-intro { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.75; }
[data-function-layout="freight"] .gf-hitch { display: grid; grid-template-columns: minmax(0, 1fr) 4rem minmax(0, 1fr); align-items: center; }
[data-function-layout="freight"] .gf-hitch__car {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 1rem;
    border: 3px solid rgb(255 255 255 / .4);
    border-radius: .3rem;
    background: var(--gf-ribs), rgb(255 255 255 / .06);
    list-style: none;
}
[data-function-layout="freight"] .gf-hitch__car li {
    padding: .55rem .75rem;
    border-radius: .2rem;
    background: rgb(255 255 255 / .12);
    color: #fff;
    font-family: var(--gf-display);
    font-size: 1.2rem;
    font-weight: 700;
}
[data-function-layout="freight"] .gf-hitch__car--areas { border-color: var(--gf-load); }
[data-function-layout="freight"] .gf-hitch__car--areas li { background: rgb(250 198 63 / .18); color: var(--gf-load); }
[data-function-layout="freight"] .gf-hitch__break { position: relative; height: 1rem; }
[data-function-layout="freight"] .gf-hitch__break::before,
[data-function-layout="freight"] .gf-hitch__break::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 42%;
    height: 6px;
    background: var(--gf-steel);
    translate: 0 -50%;
}
[data-function-layout="freight"] .gf-hitch__break::before { left: 0; clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%); }
[data-function-layout="freight"] .gf-hitch__break::after { right: 0; clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%); background: var(--gf-rust); }
[data-function-layout="freight"] .gf-hitch.is-visible .gf-hitch__car:first-child { animation: gf-drift 3.6s ease-in-out .6s infinite alternate; }

/* ---------- Capacidades: tarjetas con franja de lámina corrugada ---------- */
[data-function-layout="freight"] .gf-capabilities {
    display: grid;
    gap: 1.25rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}
[data-function-layout="freight"] .gf-capabilities li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-height: 11rem;
    padding: 1.9rem 1.5rem 1.5rem;
    overflow: hidden;
    border: 1px solid rgb(4 31 73 / .1);
    border-radius: .3rem;
    background: #fff;
    box-shadow: 0 .75rem 1.75rem rgb(4 31 73 / .07);
}
[data-function-layout="freight"] .gf-capabilities li::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 10px;
    background: var(--gf-ribs), var(--gf-cobalt);
}
[data-function-layout="freight"] .gf-capabilities__icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .2rem;
    background: var(--gf-cobalt);
    color: #fff;
}
[data-function-layout="freight"] .gf-capabilities__icon .cv-icon { width: 1.35rem; height: 1.35rem; }
[data-function-layout="freight"] .gf-capabilities p { margin: 0; color: #041f49; font-size: 1.0625rem; font-weight: 500; line-height: 1.55; }
@media (min-width: 768px) and (max-width: 1023px) {
    [data-function-layout="freight"] .gf-capabilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [data-function-layout="freight"] .gf-capabilities li:last-child { grid-column: 1 / -1; min-height: 0; }
}
/* Cinco capacidades: tres arriba y dos más anchas abajo. */
@media (min-width: 1024px) {
    [data-function-layout="freight"] .gf-capabilities { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    [data-function-layout="freight"] .gf-capabilities li { grid-column: span 2; }
    [data-function-layout="freight"] .gf-capabilities li:nth-child(4),
    [data-function-layout="freight"] .gf-capabilities li:nth-child(5) { grid-column: span 3; }
}
@media (max-width: 767px) {
    [data-function-layout="freight"] .gf-capabilities li { min-height: 0; }
}

/* ---------- Flujo: convoy de contenedores ---------- */
[data-function-layout="freight"] .gf-convoy {
    display: grid;
    gap: 1.5rem;
    margin: 2.75rem 0 0;
    padding: 0;
    list-style: none;
}
[data-function-layout="freight"] .gf-convoy li {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    min-height: 6rem;
    padding: 1rem 1.25rem;
    border: 4px solid var(--gf-cobalt-dark);
    border-radius: .25rem;
    background: var(--gf-ribs), var(--gf-cobalt);
}
[data-function-layout="freight"] .gf-convoy li:nth-child(even) { border-color: #4d5965; background: var(--gf-ribs), #6c7885; }
[data-function-layout="freight"] .gf-convoy li:last-child { border-color: #b48a1d; background: var(--gf-ribs), var(--gf-load); }
[data-function-layout="freight"] .gf-convoy li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 2.25rem;
    width: 6px;
    height: 1.5rem;
    background: var(--gf-steel);
}
[data-function-layout="freight"] .gf-convoy .cv-card-title { margin: 0; color: #fff; font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
[data-function-layout="freight"] .gf-convoy li:last-child .cv-card-title { color: var(--gf-ink); }
[data-function-layout="freight"] .gf-convoy__number {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 3px solid rgb(255 255 255 / .8);
    color: #fff;
    font-family: var(--gf-stencil);
    font-size: 1.5rem;
    font-weight: 900;
}
[data-function-layout="freight"] .gf-convoy li:last-child .gf-convoy__number { border-color: var(--gf-ink); color: var(--gf-ink); }
[data-function-layout="freight"] .gf-convoy.is-visible li {
    animation: gf-couple .6s cubic-bezier(.3, .8, .3, 1) both;
    animation-delay: calc(.15s + var(--i) * .16s);
}

/* ---------- Ejemplo ---------- */
[data-function-layout="freight"] .gf-example {
    max-width: 52rem;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border-left: 10px solid var(--gf-cobalt);
    background: var(--gf-sheet);
}
[data-function-layout="freight"] .gf-example p { margin: 1rem 0 0; color: #1f2a3d; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.75; }

/* ---------- Tablas ---------- */
[data-function-layout="freight"] .gf-table { width: 100%; margin-top: 2.5rem; border-collapse: collapse; table-layout: fixed; }
[data-function-layout="freight"] .gf-table thead th {
    padding: .9rem 1.25rem;
    background: var(--gf-cobalt);
    color: #fff;
    font-family: var(--gf-display);
    font-size: 1.35rem;
    font-weight: 800;
    text-align: left;
}
[data-function-layout="freight"] .gf-table tbody th,
[data-function-layout="freight"] .gf-table td {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--gf-line);
    font-size: 1.0625rem;
    line-height: 1.6;
    text-align: left;
    vertical-align: top;
}
[data-function-layout="freight"] .gf-table tbody th { color: var(--gf-ink); font-family: var(--gf-display); font-size: 1.3rem; font-weight: 800; }
[data-function-layout="freight"] .gf-table td { color: var(--gf-muted); }
[data-function-layout="freight"] .gf-table--integration { background: #fff; }
[data-function-layout="freight"] .gf-table--integration thead th:first-child { width: 34%; }
[data-function-layout="freight"] .gf-table--compare thead th:first-child { background: #6c7885; }
[data-function-layout="freight"] .gf-table--compare td:last-child { color: var(--gf-ink); font-weight: 600; box-shadow: inset 4px 0 0 var(--gf-load); }

/* ---------- Responsive ---------- */
@media (min-width: 1024px) {
    [data-function-layout="freight"] .rh-hero-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    [data-function-layout="freight"] .gf-overview,
    [data-function-layout="freight"] .gf-problem { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

    /* El convoy se acomoda en dos filas de tres contenedores acoplados. */
    [data-function-layout="freight"] .gf-convoy { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; }
    [data-function-layout="freight"] .gf-convoy li:not(:last-child)::after {
        top: 50%;
        left: 100%;
        width: 2rem;
        height: 6px;
        translate: 0 -50%;
    }
    [data-function-layout="freight"] .gf-convoy li:nth-child(3)::after { display: none; }
}
@media (max-width: 767px) {
    [data-function-layout="freight"] .function-hero__overlay {
        background: linear-gradient(180deg, rgb(4 31 73 / .94) 0%, rgb(4 31 73 / .82) 55%, rgb(4 31 73 / .55) 100%);
    }
    [data-function-layout="freight"] #inicio .cv-hero-title { max-width: none; }
    [data-function-layout="freight"] .gf-container__bay { padding-right: 4rem; }
    [data-function-layout="freight"] .gf-container__cargo li { min-width: 6.25rem; min-height: 4.5rem; font-size: 1rem; }
    [data-function-layout="freight"] .gf-hitch { grid-template-columns: minmax(0, 1fr); gap: 0; }
    [data-function-layout="freight"] .gf-hitch__break { width: 1rem; height: 3rem; justify-self: center; }
    [data-function-layout="freight"] .gf-hitch__break::before,
    [data-function-layout="freight"] .gf-hitch__break::after { top: auto; left: 50%; width: 6px; height: 42%; translate: -50% 0; clip-path: none; }
    [data-function-layout="freight"] .gf-hitch__break::before { top: 0; }
    [data-function-layout="freight"] .gf-hitch__break::after { right: auto; bottom: 0; }
    [data-function-layout="freight"] .gf-crates li { min-height: 5.5rem; font-size: 1.15rem; }
    [data-function-layout="freight"] .gf-table thead { display: none; }
    [data-function-layout="freight"] .gf-table,
    [data-function-layout="freight"] .gf-table tbody,
    [data-function-layout="freight"] .gf-table tr,
    [data-function-layout="freight"] .gf-table th,
    [data-function-layout="freight"] .gf-table td { display: block; width: 100%; }
    [data-function-layout="freight"] .gf-table tr { padding: .75rem 0; border-bottom: 1px solid var(--gf-line); }
    [data-function-layout="freight"] .gf-table tbody th,
    [data-function-layout="freight"] .gf-table td { padding: .35rem 1rem; border-bottom: 0; }
    [data-function-layout="freight"] .gf-table--compare td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .2rem;
        color: var(--gf-cobalt);
        font-family: var(--gf-display);
        font-size: 1.1rem;
        font-weight: 800;
    }
    [data-function-layout="freight"] .gf-table--compare td:last-child { box-shadow: none; }
}

/* ---------- Keyframes ---------- */
@keyframes gf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gf-load {
    from { opacity: 0; transform: translateX(14rem); }
    to { opacity: 1; transform: none; }
}
@keyframes gf-door {
    from { transform: perspective(600px) rotateY(-70deg); }
    to { transform: none; }
}
@keyframes gf-drift {
    from { transform: none; }
    to { transform: translateX(-.6rem); }
}
@keyframes gf-couple {
    from { opacity: 0; transform: translateX(-2.5rem); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    [data-function-layout="freight"] *,
    [data-function-layout="freight"] *::before,
    [data-function-layout="freight"] *::after {
        animation: none !important;
        transition: none !important;
    }
}
