/* ==========================================================================
   MÓDULO DE TARJETAS DE CRÉDITO 3D — DE CERO AL INFINITO
   Versión: 3.0 — Estilos mejorados + Calculadora de Recompensas
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════
   VARIABLES DE MARCA
   ══════════════════════════════════════════════════════════════ */
:root {
    --cc-rojo: #b30000;
    --cc-rojo-hover: #8a0000;
    --cc-dorado: #d4af37;
    --cc-dorado-hover: #b8962e;
    --cc-verde: #2e7d32;
    --cc-gris-texto: #555;
    --cc-gris-claro: #f5f5f5;
    --cc-gris-borde: #eaeaea;
    --cc-radio: 16px;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT DE CUADRÍCULA
   ══════════════════════════════════════════════════════════════ */
.cards-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px 30px;
    margin: 40px auto;
}

/* ══════════════════════════════════════════════════════════════
   CONTENEDOR 3D
   ══════════════════════════════════════════════════════════════ */
.card-3d-container {
    perspective: 1200px;
    width: 100%;
    margin: 0 auto;
}

.card-3d-inner {
    position: relative;
    width: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    min-height: 680px;
}

.card-3d-inner.is-flipped {
    transform: rotateY(180deg);
}

/* ══════════════════════════════════════════════════════════════
   CARAS DE LA TARJETA
   ══════════════════════════════════════════════════════════════ */
.card-front, .card-back {
    background: #fff;
    border-radius: var(--cc-radio);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border: 1px solid var(--cc-gris-borde);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-back {
    transform: rotateY(180deg);
    background: #fdfdfd;
    overflow-y: auto;
}

/* ══════════════════════════════════════════════════════════════
   FRENTE — HEADER
   ══════════════════════════════════════════════════════════════ */
.card-band {
    height: 6px;
    width: 100%;
    border-radius: var(--cc-radio) var(--cc-radio) 0 0;
}

.card-header-universal {
    display: flex;
    padding: 20px;
    gap: 15px;
    align-items: center;
    background: #fff;
}

.card-image-wrapper img {
    width: 100px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    object-fit: contain;
}

.card-title-area h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    color: #222;
    font-weight: 800;
    line-height: 1.2;
}

