/*
 * Órdenes de producción.
 * Concepto: la orden de trabajo de planta. El panel del hero es una hoja en tabla con clip metálico
 * y franja de seguridad; el flujo se muestra como piezas sobre una banda transportadora.
 */
[data-function-layout="ordenes-produccion"] {
    --op-ink: #041f49;
    --op-steel: #2c4470;
    --op-gold: #fac63f;
    --op-paper: #f3f6fa;
    --op-line: #dbe2ec;
    --op-muted: #4a5568;
    --op-hazard: repeating-linear-gradient(-45deg, #fac63f 0 12px, #041f49 12px 24px);
}

/* ---------- Hero ---------- */
[data-function-layout="ordenes-produccion"] #inicio {
    padding-block: clamp(2.5rem, 6vw, 5rem);
    background:
        radial-gradient(45% 65% at 78% 45%, rgb(148 163 184 / .2), transparent 65%),
        linear-gradient(150deg, #041f49 0%, #0a2a5a 60%, #1d3d6e 100%);
}
[data-function-layout="ordenes-produccion"] .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%); }
@media (max-width: 767px) {
    [data-function-layout="ordenes-produccion"] .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="ordenes-produccion"] .rh-hero-layout { align-items: center; }
[data-function-layout="ordenes-produccion"] #inicio .cv-eyebrow,
[data-function-layout="ordenes-produccion"] #inicio .cv-eyebrow .cv-icon { color: var(--op-gold); }
[data-function-layout="ordenes-produccion"] #inicio .cv-hero-title {
    max-width: 13ch;
    color: #fff;
    font-size: clamp(2.5rem, 5.2vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -.04em;
}
[data-function-layout="ordenes-produccion"] #inicio .cv-hero-description { color: rgb(255 255 255 / .84); }
[data-function-layout="ordenes-produccion"] #inicio .cv-hero-copy p.text-sm { color: rgb(255 255 255 / .62); }
[data-function-layout="ordenes-produccion"] #inicio .cv-primary-button {
    border-color: var(--op-gold);
    background: var(--op-gold);
    color: var(--op-ink);
    box-shadow: 0 14px 30px rgb(0 0 0 / .25);
}
[data-function-layout="ordenes-produccion"] #inicio .cv-primary-button:hover,
[data-function-layout="ordenes-produccion"] #inicio .cv-primary-button:focus-visible { background: #ffd666; }
[data-function-layout="ordenes-produccion"] #inicio .cv-secondary-button { border-color: rgb(255 255 255 / .7); background: transparent; color: #fff; }
[data-function-layout="ordenes-produccion"] #inicio .cv-secondary-button:hover,
[data-function-layout="ordenes-produccion"] #inicio .cv-secondary-button:focus-visible { background: #fff; color: var(--op-ink); }
[data-function-layout="ordenes-produccion"] #inicio .cv-primary-button:focus-visible,
[data-function-layout="ordenes-produccion"] #inicio .cv-secondary-button:focus-visible { outline: 3px solid var(--op-gold); outline-offset: 3px; }

