/* ============================================================================
   calculadora-jr-pass.css — Calculadora JR Pass.
   Rediseño 2026-06-26: adopta el lenguaje visual de planificador-final (pfn).
     - Barra de veredicto redondeada, color por estado (sustituye a la franja
       incrustada en el panel viejo).
     - Tarjetas independientes con borde sutil 1px + shadow-sm (sin borde
       superior 3px), filas clave/valor y tablas limpias.
   Reutiliza tokens de reservajapon.css; se carga DESPUÉS de él.
   IMPORTANTE: el JS (calculadora-jr-pass.js) sobrescribe verdictHeader.className
   con 'calc-vhead is-{neutral|yes|no}' e inyecta HTML en #cmpRows/#fareBody/
   #cityList — no renombrar esas clases ni los IDs.
   ============================================================================ */

.calc { padding-top: 20px; }

/* ── Cabecera de página ─────────────────────────────────────────────── */
.calc-header { margin-bottom: 1.1rem; }
.calc-header h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.calc-header p {
    font-size: 0.97rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0;
    line-height: 1.65;
}

/* ── Aviso de subida de precios (tira compacta) ─────────────────────── */
.calc-price-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: #92400e;
    flex-wrap: wrap;
}
.calc-price-alert-link {
    font-weight: 600;
    color: #92400e;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.calc-price-alert-link:hover { color: #78350f; }

/* ── Barra de veredicto (estilo .pfn-head, color por estado) ────────── */
.calc-vhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.25rem;
}
.calc-vhead.is-yes     { background: #15803d; }
.calc-vhead.is-no      { background: #9a3412; }
.calc-vhead.is-neutral { background: var(--primary-color); }

.calc-vhead-txt { min-width: 220px; flex: 1; }
.calc-vhead-h { font-size: 1.15rem; font-weight: 800; margin: 0; line-height: 1.3; letter-spacing: -0.01em; }
.calc-vhead-s { font-size: 0.85rem; opacity: 0.92; margin: 0.25rem 0 0; line-height: 1.5; }
.calc-vhead-s .verdict-link { color: #fff; }
.verdict-link { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; color: inherit; white-space: nowrap; }

.calc-vhead-amt { font-size: 1.75rem; font-weight: 800; line-height: 1; text-align: right; white-space: nowrap; }
.calc-vhead-amt:empty { display: none; }
.calc-vhead-amt small { display: block; font-size: 0.72rem; font-weight: 400; opacity: 0.88; margin-top: 0.3rem; white-space: normal; }

/* ── Tarjeta pfn (borde sutil 1px + shadow-sm, sin borde superior) ──── */
.calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.4rem;
}
.calc-card-title {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-main);
}

/* ── Rejilla calculadora: ruta | comparación ────────────────────────── */
.calc-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}
.calc-grid .calc-card--route   { flex: 1 1 320px; min-width: 0; }
.calc-grid .calc-card--compare { flex: 1 1 360px; min-width: 0; }

