/*
 * Pedimento de importación en inventario — Inventarios.
 * Concepto: el hilo de trazabilidad. La etiqueta kraft del lote queda amarrada al pedimento con un hilo
 * dorado que recorre los tres momentos que valida Evidence: compra, venta y entrada por ajuste.
 * (Distinto de complemento-comercio-exterior, que usa la aduana documental y la frontera.)
 * Dorado = el hilo que une dato y mercancía; verde = con pedimento; rojo = referencia genérica o dato faltante.
 * Display Commissioner; cuerpo Inter.
 * Momento animado único: en el hero se tiende el hilo y cada estación se marca "Con pedimento".
 */
[data-function-layout="pedimento"] {
    --pd-ink: #041f49;
    --pd-thread: #fac63f;
    --pd-thread-dark: #a86d00;
    --pd-kraft: #efdcb5;
    --pd-green: #1f7a4a;
    --pd-green-tint: #e1f1e8;
    --pd-red: #b42b26;
    --pd-red-tint: #fbe7e5;
    --pd-blue: #2a6fb0;
    --pd-paper: #f2f4f7;
    --pd-line: #dde3ea;
    --pd-muted: #46505e;
    --pd-text: #1f2a3d;
    --pd-display: "Commissioner", "Hanken Grotesk", ui-sans-serif, sans-serif;
    --pd-ease: cubic-bezier(.2, .7, .2, 1);
}