/* La tabla con la orden: hoja, marco de la tabla y clip metálico. */
[data-function-layout="ordenes-produccion"] .function-report-panel {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 .875rem;
    align-items: center;
    justify-self: center;
    width: calc(100% - 28px);
    max-width: 27rem;
    min-width: 0;
    margin: 3.5rem 14px 14px;
    padding: 2.5rem 1.75rem 0;
    border: 0;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 0 0 14px var(--op-steel), 0 0 0 15px rgb(255 255 255 / .16), 0 40px 60px rgb(0 0 0 / .45);
    color: var(--op-ink);
    --op-rot: -1.25deg;
    rotate: var(--op-rot);
    animation: op-board-in 1s cubic-bezier(.2, .7, .2, 1) .25s both;
}
[data-function-layout="ordenes-produccion"] .function-report-panel::before {
    content: "";
    position: absolute;
    top: -2.9rem;
    left: 50%;
    width: 9rem;
    height: 3.6rem;
    border-radius: .8rem .8rem .45rem .45rem;
    background: linear-gradient(180deg, #e2e8f0 0%, #a3b1c4 70%, #8392a8 100%);
    box-shadow: 0 6px 10px rgb(0 0 0 / .35), inset 0 1px 0 #fff;
    translate: -50% 0;
}
[data-function-layout="ordenes-produccion"] .function-report-panel::after {
    content: "";
    position: absolute;
    top: -2.25rem;
    left: 50%;
    width: 2.25rem;
    height: 1rem;
    border-radius: 9999px;
    background: var(--op-steel);
    box-shadow: inset 0 2px 3px rgb(0 0 0 / .4);
    translate: -50% 0;
}
[data-function-layout="ordenes-produccion"] .function-report-panel .rh-feature-icon { grid-column: 1; border-radius: .5rem; background: var(--op-ink); color: var(--op-gold); }
[data-function-layout="ordenes-produccion"] .function-report-panel h2 {
    grid-column: 2;
    margin: 0;
    font-family: "Hanken Grotesk", ui-sans-serif, sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.2;
}
[data-function-layout="ordenes-produccion"] .function-report-lines,
[data-function-layout="ordenes-produccion"] .function-report-panel > p { grid-column: 1 / -1; }
[data-function-layout="ordenes-produccion"] .function-report-lines { display: grid; gap: 1rem; margin-top: 1.5rem; padding: 0; list-style: none; }
[data-function-layout="ordenes-produccion"] .function-report-lines li {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.55;
}
[data-function-layout="ordenes-produccion"] .function-report-lines li::before {
    content: "✓";
    display: grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    margin-top: .1rem;
    border: 2px solid var(--op-ink);
    border-radius: 4px;
    background: var(--op-gold);
    color: var(--op-ink);
    font-size: .75rem;
    font-weight: 800;
}
[data-function-layout="ordenes-produccion"] .function-report-panel > p {
    margin: 1.5rem -1.75rem 0;
    padding: 1rem 1.75rem 1.25rem;
    border-top: 10px solid transparent;
    border-image: var(--op-hazard) 10;
    background: #f8fafc;
    color: var(--op-muted);
    font-size: .875rem;
    line-height: 1.6;
}
@keyframes op-board-in {
    from { opacity: 0; translate: 0 2.5rem; rotate: -5deg; }
    to { opacity: 1; translate: 0 0; rotate: var(--op-rot); }
}

/* ---------- Definición ---------- */
[data-function-layout="ordenes-produccion"] .rh-function-overview { display: grid; gap: 1.5rem 3rem; align-items: start; }
[data-function-layout="ordenes-produccion"] #overview-title::before {
    content: "";
    display: block;
    width: 4.5rem;
    height: 8px;
    margin-bottom: 1.25rem;
    background: var(--op-hazard);
}
[data-function-layout="ordenes-produccion"] .rh-function-overview .cv-section-intro {
    margin-top: 0;
    color: #1f2a3d;
    font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
    line-height: 1.75;
}

/* ---------- Errores frecuentes: azul marino, encabezado de cada error en blanco ---------- */
[data-function-layout="ordenes-produccion"] #problema-function .cv-reading-block { max-width: none; text-align: left; }
[data-function-layout="ordenes-produccion"] #problema-function .cv-section-intro { max-width: 52rem; margin: 1rem 0 0; }
[data-function-layout="ordenes-produccion"] .rh-function-problems { display: grid; gap: 0 3rem; margin-top: 2.5rem; padding: 0; list-style: none; }
[data-function-layout="ordenes-produccion"] .rh-function-problems li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding-block: 1.5rem;
    border-top: 1px solid rgb(255 255 255 / .2);
    color: rgb(255 255 255 / .78);
    line-height: 1.65;
}
[data-function-layout="ordenes-produccion"] .rh-function-problems strong {
    display: block;
    margin-bottom: .35rem;
    color: #fff;
    font-family: "Hanken Grotesk", ui-sans-serif, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
}
[data-function-layout="ordenes-produccion"] .rh-function-problems .rh-feature-icon { background: rgb(250 198 63 / .16); color: var(--op-gold); }

/* ---------- Ejemplo práctico: hoja de orden con franja de seguridad ---------- */
[data-function-layout="ordenes-produccion"] #ejemplo-function { background: var(--op-paper); }
[data-function-layout="ordenes-produccion"] .cv-example-card {
    padding: clamp(1.5rem, 4vw, 3rem);
    border: 0;
    border-top: 12px solid transparent;
    border-image: var(--op-hazard) 12;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 1px 0 var(--op-line);
}
[data-function-layout="ordenes-produccion"] .cv-example-card > p.cv-reading-block {
    max-width: 60rem;
    color: #1f2a3d;
    font-size: 1.0625rem;
    line-height: 1.85;
    text-align: left;
}

/* ---------- Datos de la orden y funciones: bloques de texto a tres columnas ---------- */
[data-function-layout="ordenes-produccion"] #datos-orden-function { background: #fff; }
[data-function-layout="ordenes-produccion"] #capacidades-function { background: var(--op-paper); }
[data-function-layout="ordenes-produccion"] .rh-function-capabilities { display: grid; gap: 1.25rem; margin-top: 2.5rem; padding: 0; list-style: none; }
[data-function-layout="ordenes-produccion"] .rh-function-capabilities li {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.75rem;
    border-radius: .5rem;
    color: var(--op-ink);
}
[data-function-layout="ordenes-produccion"] .rh-function-capabilities .cv-card-title {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.65;
}
[data-function-layout="ordenes-produccion"] #datos-orden-function .rh-function-capabilities li { border-left: 4px solid var(--op-gold); background: var(--op-paper); }
[data-function-layout="ordenes-produccion"] #capacidades-function .rh-function-capabilities li { border-top: 4px solid var(--op-steel); background: #fff; }
[data-function-layout="ordenes-produccion"] #capacidades-function .rh-feature-icon { background: var(--op-steel); color: #fff; }

