/* ============================================================
   Cotizador DSP · costo puesto en Argentina
   Usa los tokens de styles.css (azul #1D3557, dorado #C5A059, rojo #D32F2F)
   ============================================================ */
.page-cz {
    overflow-x: clip;
    --cz-ink: #0F172A;
    --cz-ink-2: #3B4A60;
    --cz-line: rgba(29, 53, 87, 0.14);
    --cz-paper: #FBF8F2;
    --cz-gold-ink: #8A6A2B;           /* dorado legible sobre claro (5.2:1) */
    --cz-focus: 0 0 0 3px rgba(197, 160, 89, 0.45);
    background: #FFFFFF;
    color: var(--cz-ink);
}
.page-cz ::selection { background: rgba(197, 160, 89, 0.35); color: var(--cz-ink); }
.page-cz input { caret-color: var(--brand-blue); }

/* menú siempre en su versión clara (no hay foto oscura detrás) */
.page-cz .navbar {
    background: rgba(255, 255, 255, 0.97);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.page-cz .navbar .nav-link { color: var(--text-primary); }
.page-cz .navbar .nav-link:hover,
.page-cz .navbar .nav-link.active { color: var(--brand-blue); }
.page-cz .navbar .logo img { filter: none; }

/* ---------- cabecera ---------- */
.cz { padding-top: 7.5rem; padding-bottom: 5rem; }
.cz-head { max-width: 1200px; margin-bottom: 2.75rem; }
.cz-head h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2rem, 4.2vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--brand-blue);
    max-width: 20ch;
    text-wrap: balance;
    margin-bottom: 1.1rem;
}
.cz-lead {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--cz-ink-2);
    max-width: 62ch;
}
.cz-meta {
    margin-top: 1.1rem;
    font-size: 0.875rem;
    color: var(--cz-gold-ink);
    font-weight: 500;
}

/* ---------- grilla ---------- */
.cz-grid {
    max-width: 1200px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
    gap: 3.5rem;
    align-items: start;
}