.emisor-red {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.red-sep { color: #ccc; }

.red-badge {
    font-weight: bold;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #333;
    font-size: 0.75rem;
}

.nivel-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--cc-dorado);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════
   FRENTE — PESTAÑAS DE PLANES
   ══════════════════════════════════════════════════════════════ */
.card-plan-tabs {
    display: flex;
    background: #fdfdfd;
    padding: 0 10px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.plan-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.plan-tab:hover { color: var(--cc-rojo); }
.plan-tab.active { color: var(--cc-rojo); border-bottom-color: var(--cc-rojo); }
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   FRENTE — CUERPO DE DATOS
   ══════════════════════════════════════════════════════════════ */
.card-body-dynamic {
    padding: 18px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Fila de datos genérica */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--cc-gris-claro);
}

.data-row-last { border-bottom: none !important; }

.data-label {
    font-size: 0.83rem;
    color: var(--cc-gris-texto);
    font-weight: 600;
}

.data-value {
    font-size: 0.93rem;
    font-weight: 800;
    color: #111;
    text-align: right;
}

.data-sub {
    display: block;
    font-size: 0.7rem;
    color: #888;
    font-weight: normal;
    margin-top: 2px;
    line-height: 1.2;
}

.valor-gratis {
    color: var(--cc-verde);
}

.sin-recompensa {
    color: #999;
    font-weight: 600;
}

.info-icon {
    color: var(--cc-dorado);
    margin-left: 4px;
    cursor: help;
    font-size: 0.85rem;
}

/* ══════════════════════════════════════════════════════════════
   FRENTE — CAJA DE RECOMPENSAS (NUEVO)
   ══════════════════════════════════════════════════════════════ */
.reward-box {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 6px 0;
}

.reward-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reward-modelo-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.modelo-cashback {
    background: #e8f5e9;
    color: var(--cc-verde);
    border: 1px solid #c8e6c9;
}

.modelo-puntos {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffecb3;
}

.modelo-millas {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* Base */
.reward-base {
    font-size: 0.82rem;
    color: #444;
    padding: 4px 0 6px;
    border-bottom: 1px dashed #e0e0e0;
    margin-bottom: 6px;
}

.reward-base-pct {
    font-weight: 800;
    font-size: 1rem;
    color: var(--cc-verde);
}

/* Categorías */
.reward-categorias {
    padding: 2px 0;
}

.reward-cat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.reward-cat-name {
    font-size: 0.78rem;
    color: #555;
    font-weight: 500;
}

.reward-cat-pct {
    font-size: 0.85rem;
    font-weight: 800;
    color: #222;
    background: #fff;
    border: 1px solid #ddd;
    padding: 1px 8px;
    border-radius: 4px;
    min-width: 42px;
    text-align: center;
}

.reward-cat-tope {
    font-size: 0.68rem;
    color: #999;
    padding: 0 0 2px;
    text-align: right;
}

/* Tope global */
.reward-tope-global {
    margin-top: 6px;
    padding: 5px 8px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    color: #e65100;
    text-align: center;
}

.reward-tope-global i {
    margin-right: 4px;
    font-size: 0.7rem;
}

/* ══════════════════════════════════════════════════════════════
   FRENTE — BILLETERAS DIGITALES
   ══════════════════════════════════════════════════════════════ */
.wallet-icons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.wallet-chip {
    font-size: 0.78rem;
    font-weight: 600;
    color: #333;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wallet-chip i {
    font-size: 1.1rem;
}

.wallet-no {
    font-size: 0.82rem;
    color: #aaa;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════════════
   FRENTE — BOTONES FOOTER
   ══════════════════════════════════════════════════════════════ */
.card-footer-actions {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
    border-radius: 0 0 var(--cc-radio) var(--cc-radio);
    margin-top: auto;
}

.btn-saber-mas {
    background: transparent;
    border: 2px solid var(--cc-rojo);
    color: var(--cc-rojo);
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-saber-mas:hover {
    background: var(--cc-rojo);
    color: #fff;
}

.btn-saber-mas i {
    margin-right: 4px;
    font-size: 0.75rem;
}

.btn-solicitar {
    background: var(--cc-dorado);
    color: #fff;
    border: 2px solid var(--cc-dorado);
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-solicitar:hover {
    background: var(--cc-dorado-hover);
    border-color: var(--cc-dorado-hover);
}

/* ══════════════════════════════════════════════════════════════
   REVERSO — HEADER
   ══════════════════════════════════════════════════════════════ */
.back-header {
    color: #fff;
    padding: 18px 20px;
    text-align: center;
    border-radius: var(--cc-radio) var(--cc-radio) 0 0;
}

.back-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.back-header p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════════
   REVERSO — CUERPO
   ══════════════════════════════════════════════════════════════ */
.back-body {
    padding: 20px;
    flex-grow: 1;
}

.detail-group {
    margin-bottom: 18px;
}

.detail-group h5 {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--cc-rojo);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.detail-group h5 i {
    margin-right: 6px;
    font-size: 0.8rem;
}

.detail-group p {
    margin: 0 0 5px;
    font-size: 0.83rem;
    color: #333;
    line-height: 1.45;
}

.detail-note {
    font-size: 0.78rem !important;
    color: #777 !important;
    background: #f8f8f8;
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 3px solid var(--cc-dorado);
    margin-top: 6px !important;
    line-height: 1.4 !important;
}

.detail-note i {
    color: var(--cc-dorado);
    margin-right: 4px;
}

.detail-exencion {
    font-size: 0.78rem;
    color: var(--cc-verde);
    font-style: italic;
}

.detail-comercios {
    font-size: 0.8rem !important;
    color: #555 !important;
}

.detail-no-disponible {
    color: #999 !important;
    font-style: italic;
}

/* Beneficios lista */
.bene-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.bene-list li {
    font-size: 0.83rem;
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    line-height: 1.35;
}

.bene-list i {
    color: var(--cc-dorado);
    margin-top: 3px;
    flex-shrink: 0;
}

.bene-desc {
    color: #666;
}

/* Etiquetas en reverso */
.etiquetas-reverso {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.etiqueta-chip {
    font-size: 0.72rem;
    font-weight: 600;
    background: #f5f5f5;
    color: #555;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
}

/* ══════════════════════════════════════════════════════════════
   REVERSO — FOOTER
   ══════════════════════════════════════════════════════════════ */
.back-footer {
    padding: 16px 20px;
    background: #fafafa;
    border-top: 1px solid #eee;
    border-radius: 0 0 var(--cc-radio) var(--cc-radio);
    margin-top: auto;
}

.btn-regresar {
    width: 100%;
    background: #eee;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
}

.btn-regresar:hover { background: #ddd; }

.btn-regresar i {
    margin-right: 4px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .cards-grid-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 10px;
    }

    .card-3d-inner {
        min-height: 720px;
    }

    .card-header-universal {
        padding: 16px;
    }

    .card-image-wrapper img {
        width: 80px;
    }

    .card-title-area h3 {
        font-size: 1.05rem;
    }

    .card-body-dynamic {
        padding: 14px 16px;
    }

    .reward-box {
        padding: 10px 12px;
    }

    .card-footer-actions {
        padding: 14px 16px;
    }
}

@media (max-width: 400px) {
    .cards-grid-layout {
        grid-template-columns: 1fr;
    }

    .card-3d-inner {
        min-height: 750px;
    }

    .emisor-red {
        font-size: 0.72rem;
    }

    .reward-cat-row {
        font-size: 0.75rem;
    }
}
/* ══════════════════════════════════════════════════════════════
   CALCULADORA DE RECOMPENSAS — Step 1
   ══════════════════════════════════════════════════════════════ */

.calc-container {
    max-width: 900px;
    margin: 0 auto 50px;
    background: #fff;
    border-radius: var(--cc-radio);
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    border: 1px solid var(--cc-gris-borde);
    overflow: hidden;
}

/* ── Header ── */
.calc-header {
    background: linear-gradient(135deg, var(--cc-rojo) 0%, #8a0000 100%);
    color: #fff;
    padding: 28px 30px 22px;
    text-align: center;
}

.calc-header h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.calc-header h2 i {
    margin-right: 8px;
    opacity: 0.9;
}

.calc-header p {
    margin: 0;
    font-size: 0.88rem;
    opacity: 0.85;
    font-weight: 400;
}

/* ── Body (inputs) ── */
.calc-body {
    padding: 28px 30px;
}

.calc-main-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.calc-main-input-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.calc-input-wrap {
    position: relative;
    flex: 1;
}

.calc-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: #888;
    pointer-events: none;
}

.calc-input-wrap input {
    width: 100%;
    padding: 14px 14px 14px 32px;
    font-size: 1.15rem;
    font-weight: 700;
    border: 2px solid #ddd;
    border-radius: 10px;
    color: #111;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.calc-input-wrap input:focus {
    outline: none;
    border-color: var(--cc-rojo);
    box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.1);
    background: #fff;
}

.calc-input-wrap input::placeholder {
    color: #bbb;
    font-weight: 500;
}

.calc-btn-principal {
    background: var(--cc-dorado);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc-btn-principal:hover {
    background: var(--cc-dorado-hover);
}

.calc-btn-principal:active {
    transform: scale(0.97);
}

.calc-btn-principal i {
    font-size: 1rem;
}

/* ── Error ── */
.calc-error {
    text-align: center;
    color: var(--cc-rojo);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 16px 20px;
    margin: 0;
}

.calc-error i {
    margin-right: 6px;
}

/* ══════════════════════════════════════════════════════════════
   RESULTADOS — Tabla
   ══════════════════════════════════════════════════════════════ */

.calc-resultados {
    padding: 0;
}

.calc-results-header {
    padding: 20px 30px 12px;
    border-top: 1px solid #eee;
}

.calc-results-header h3 {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #222;
}

.calc-results-header h3 i {
    color: var(--cc-dorado);
    margin-right: 8px;
}

.calc-results-sub {
    margin: 0;
    font-size: 0.83rem;
    color: #777;
}

/* Tabla wrapper para scroll horizontal en mobile */
.calc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.calc-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.calc-table thead th {
    padding: 10px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    border-bottom: 2px solid #eee;
    text-align: left;
    white-space: nowrap;
}

.calc-th-rank { width: 40px; text-align: center; }
.calc-th-card { }
.calc-th-reward { width: 120px; text-align: right; }
.calc-th-cost { width: 110px; text-align: right; }
.calc-th-net { width: 170px; }

/* ── Filas ── */
.calc-row td {
    padding: 12px 14px;
    font-size: 0.85rem;
    border-bottom: 1px solid #f2f2f2;
    vertical-align: middle;
}

.calc-row:last-child td {
    border-bottom: none;
}

.calc-row:hover {
    background: #fafafa;
}

.calc-row-top {
    background: #fffdf5;
}

.calc-row-top:hover {
    background: #fffbec;
}

.calc-row-neg td {
    opacity: 0.6;
}

.calc-row-zero td {
    opacity: 0.7;
}

/* ── Rank / Medalla ── */
.calc-td-rank {
    text-align: center;
    font-weight: 800;
    color: #999;
    font-size: 0.85rem;
}

.calc-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
}

.calc-medal-1 { background: var(--cc-dorado); }
.calc-medal-2 { background: #aaa; }
.calc-medal-3 { background: #cd7f32; }

/* ── Celda tarjeta ── */
.calc-card-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-card-thumb {
    width: 44px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.calc-card-name {
    display: block;
    font-weight: 700;
    font-size: 0.83rem;
    color: #222;
    line-height: 1.2;
}

.calc-plan-tag {
    font-size: 0.68rem;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Badges de tipo ── */
.calc-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.calc-badge-cash {
    background: #e8f5e9;
    color: var(--cc-verde);
}

.calc-badge-pts {
    background: #fff8e1;
    color: #f57f17;
}

.calc-badge-none {
    background: #f5f5f5;
    color: #aaa;
}

/* ── Columna Recompensa ── */
.calc-td-reward {
    text-align: right;
    white-space: nowrap;
}

.calc-reward-amount {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--cc-verde);
    cursor: default;
}

.calc-nota-icon {
    color: #ccc;
    font-size: 0.72rem;
    margin-left: 4px;
    cursor: help;
    transition: color 0.15s;
}

.calc-nota-icon:hover {
    color: var(--cc-dorado);
}

/* ── Columna Costo ── */
.calc-td-cost {
    text-align: right;
    white-space: nowrap;
}

.calc-costo-negativo {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--cc-rojo);
}

.calc-costo-cero {
    font-weight: 600;
    font-size: 0.85rem;
    color: #bbb;
}

/* ── Columna Neto ── */
.calc-net-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-net-amount {
    font-weight: 800;
    font-size: 0.95rem;
    color: #111;
}

.calc-net-neg {
    color: var(--cc-rojo);
}

/* Barra proporcional */
.calc-bar-track {
    width: 100%;
    height: 5px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.calc-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cc-dorado), #e6c758);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.calc-bar-fill-neg {
    background: linear-gradient(90deg, var(--cc-rojo), #ff6b6b);
    width: 0% !important;
}

/* ── Disclaimer ── */
.calc-disclaimer {
    font-size: 0.72rem;
    color: #999;
    padding: 14px 30px 20px;
    line-height: 1.5;
    border-top: 1px solid #f2f2f2;
    margin: 0;
}

.calc-disclaimer i {
    color: #ccc;
    margin-right: 4px;
}

/* ══════════════════════════════════════════════════════════════
   CALCULADORA — Panel de Categorías (Step 2)
   ══════════════════════════════════════════════════════════════ */

.calc-step-2 {
    margin-top: 16px;
}

.calc-toggle-cats {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-toggle-cats:hover {
    background: #f0f0f0;
    border-color: #ddd;
    color: #333;
}

.calc-toggle-cats.active {
    background: #fff;
    border-color: var(--cc-dorado);
    color: #333;
}

.calc-toggle-cats i:first-child {
    margin-right: 8px;
    color: var(--cc-dorado);
}

.calc-toggle-hint {
    font-weight: 400;
    font-size: 0.78rem;
    color: #aaa;
}

.calc-chevron {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: #aaa;
}

.calc-chevron.rotated {
    transform: rotate(180deg);
}

/* Panel colapsable */
.calc-cats-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease, opacity 0.25s ease;
    opacity: 0;
    padding: 0 16px;
    background: #fcfcfc;
    border: 1px solid transparent;
    border-radius: 0 0 10px 10px;
    margin-top: -1px;
}

.calc-cats-panel.open {
    max-height: 600px;
    opacity: 1;
    padding: 16px;
    border-color: #e8e8e8;
    border-top: none;
}

.calc-cats-intro {
    font-size: 0.78rem;
    color: #999;
    margin: 0 0 14px;
    line-height: 1.4;
}

/* Fila de categoría */
.calc-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f2;
}

.calc-cat-row:last-of-type {
    border-bottom: none;
}

.calc-cat-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: default;
}

.calc-cat-row label i {
    color: var(--cc-dorado);
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

.calc-cat-input-wrap {
    position: relative;
    width: 140px;
    flex-shrink: 0;
}

.calc-cat-input-wrap .calc-prefix {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: #aaa;
    pointer-events: none;
}

.calc-cat-input-wrap input {
    width: 100%;
    padding: 8px 10px 8px 26px;
    font-size: 0.88rem;
    font-weight: 600;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    text-align: right;
}

.calc-cat-input-wrap input:focus {
    outline: none;
    border-color: var(--cc-dorado);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

.calc-cat-input-wrap input::placeholder {
    color: #ccc;
    font-weight: 400;
}

/* Footer de categorías: resumen */
.calc-cats-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

.calc-cats-suma {
    font-size: 0.78rem;
    font-weight: 700;
    color: #666;
}

.calc-cats-resto {
    font-size: 0.78rem;
    font-weight: 600;
    color: #999;
}

.calc-cats-resto.calc-cats-warn {
    color: var(--cc-rojo);
    font-weight: 700;
}

/* Tag "con categorías" en resultados */
.calc-categ-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    background: #e8f5e9;
    color: var(--cc-verde);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.calc-categ-tag i {
    margin-right: 3px;
    font-size: 0.65rem;
}

/* ══════════════════════════════════════════════════════════════
   CALCULADORA RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .calc-container {
        margin: 0 auto 30px;
        border-radius: 12px;
    }

    .calc-header {
        padding: 22px 20px 18px;
    }

    .calc-header h2 {
        font-size: 1.15rem;
    }

    .calc-body {
        padding: 20px;
    }

    .calc-main-input-row {
        flex-direction: column;
        gap: 10px;
    }

    .calc-btn-principal {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    .calc-cat-input-wrap {
        width: 120px;
    }

    .calc-cats-footer {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .calc-results-header {
        padding: 16px 20px 10px;
    }

    .calc-table {
        min-width: 540px;
    }

    .calc-disclaimer {
        padding: 12px 20px 16px;
    }
}

@media (max-width: 400px) {
    .calc-header h2 {
        font-size: 1.05rem;
    }

    .calc-input-wrap input {
        font-size: 1rem;
    }

    .calc-table {
        min-width: 500px;
    }
}