[data-function-layout="pedimento"] .cv-hero-title,
[data-function-layout="pedimento"] .cv-section-title,
[data-function-layout="pedimento"] .cv-form-title { font-family: var(--pd-display); font-weight: 800; letter-spacing: -.025em; }
[data-function-layout="pedimento"] .cv-section-title { font-size: clamp(1.75rem, 2.8vw, 2.6rem); line-height: 1.12; }
[data-function-layout="pedimento"] .pd-narrow { max-width: 48rem; }
[data-function-layout="pedimento"] .pd-subtitle { margin: 0 0 1rem; color: var(--pd-ink); font-family: var(--pd-display); font-size: 1.3rem; font-weight: 800; }
[data-function-layout="pedimento"] .pd-subtitle--light { color: #fff; }

/* ---------- Superficies ---------- */
[data-function-layout="pedimento"] .pd-paper { background: var(--pd-paper); }
[data-function-layout="pedimento"] .pd-navy { background: var(--pd-ink); color: #fff; }
[data-function-layout="pedimento"] .pd-navy .cv-section-title { color: #fff; }
[data-function-layout="pedimento"] .pd-split { display: grid; gap: 2.5rem 4rem; align-items: center; }
[data-function-layout="pedimento"] .pd-split--top { align-items: start; }
[data-function-layout="pedimento"] .pd-lead { max-width: 42rem; margin-top: 1.25rem; color: var(--pd-text); font-size: clamp(1.0625rem, 1.4vw, 1.1875rem); line-height: 1.75; }
[data-function-layout="pedimento"] .pd-lead--strong { color: var(--pd-ink); font-family: var(--pd-display); font-size: clamp(1.2rem, 1.7vw, 1.4rem); font-weight: 700; line-height: 1.5; }
[data-function-layout="pedimento"] .pd-lead--light { color: rgb(255 255 255 / .88); }
[data-function-layout="pedimento"] .pd-text { margin: 0; color: var(--pd-text); font-size: 1.0625rem; line-height: 1.75; }
[data-function-layout="pedimento"] .pd-text--light { color: rgb(255 255 255 / .88); }

/* ---------- Hero ---------- */
[data-function-layout="pedimento"] #inicio { background: linear-gradient(155deg, #041f49 0%, #0a2c5c 70%, #0f3870 100%); color: #fff; }
[data-function-layout="pedimento"] #inicio .function-hero__media img { object-position: 65% 50%; }
[data-function-layout="pedimento"] #inicio .function-hero__overlay {
    background:
        linear-gradient(180deg, transparent 65%, rgb(4 31 73 / .7) 100%),
        linear-gradient(90deg, rgb(4 31 73 / .97) 0%, rgb(4 31 73 / .9) 42%, rgb(10 44 92 / .72) 70%, rgb(15 56 112 / .55) 100%);
}
[data-function-layout="pedimento"] .rh-hero-layout { position: relative; z-index: 1; align-items: center; }
[data-function-layout="pedimento"] #inicio .cv-hero-title { max-width: 13ch; color: #fff; font-size: clamp(2.4rem, 4.7vw, 4.2rem); line-height: 1.03; }
[data-function-layout="pedimento"] #inicio .cv-hero-description { max-width: 34rem; margin-top: 1.5rem; color: rgb(255 255 255 / .86); }
[data-function-layout="pedimento"] .pd-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
[data-function-layout="pedimento"] #inicio .cv-primary-button { border-color: var(--pd-thread); background: var(--pd-thread); color: var(--pd-ink); box-shadow: 0 14px 30px rgb(0 0 0 / .3); }
[data-function-layout="pedimento"] #inicio .cv-primary-button:hover,
[data-function-layout="pedimento"] #inicio .cv-primary-button:focus-visible { background: #ffd666; }
[data-function-layout="pedimento"] #inicio .cv-secondary-button { border-color: rgb(255 255 255 / .7); background: transparent; color: #fff; }
[data-function-layout="pedimento"] #inicio .cv-secondary-button:hover,
[data-function-layout="pedimento"] #inicio .cv-secondary-button:focus-visible { background: #fff; color: var(--pd-ink); }
[data-function-layout="pedimento"] #inicio .cv-primary-button:focus-visible,
[data-function-layout="pedimento"] #inicio .cv-secondary-button:focus-visible { outline: 3px solid var(--pd-thread); outline-offset: 3px; }

/* Hilo de trazabilidad: el estilo base es el estado final. */
[data-function-layout="pedimento"] .pd-thread { position: relative; justify-self: center; width: 100%; max-width: 32rem; margin: 0; padding: 1.4rem 1.3rem 1rem; border-radius: .5rem; background: rgb(255 255 255 / .06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2); color: #fff; }
[data-function-layout="pedimento"] .pd-thread .cv-icon { width: 17px; height: 17px; flex-basis: 17px; }
[data-function-layout="pedimento"] .pd-thread__tags { display: grid; grid-template-columns: minmax(0, 1fr) 2.2rem minmax(0, 1fr); align-items: center; }
[data-function-layout="pedimento"] .pd-tag { position: relative; padding: .85rem .95rem; border-radius: .35rem; color: var(--pd-ink); box-shadow: 0 16px 30px rgb(0 0 0 / .3); }
/* Etiqueta kraft con muesca y ojal, como las de lote. */
[data-function-layout="pedimento"] .pd-tag.is-lot { padding-left: 1.7rem; border-radius: 0 .35rem .35rem 0; background: var(--pd-kraft); clip-path: polygon(.9rem 0, 100% 0, 100% 100%, .9rem 100%, 0 50%); }
[data-function-layout="pedimento"] .pd-tag__hole { position: absolute; top: 50%; left: .75rem; width: .55rem; height: .55rem; border: 2px solid var(--pd-thread-dark); border-radius: 50%; background: var(--pd-ink); translate: 0 -50%; }
[data-function-layout="pedimento"] .pd-tag.is-pedimento { border-top: 4px solid var(--pd-blue); background: #fff; }
[data-function-layout="pedimento"] .pd-tag__label { margin: 0; color: var(--pd-muted); font-size: .72rem; font-weight: 700; }
[data-function-layout="pedimento"] .pd-tag__value { margin: .15rem 0 0; font-family: var(--pd-display); font-size: 1.3rem; font-weight: 800; line-height: 1.15; }
[data-function-layout="pedimento"] .pd-tag__value--number { font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap; }
[data-function-layout="pedimento"] .pd-tag__meta { margin: .25rem 0 0; color: var(--pd-muted); font-size: .72rem; font-weight: 600; }
/* Nudo del hilo entre lote y pedimento. */
[data-function-layout="pedimento"] .pd-thread__knot { position: relative; height: 3px; background: var(--pd-thread); }
[data-function-layout="pedimento"] .pd-thread__knot::after { content: ""; position: absolute; top: 50%; left: 50%; width: .75rem; height: .75rem; border-radius: 50%; background: var(--pd-thread); translate: -50% -50%; }
/* El hilo baja del nudo y recorre las tres estaciones. */
[data-function-layout="pedimento"] .pd-thread__stations { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 2.2rem 0 0; padding: 0; list-style: none; }
[data-function-layout="pedimento"] .pd-thread__stations::before { content: ""; position: absolute; top: calc(1.2rem - 1.5px); right: 16.6%; left: 16.6%; height: 3px; background: var(--pd-thread); transform-origin: left; animation: pd-draw .7s var(--pd-ease) .35s both; }
[data-function-layout="pedimento"] .pd-thread__stations::after { content: ""; position: absolute; top: -2.2rem; left: calc(50% - 1.5px); width: 3px; height: 2.2rem; background: var(--pd-thread); }
[data-function-layout="pedimento"] .pd-thread__stations li { position: relative; z-index: 1; display: grid; justify-items: center; gap: .45rem; text-align: center; }
[data-function-layout="pedimento"] .pd-station__dot { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--pd-ink); box-shadow: 0 0 0 2px var(--pd-thread); color: #fff; }
[data-function-layout="pedimento"] .pd-station__name { font-size: .85rem; font-weight: 700; line-height: 1.25; }
[data-function-layout="pedimento"] .pd-station__check { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .5rem; border-radius: .25rem; background: var(--pd-green-tint); color: #165c37; font-size: .72rem; font-weight: 700; white-space: nowrap; animation: pd-pop .35s var(--pd-ease) both; }
[data-function-layout="pedimento"] .pd-station__check .cv-icon { width: 13px; height: 13px; flex-basis: 13px; stroke-width: 2.6; }
[data-function-layout="pedimento"] .pd-thread__stations li:nth-child(1) .pd-station__check { animation-delay: .8s; }
[data-function-layout="pedimento"] .pd-thread__stations li:nth-child(2) .pd-station__check { animation-delay: 1.1s; }
[data-function-layout="pedimento"] .pd-thread__stations li:nth-child(3) .pd-station__check { animation-delay: 1.4s; }
[data-function-layout="pedimento"] .pd-thread figcaption { margin-top: 1rem; color: rgb(255 255 255 / .7); font-size: .76rem; }

/* ---------- Definición: registros separados frente a relación conservada ---------- */
[data-function-layout="pedimento"] .pd-note { display: grid; gap: 1rem; padding: clamp(1.4rem, 3vw, 2rem); border: 2px solid var(--pd-ink); border-radius: .5rem; background: #fff; }
[data-function-layout="pedimento"] .pd-note__title { margin: 0; color: var(--pd-ink); font-family: var(--pd-display); font-size: 1.35rem; font-weight: 800; line-height: 1.25; }
[data-function-layout="pedimento"] .pd-note__text { margin: 0; color: var(--pd-text); line-height: 1.7; }
[data-function-layout="pedimento"] .pd-records { display: grid; gap: 1rem; margin: 0; padding-top: 1.1rem; border-top: 1px solid var(--pd-line); }
[data-function-layout="pedimento"] .pd-records__label { margin: 0 0 .45rem; color: var(--pd-muted); font-size: .82rem; font-weight: 700; }
[data-function-layout="pedimento"] .pd-records__items { display: flex; flex-wrap: wrap; gap: .9rem; }
[data-function-layout="pedimento"] .pd-records__items span { position: relative; padding: .45rem .75rem; border-radius: .3rem; background: var(--pd-paper); color: var(--pd-ink); font-weight: 700; }
[data-function-layout="pedimento"] .pd-records__row.is-apart .pd-records__items span { border: 1.5px dashed #9aa8b8; background: transparent; color: var(--pd-muted); }
[data-function-layout="pedimento"] .pd-records__row.is-linked .pd-records__items { gap: 1.4rem; }
[data-function-layout="pedimento"] .pd-records__row.is-linked .pd-records__items span { background: var(--pd-kraft); }
[data-function-layout="pedimento"] .pd-records__row.is-linked .pd-records__items span:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -1.4rem; width: 1.4rem; height: 3px; background: var(--pd-thread-dark); translate: 0 -50%; }

/* ---------- Lista ---------- */
[data-function-layout="pedimento"] .pd-list { display: grid; margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--pd-ink); }
[data-function-layout="pedimento"] .pd-list li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: 1.1rem 0; border-bottom: 1px solid var(--pd-line); color: var(--pd-text); font-size: 1.0625rem; line-height: 1.6; }
[data-function-layout="pedimento"] .pd-list__icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .4rem; background: var(--pd-red-tint); color: var(--pd-red); }

/* ---------- Lote y pedimento ---------- */
[data-function-layout="pedimento"] .pd-match { display: grid; gap: 1rem; margin: 0; }
[data-function-layout="pedimento"] .pd-match__case { padding: 1.1rem 1.2rem; border-radius: .45rem; background: var(--pd-paper); }
[data-function-layout="pedimento"] .pd-match__case.is-ok { box-shadow: inset 0 0 0 2px var(--pd-green); background: #fff; }
[data-function-layout="pedimento"] .pd-match__label { display: flex; align-items: center; gap: .45rem; margin: 0 0 .7rem; font-family: var(--pd-display); font-size: 1.05rem; font-weight: 800; }
[data-function-layout="pedimento"] .pd-match__label .cv-icon { width: 18px; height: 18px; flex-basis: 18px; }
[data-function-layout="pedimento"] .pd-match__case.is-ok .pd-match__label { color: var(--pd-green); }
[data-function-layout="pedimento"] .pd-match__case.is-generic .pd-match__label { color: var(--pd-red); }
[data-function-layout="pedimento"] .pd-match__pair { display: grid; grid-template-columns: auto minmax(1.5rem, 1fr) auto; gap: .6rem; align-items: center; margin: .45rem 0 0; font-variant-numeric: tabular-nums; }
[data-function-layout="pedimento"] .pd-match__pair span { padding: .35rem .6rem; border-radius: .3rem; background: #fff; box-shadow: inset 0 0 0 1px var(--pd-line); color: var(--pd-ink); font-size: .9rem; font-weight: 700; white-space: nowrap; }
[data-function-layout="pedimento"] .pd-match__pair span:first-child { background: var(--pd-kraft); box-shadow: none; }
[data-function-layout="pedimento"] .pd-match__pair i { height: 3px; background: var(--pd-thread-dark); }
[data-function-layout="pedimento"] .pd-match__case.is-generic .pd-match__pair i { height: 0; border-top: 2px dashed #b8c2ce; background: none; }
[data-function-layout="pedimento"] .pd-match__case.is-generic .pd-match__pair span:last-child { color: var(--pd-red); }

/* ---------- Cómo se controla ---------- */
[data-function-layout="pedimento"] .pd-moments { display: grid; gap: .75rem; margin: 2.25rem 0 0; padding: 0; list-style: none; }
[data-function-layout="pedimento"] .pd-moments li { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem; border-radius: .45rem; background: rgb(255 255 255 / .07); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .2), inset 4px 0 0 var(--pd-thread); font-family: var(--pd-display); font-size: 1.2rem; font-weight: 800; }
[data-function-layout="pedimento"] .pd-moments .cv-icon { width: 22px; height: 22px; flex-basis: 22px; color: var(--pd-thread); }
[data-function-layout="pedimento"] .pd-pair { display: grid; gap: 2rem 4rem; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid rgb(255 255 255 / .2); }
[data-function-layout="pedimento"] .pd-goal { max-width: 46rem; margin: 2.25rem 0 0; padding-left: 1rem; border-left: 3px solid var(--pd-thread); color: #fff; font-family: var(--pd-display); font-size: 1.2rem; font-weight: 700; line-height: 1.5; }

/* ---------- Inventario confiable ---------- */
[data-function-layout="pedimento"] .pd-blocks { display: grid; gap: 1.75rem 3rem; margin-top: 2.25rem; }
[data-function-layout="pedimento"] .pd-block { padding-top: 1.25rem; border-top: 3px solid var(--pd-ink); }
[data-function-layout="pedimento"] .pd-block__icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .4rem; background: var(--pd-paper); color: var(--pd-ink); }
[data-function-layout="pedimento"] .pd-block h3 { margin: .9rem 0 .5rem; color: var(--pd-ink); font-family: var(--pd-display); font-size: 1.2rem; font-weight: 800; line-height: 1.3; }
[data-function-layout="pedimento"] .pd-block p { margin: 0; color: var(--pd-text); line-height: 1.75; }
[data-function-layout="pedimento"] .pd-path__item { padding: .1rem .45rem; border-radius: .3rem; background: var(--pd-paper); box-shadow: inset 0 0 0 1px var(--pd-line); color: var(--pd-ink); font-weight: 600; white-space: nowrap; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
[data-function-layout="pedimento"] .pd-path__sep { color: var(--pd-muted); font-weight: 700; }

/* ---------- Buenas prácticas ---------- */
[data-function-layout="pedimento"] .pd-checklist { display: grid; margin: 0; padding: 0; list-style: none; border-top: 3px solid var(--pd-ink); }
[data-function-layout="pedimento"] .pd-checklist li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1.1rem 0; border-bottom: 1px solid var(--pd-line); color: var(--pd-text); font-size: 1.0625rem; line-height: 1.6; }
[data-function-layout="pedimento"] .pd-checklist__box { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-top: .05rem; border: 2px solid var(--pd-green); border-radius: .3rem; color: var(--pd-green); background: #fff; }
[data-function-layout="pedimento"] .pd-checklist__box .cv-icon { width: 16px; height: 16px; flex-basis: 16px; stroke-width: 2.4; }

/* ---------- Trazabilidad: la cadena ---------- */
[data-function-layout="pedimento"] .pd-trace { padding: clamp(1.4rem, 3vw, 2rem); border-radius: .5rem; background: var(--pd-ink); color: #fff; }
[data-function-layout="pedimento"] .pd-trace__title { margin: 0; font-family: var(--pd-display); font-size: 1.45rem; font-weight: 800; line-height: 1.2; }
[data-function-layout="pedimento"] .pd-trace__text { margin: .8rem 0 0; color: rgb(255 255 255 / .88); line-height: 1.7; }
[data-function-layout="pedimento"] .pd-trace__chain { display: flex; flex-wrap: wrap; gap: .7rem 1.6rem; margin: 1.3rem 0 0; padding: 0; list-style: none; }
[data-function-layout="pedimento"] .pd-trace__chain li { position: relative; padding: .45rem .75rem; border-radius: .3rem; background: var(--pd-kraft); color: var(--pd-ink); font-weight: 700; }
[data-function-layout="pedimento"] .pd-trace__chain li:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -1.6rem; width: 1.6rem; height: 3px; background: var(--pd-thread); translate: 0 -50%; }

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
    [data-function-layout="pedimento"] .pd-moments { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    [data-function-layout="pedimento"] .pd-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [data-function-layout="pedimento"] .pd-blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    [data-function-layout="pedimento"] .rh-hero-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    [data-function-layout="pedimento"] .pd-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
    [data-function-layout="pedimento"] #inicio .function-hero__overlay { background: linear-gradient(180deg, rgb(4 31 73 / .95) 0%, rgb(4 31 73 / .86) 50%, rgb(10 44 92 / .7) 100%); }
    [data-function-layout="pedimento"] #inicio .cv-hero-title { max-width: none; }
}
@media (max-width: 767px) {
    [data-function-layout="pedimento"] .pd-hero__actions > * { width: 100%; }
    [data-function-layout="pedimento"] .pd-thread { padding: 1.1rem .9rem .9rem; }
    [data-function-layout="pedimento"] .pd-thread__tags { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
    [data-function-layout="pedimento"] .pd-thread__knot { justify-self: center; width: 3px; height: 1.2rem; margin-block: -1.2rem; }
    [data-function-layout="pedimento"] .pd-tag__value--number { font-size: .95rem; }
    [data-function-layout="pedimento"] .pd-station__check { white-space: normal; }
    [data-function-layout="pedimento"] .pd-match__pair span { white-space: normal; }
}

/* ---------- Keyframes ---------- */
@keyframes pd-draw { from { transform: scaleX(0); } }
@keyframes pd-pop { from { opacity: 0; transform: translateY(-.35rem) scale(.9); } }

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