/* ── Viajeros (stepper) ─────────────────────────────────────────────── */
.calc-option-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; padding: 0 0 0.85rem; margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}
.calc-option-label { font-size: 0.88rem; color: var(--text-main); font-weight: 500; }
.calc-stepper {
    display: flex; align-items: center;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
}
.calc-stepper button {
    background: none; border: none; width: 32px; height: 32px;
    font-size: 1.1rem; cursor: pointer; color: var(--primary-color); font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.calc-stepper button:hover:not(:disabled) { background: var(--primary-soft); }
.calc-stepper button:disabled { opacity: 0.3; cursor: default; }
.calc-stepper-val { min-width: 28px; text-align: center; font-size: 0.95rem; font-weight: 600; color: var(--text-main); }

/* ── Añadir ciudad ──────────────────────────────────────────────────── */
.calc-city-add { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.calc-city-add select {
    flex: 1; min-width: 0;
    padding: 0.6rem 2rem 0.6rem 0.75rem;
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.9rem; color: var(--text-main);
    background: var(--bg-card);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
}
.calc-city-add select:focus { outline: none; border-color: var(--primary-color); }
.calc-city-add button {
    padding: 0.6rem 1.15rem;
    background: var(--primary-color); color: #fff;
    border: none; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: background-color 0.15s ease;
}
.calc-city-add button:hover { background: var(--primary-dark); }

.calc-city-hint { font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 0.75rem 0; }

/* ── Itinerario como timeline (drag & drop) ─────────────────────────── */
.calc-timeline { list-style: none; margin: 0; padding: 0; }
.calc-tl-node {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.45rem 0; touch-action: none;
}
.calc-tl-node.is-dragging { opacity: 0.35; }
.calc-tl-handle {
    color: var(--text-muted); cursor: grab; font-size: 0.85rem;
    opacity: 0.45; user-select: none; flex-shrink: 0; line-height: 1;
}
.calc-tl-handle:hover { opacity: 0.9; }
.calc-tl-dot {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--primary-color); border: 3px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary-color);
    flex-shrink: 0; margin-left: 3px;
}
.calc-tl-name { flex: 1; font-size: 0.95rem; color: var(--text-main); font-weight: 600; }
.calc-tl-remove {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 1rem; line-height: 1;
    padding: 0.25rem 0.35rem; border-radius: 6px; flex-shrink: 0; margin-left: auto;
}
.calc-tl-remove:hover { background: #fee2e2; color: #dc2626; }
.calc-tl-seg {
    display: flex; align-items: center; min-height: 30px;
    margin-left: 9px; padding: 0.05rem 0;
    border-left: 2px dashed var(--border-subtle);
}
.calc-tl-seg .calc-tl-cost { margin-left: 1.4rem; font-size: 0.82rem; color: var(--text-muted); }
.calc-tl-seg .calc-tl-cost b { color: var(--text-main); font-weight: 600; }
.calc-tl-seg.is-unknown .calc-tl-cost { color: #92400e; font-style: italic; }

.calc-fare-warn {
    margin-top: 0.8rem; font-size: 0.8rem; color: #92400e;
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: var(--radius-sm); padding: 0.55rem 0.75rem; line-height: 1.55;
}

/* ── Comparación (billetes + 3 pases) ───────────────────────────────── */
.calc-cmp { display: flex; flex-direction: column; gap: 0.9rem; }
.calc-cmp-empty { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin: 0; }
.calc-cmp-row .lab {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 0.5rem; font-size: 0.88rem; margin-bottom: 0.35rem;
}
.calc-cmp-row .lab .name { font-weight: 600; color: var(--text-main); }
.calc-cmp-row .lab .name small { font-weight: 400; color: var(--text-muted); }
.calc-cmp-row .lab .price { font-weight: 700; text-align: right; }
.calc-cmp-bar { height: 14px; border-radius: var(--radius-pill); background: #eef0f2; overflow: hidden; }
.calc-cmp-bar i { display: block; height: 100%; border-radius: var(--radius-pill); transition: width 0.3s ease; }
.calc-cmp-row.is-tickets .calc-cmp-bar i { background: var(--primary-deep, #4a3550); }
.calc-cmp-row.is-pass    .calc-cmp-bar i { background: #cbb3c4; }
.calc-cmp-row.is-win     .calc-cmp-bar i { background: #15803d; }
.calc-cmp-row.is-win .lab .name { color: #15803d; }
.calc-cmp-tag {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: #15803d; background: #dcfce7; padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill); margin-left: 0.35rem;
}

/* Desglose dentro de la tarjeta de comparación */
.calc-breakdown { margin-top: 1.3rem; padding-top: 1.3rem; border-top: 1px solid var(--border-subtle); }
.calc-breakdown-title {
    margin: 0 0 0.85rem;
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Importes en yenes / vía intermedia ─────────────────────────────── */
.yen-amount { font-size: 0.78em; color: var(--text-muted); display: block; margin-top: 1px; }
.fare-via { display: block; font-size: 0.78em; color: var(--text-muted); margin-top: 1px; }

/* ── Tabla de tarifas / precios ─────────────────────────────────────── */
.calc-fare-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.calc-fare-table thead tr { background: var(--primary-soft); }
.calc-fare-table th {
    text-align: left; padding: 0.6rem 0.75rem;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--primary-color);
}
.calc-fare-table th:not(:first-child) { text-align: right; }
.calc-fare-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main); vertical-align: middle;
}
.calc-fare-table td:not(:first-child) { text-align: right; }
.calc-fare-table tbody tr:last-child td { border-bottom: none; }
.calc-fare-table tbody tr:hover td { background: var(--primary-soft); }
.calc-fare-row-unknown td { color: var(--text-muted); font-style: italic; }
.calc-fare-tfoot td {
    font-weight: 700; color: var(--text-main);
    border-top: 2px solid var(--border-subtle); border-bottom: none !important;
    padding-top: 0.7rem;
}

/* Tablas estáticas dentro de tarjeta: contenedor que redondea/clipa */
.calc-table-wrap {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 0.75rem;
}
.calc-table-note { font-size: 0.8rem; color: var(--text-muted); margin: 0.55rem 0 0; }

/* ── Bloques de contenido (guía, precios, trayectos, octubre, FAQ) ──── */
.calc-section { margin-top: 1.5rem; }
.calc-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.9rem;
}
.calc-section > p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0 0 0.8rem;
}
.calc-section > p:last-child { margin-bottom: 0; }

/* Enlaces dentro de la guía rápida */
.calc-links { margin: 1.5rem 0 0; }
.calc-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.calc-link-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    display: flex; flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.calc-link-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.calc-link-card-title { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.3rem; line-height: 1.35; }
.calc-link-card-desc  { font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.calc-link-card-cta   { font-size: 0.8rem; font-weight: 600; color: var(--primary-color); margin-top: 0.75rem; }

/* ── FAQ (acordeón dentro de tarjeta) ───────────────────────────────── */
.calc-faq-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 0.25rem;
}
.calc-faq details { border-bottom: 1px solid var(--border-subtle); }
.calc-faq details:first-of-type { border-top: 1px solid var(--border-subtle); margin-top: 0.5rem; }
.calc-faq summary {
    padding: 0.9rem 0;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    user-select: none;
}
.calc-faq summary::-webkit-details-marker { display: none; }
.calc-faq summary::after {
    content: '+';
    font-size: 1.15rem;
    color: var(--primary-color);
    font-weight: 400;
    flex-shrink: 0;
    line-height: 1;
}
.calc-faq details[open] summary::after { content: '−'; }
.calc-faq-answer {
    padding: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.72;
    margin: 0;
}

/* ── Planificador (CTA) ─────────────────────────────────────────────── */
.calc .planner-strip { margin-top: 1.5rem; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .calc-grid { display: block; }
    .calc-grid .calc-card + .calc-card { margin-top: 1rem; }
    .calc-links-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .calc-vhead { padding: 1rem 1.15rem; }
    .calc-vhead-txt { min-width: 0; flex: 1 1 100%; }
    .calc-vhead-h { font-size: 1.05rem; }
    .calc-vhead-amt {
        flex: 1 1 100%;
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 0.6rem;
        font-size: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.25);
        padding-top: 0.75rem;
        margin-top: 0.15rem;
    }
    .calc-vhead-amt small { display: inline; margin-top: 0; }
    .calc-links-grid { grid-template-columns: 1fr; }
}