/* ---------- Beneficios: azul marino, dos bloques de texto ---------- */
[data-function-layout="ordenes-produccion"] #beneficios-function { background: var(--op-ink); }
[data-function-layout="ordenes-produccion"] #beneficios-function .cv-section-title { color: #fff; }
[data-function-layout="ordenes-produccion"] .rh-function-benefits { display: grid; gap: 2rem 3rem; margin-top: 2.5rem; padding: 0; list-style: none; }
[data-function-layout="ordenes-produccion"] .rh-function-benefits li { padding-top: 1.5rem; border-top: 1px solid rgb(255 255 255 / .2); }
[data-function-layout="ordenes-produccion"] .rh-function-benefits .rh-feature-icon { border-radius: 50%; background: var(--op-gold); color: var(--op-ink); }
[data-function-layout="ordenes-produccion"] .rh-function-benefits p {
    margin-top: 1.25rem;
    color: rgb(255 255 255 / .9);
    font-family: "Hanken Grotesk", ui-sans-serif, sans-serif;
    font-size: clamp(1.125rem, 1.6vw, 1.3rem);
    font-weight: 500;
    line-height: 1.55;
}

/* ---------- Planeación: piezas sobre una banda transportadora ---------- */
[data-function-layout="ordenes-produccion"] #flujo-function { background: #fff; color: var(--op-ink); }
[data-function-layout="ordenes-produccion"] #flujo-function .cv-section-title { color: var(--op-ink); }
[data-function-layout="ordenes-produccion"] #flujo-function .cv-process-list {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    gap: .75rem;
    margin-top: 2.5rem;
}
[data-function-layout="ordenes-produccion"] #flujo-function .cv-process-card {
    display: grid;
    place-items: center;
    height: auto;
    min-height: 5.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--op-ink);
    border-top: 8px solid var(--op-gold);
    border-radius: .35rem;
    background: #fff;
    text-align: center;
}
[data-function-layout="ordenes-produccion"] #flujo-function .cv-process-card:hover { background: #fff; transform: none; }
[data-function-layout="ordenes-produccion"] #flujo-function .cv-process-card::after { display: none; }
[data-function-layout="ordenes-produccion"] #flujo-function .cv-process-card-header { display: none; }
[data-function-layout="ordenes-produccion"] #flujo-function .cv-process-card h3 { margin: 0; color: var(--op-ink); font-size: 1.125rem; }
[data-function-layout="ordenes-produccion"] #flujo-function .cv-integration-panel {
    margin-top: 2.5rem;
    border: 0;
    border-radius: 1rem;
    background: var(--op-ink);
    box-shadow: none;
}
[data-function-layout="ordenes-produccion"] #flujo-function .cv-mono-label { color: var(--op-gold); }
[data-function-layout="ordenes-produccion"] #flujo-function .cv-flow-text {
    max-width: 62rem;
    color: rgb(255 255 255 / .9);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.8;
    white-space: pre-line;
}

@media (min-width: 768px) {
    [data-function-layout="ordenes-produccion"] .rh-function-overview { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); }
    [data-function-layout="ordenes-produccion"] .rh-function-problems,
    [data-function-layout="ordenes-produccion"] .rh-function-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* La banda: rodillos bajo las piezas */
    [data-function-layout="ordenes-produccion"] #flujo-function .cv-process-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; padding: 0 1rem 2.25rem; }
    [data-function-layout="ordenes-produccion"] #flujo-function .cv-process-list::after {
        content: "";
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 1.75rem;
        border-radius: 9999px;
        background:
            radial-gradient(circle, #cbd5e1 0 .3rem, #64748b .32rem .42rem, transparent .44rem) 0 50% / 2rem 100% repeat-x,
            var(--op-steel);
        box-shadow: inset 0 3px 0 rgb(255 255 255 / .12);
    }
}
@media (min-width: 1024px) {
    [data-function-layout="ordenes-produccion"] .rh-hero-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    [data-function-layout="ordenes-produccion"] .cv-hero-copy { grid-column: 1; grid-row: 1; }
    [data-function-layout="ordenes-produccion"] .function-report-panel { grid-column: 2; grid-row: 1; }
    [data-function-layout="ordenes-produccion"] .rh-function-capabilities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    [data-function-layout="ordenes-produccion"] #inicio .cv-hero-title { max-width: none; }
    [data-function-layout="ordenes-produccion"] .function-report-panel { --op-rot: 0deg; padding-inline: 1.25rem; }
    [data-function-layout="ordenes-produccion"] .function-report-panel > p { margin-inline: -1.25rem; padding-inline: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    [data-function-layout="ordenes-produccion"] .function-report-panel { animation: none; }
}