/* ---------- formulario ---------- */
.cz-form { display: flex; flex-direction: column; gap: 2.5rem; }
.cz-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.cz-step legend {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--cz-ink);
    margin-bottom: 1.1rem;
    padding: 0;
}
.cz-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--cz-ink-2);
    margin-bottom: 0.45rem;
}
.cz-label small { font-weight: 400; color: #64748B; }
.cz-help { font-size: 0.85rem; color: #5B6B80; line-height: 1.5; margin-top: 0.6rem; }
.cz-field { min-width: 0; }
.cz-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cz-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }

.cz-affix, .cz-search, .cz-input {
    display: flex;
    min-width: 0;
    align-items: center;
    background: #FFFFFF;
    border: 1.5px solid var(--cz-line);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cz-affix:focus-within, .cz-search:focus-within, .cz-input:focus {
    border-color: var(--accent-purple);
    box-shadow: var(--cz-focus);
}
.cz-affix input, .cz-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 1.05rem;
    color: var(--cz-ink);
    padding: 0.85rem 0.9rem;
    font-variant-numeric: tabular-nums;
}
.cz-affix span {
    padding: 0 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4A5A70;
    align-self: stretch;
    display: flex;
    align-items: center;
    background: #F6F7F9;
}
.cz-affix > span:first-child { border-right: 1px solid var(--cz-line); border-radius: 10px 0 0 10px; }
.cz-affix-end > span:last-child { border-left: 1px solid var(--cz-line); border-radius: 0 10px 10px 0; }
.cz-input { width: 100%; font: inherit; font-size: 1rem; padding: 0.8rem 0.9rem; color: var(--cz-ink); outline: 0; }
.page-cz input::placeholder { color: #5E6D82; }

/* buscador */
.cz-search { position: relative; }
.cz-search-icon {
    width: 20px; height: 20px; margin-left: 0.95rem;
    fill: none; stroke: var(--brand-blue); stroke-width: 2; stroke-linecap: round;
    flex: none;
}
.cz-search input { padding-left: 0.65rem; }
.cz-sugerencias {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0.35rem;
    border: 1px solid var(--cz-line);
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.18);
}
.cz-sugerencias li {
    display: grid;
    grid-template-columns: 5.2rem 1fr auto;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.75rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}
.cz-sugerencias li:hover, .cz-sugerencias li.is-activo { background: #F3EEE3; }
.cz-op-code { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--brand-blue); }
.cz-op-desc { color: var(--cz-ink); line-height: 1.35; }
.cz-op-di { font-size: 0.8rem; color: var(--cz-gold-ink); font-weight: 600; white-space: nowrap; }
.cz-sugerencias .cz-op-otro {
    display: block;
    color: var(--cz-ink-2);
    font-size: 0.9rem;
    border-top: 1px solid var(--cz-line);
    border-radius: 0 0 10px 10px;
    margin-top: 0.25rem;
}

/* NCM elegida */
.cz-ncm {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem 1rem;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: var(--cz-paper);
    border: 1px solid rgba(197, 160, 89, 0.4);
}
.cz-ncm-main { display: flex; flex-direction: column; gap: 0.2rem; }
.cz-ncm-code { font-weight: 600; color: var(--brand-blue); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.cz-ncm-desc { color: var(--cz-ink); line-height: 1.4; }
.cz-ncm-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cz-ncm .cz-link { grid-row: 1; grid-column: 2; align-self: start; margin: 0; }
.cz-tag {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: #FFFFFF;
    color: var(--cz-ink-2);
    border: 1px solid var(--cz-line);
}
.cz-tag-warn { background: #FDECEA; color: #A42020; border-color: rgba(211, 47, 47, 0.25); }

.cz-link {
    background: none;
    border: 0;
    padding: 0;
    margin-top: 0.75rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--brand-blue);
    text-decoration: underline;
    text-decoration-color: var(--accent-purple);
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    cursor: pointer;
    min-height: 44px;
}
.cz-link:hover { color: var(--cz-gold-ink); }

/* control segmentado */
.cz-seg {
    display: inline-flex;
    padding: 4px;
    border-radius: 12px;
    background: #F1F3F6;
    margin-bottom: 1.1rem;
}
.cz-seg label { position: relative; cursor: pointer; }
.cz-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cz-seg span {
    display: block;
    padding: 0.6rem 1.1rem;
    border-radius: 9px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--cz-ink-2);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
}
.cz-seg input:checked + span {
    background: #FFFFFF;
    color: var(--brand-blue);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}
.cz-seg input:focus-visible + span { box-shadow: var(--cz-focus); }

.cz-carga.is-ok { color: var(--brand-blue); }
.cz-carga strong { font-weight: 600; }

/* modalidades de envío */
.cz-envios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.cz-envio { position: relative; cursor: pointer; }
.cz-envio input { position: absolute; opacity: 0; pointer-events: none; }
.cz-envio > span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    height: 100%;
    padding: 0.95rem 1rem;
    border: 1.5px solid var(--cz-line);
    border-radius: 12px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.cz-envio strong { font-weight: 600; font-size: 0.98rem; color: var(--cz-ink); }
.cz-envio small { font-size: 0.82rem; color: #5B6B80; }
.cz-envio:hover > span { border-color: rgba(29, 53, 87, 0.35); }
.cz-envio input:checked + span { border-color: var(--brand-blue); background: #F2F5FA; box-shadow: inset 0 0 0 1px var(--brand-blue); }
.cz-envio input:focus-visible + span { box-shadow: var(--cz-focus); }

/* avanzado */
.cz-adv { border-top: 1px solid var(--cz-line); border-bottom: 1px solid var(--cz-line); }
.cz-adv summary {
    cursor: pointer;
    list-style: none;
    padding: 1.1rem 0;
    font-weight: 600;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}
.cz-adv summary::-webkit-details-marker { display: none; }
.cz-adv summary::before {
    content: '';
    width: 8px; height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.25s ease;
    margin-right: 0.35rem;
}
.cz-adv[open] summary::before { transform: rotate(45deg); }
.cz-adv summary span { font-weight: 400; color: #5B6B80; font-size: 0.9rem; }
.cz-adv summary:focus-visible { outline: none; box-shadow: var(--cz-focus); border-radius: 6px; }
.cz-adv-body { display: flex; flex-direction: column; gap: 1.1rem; padding-bottom: 1.5rem; }
.cz-check { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 0.95rem; color: var(--cz-ink); cursor: pointer; min-height: 44px; }
.cz-check input { width: 20px; height: 20px; accent-color: var(--brand-blue); margin-top: 1px; flex: none; }

/* ---------- liquidación ---------- */
.cz-result { position: sticky; top: 6.5rem; scroll-margin-top: 6rem; }
.cz-slip {
    background: var(--cz-paper);
    border-radius: 16px;
    padding: 1.75rem 1.6rem 1.6rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 48px -24px rgba(29, 53, 87, 0.28);
    position: relative;
    overflow: hidden;
}
.cz-slip::before {           /* borde de ticket: perforado superior */
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: radial-gradient(circle at 6px -2px, #FFFFFF 5px, transparent 5.5px) 0 0 / 12px 6px repeat-x, var(--brand-blue);
}
.cz-slip h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--brand-blue);
    margin: 0.4rem 0 1.25rem;
}
.cz-empty p { color: var(--cz-ink-2); line-height: 1.55; padding: 1.5rem 0 1rem; border-top: 1px dashed rgba(29, 53, 87, 0.25); }

.cz-hero-num { display: flex; flex-direction: column; gap: 0.2rem; padding-bottom: 1.25rem; border-bottom: 1px dashed rgba(29, 53, 87, 0.25); }
.cz-hero-label { font-size: 0.88rem; color: var(--cz-ink-2); }
.cz-hero-value {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cz-ink);
    font-variant-numeric: tabular-nums lining-nums;
    line-height: 1.1;
}
.cz-hero-sub { font-size: 0.95rem; color: var(--cz-gold-ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.cz-lines { padding: 0.5rem 0; }
.cz-group { padding: 0.85rem 0; border-bottom: 1px dashed rgba(29, 53, 87, 0.18); }
.cz-group h3 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
}
.cz-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.9rem;
    padding: 0.18rem 0;
    color: var(--cz-ink);
}
.cz-line i { border-bottom: 1px dotted rgba(29, 53, 87, 0.35); transform: translateY(-4px); min-width: 1rem; }
.cz-line b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cz-line span { line-height: 1.35; }
.cz-line em { font-style: normal; font-size: 0.72rem; color: #2E6B4A; background: #E6F2EB; padding: 0.05rem 0.4rem; border-radius: 4px; margin-left: 0.25rem; white-space: nowrap; }
.cz-line.is-rec b { color: var(--cz-ink-2); }

.cz-totals { padding-top: 1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.cz-total { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; font-size: 0.92rem; color: var(--cz-ink-2); }
.cz-total strong { font-variant-numeric: tabular-nums; color: var(--cz-ink); font-weight: 600; text-align: right; }
.cz-total strong small { display: block; font-size: 0.82rem; font-weight: 500; color: var(--cz-gold-ink); white-space: nowrap; }
.cz-total strong { white-space: nowrap; }
.cz-total-main { font-size: 1rem; color: var(--cz-ink); font-weight: 500; }
.cz-total-main strong { font-size: 1.05rem; color: var(--brand-blue); }
.cz-info {
    width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid rgba(29, 53, 87, 0.35);
    background: #FFFFFF; color: var(--brand-blue);
    font-size: 0.72rem; font-weight: 700; line-height: 1; cursor: help;
    vertical-align: 1px; margin-left: 0.2rem;
}
.cz-tip { font-size: 0.8rem; color: #5B6B80; line-height: 1.45; }
.cz-warn {
    margin-top: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #7A1B1B;
    background: #FDF0EE;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
}
.cz-disclaimer { margin-top: 1rem; font-size: 0.8rem; color: #5B6B80; line-height: 1.5; }

/* pedido */
.cz-lead { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(29, 53, 87, 0.2); }
.cz-lead h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; color: var(--cz-ink); margin-bottom: 1rem; }
.cz-lead .cz-field { margin-bottom: 0.9rem; }
.cz-lead .cz-row-2 { margin-bottom: 0; }
.cz-error { font-size: 0.85rem; color: #A42020; margin-bottom: 0.75rem; }
.cz-cta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 54px;
    border: 0;
    border-radius: 12px;
    background: var(--accent-red);
    color: #FFFFFF;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 8px 20px -8px rgba(211, 47, 47, 0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.cz-cta svg { width: 22px; height: 22px; fill: currentColor; }
.cz-cta:hover { background: #B71C1C; transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(211, 47, 47, 0.6); }
.cz-cta:focus-visible { outline: none; box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 6px var(--accent-red); }
.cz-cta:disabled { opacity: 0.7; cursor: progress; transform: none; }

/* el momento: la liquidación se "imprime" la primera vez */
@media (prefers-reduced-motion: no-preference) {
    .cz-result.is-revelado .cz-out {
        animation: cz-imprimir 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    @keyframes cz-imprimir {
        from { clip-path: inset(0 0 100% 0); opacity: 0.4; }
        to   { clip-path: inset(0 0 0 0); opacity: 1; }
    }
}

/* barra fija en el celular */
.cz-bar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .cz-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .cz-result { position: static; }
}
@media (max-width: 768px) {
    .cz { padding-top: 6.5rem; }
    .page-cz .container { padding-left: 1rem; padding-right: 1rem; }
    .page-cz .nav-links .nav-link { font-size: 1.1rem; padding: 0.75rem 0; }
    .cz-head h1 { font-size: 2rem; }
    .cz-lead { font-size: 1.02rem; }
    .cz-envios { grid-template-columns: minmax(0, 1fr); }
    .cz-envio > span { flex-direction: row; justify-content: space-between; align-items: baseline; }
    .cz-row-2 { grid-template-columns: minmax(0, 1fr); }
    .cz-lead .cz-row-2 { gap: 0; }
    .cz-row-3 { gap: 0.5rem; }
    .cz-row-3 .cz-affix input { padding: 0.85rem 0.5rem; }
    .cz-row-3 .cz-affix span { padding: 0 0.5rem; }
    .cz-sugerencias li { grid-template-columns: 1fr auto; }
    .cz-sugerencias .cz-op-desc { grid-column: 1 / -1; grid-row: 2; }
    .cz-slip { padding: 1.5rem 1.1rem 1.25rem; }
    .cz-total { flex-direction: column; gap: 0.15rem; }
    .cz-total strong { text-align: left; }
    .cz-bar:not([hidden]) {
        display: flex;
        position: fixed;
        left: 0.75rem; right: 0.75rem; bottom: 0.75rem;
        z-index: 900;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.7rem 0.75rem 0.7rem 1.1rem;
        background: var(--brand-blue);
        color: #FFFFFF;
        border-radius: 14px;
        box-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.45);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    }
    .cz-bar div { display: flex; flex-direction: column; }
    .cz-bar span { font-size: 0.75rem; opacity: 0.8; }
    .cz-bar strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
    .cz-bar-btn {
        background: var(--accent-purple);
        color: #1A1405;
        font-weight: 600;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        border-radius: 10px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    body.cz-result-visible .cz-bar { transform: translateY(140%); opacity: 0; pointer-events: none; }
}

/* v2: tres resultados con su aclaración, sin desglose */
.cz-line-big { align-items: end; padding: 0.55rem 0; font-size: 1rem; color: var(--cz-ink); }
.cz-line-big span { font-weight: 600; }
.cz-line-big span small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--cz-ink-2); margin-top: 0.15rem; max-width: 22rem; }
.cz-line-big b { font-weight: 600; font-size: 1.02rem; }
.cz-total-main strong { font-size: 1.2rem; }

/* aviso de presupuesto estimado: bien visible */
.cz-estimado {
    margin-top: 1.1rem;
    padding: 0.9rem 1rem;
    border: 2px solid var(--brand-red, #D32F2F);
    border-radius: 10px;
    background: #FFF6F5;
    text-align: center;
}
.cz-estimado strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #A61F1F;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.35;
}
.cz-estimado p { margin-top: 0.35rem; font-size: 0.86rem; color: var(--cz-ink); line-height: 1.45; }
