/* ==========================================
   CALCULADORA DE TARIFA (Sección Precios)
   Misma paleta que factopiaslu.min.css: rojo #eb464c / #dd4b39, grises #757575 / #333333
   ========================================== */
/* Modal con el mismo aspecto que la de suscripción (#modal-suscripcion en factopiaslu.min.css) */
#modal-calculadora .modal-content {
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
#modal-calculadora .modal-header {
    background: linear-gradient(90deg, #dd4b39 0%, #ffffff 100%);
    border-bottom: 1px solid #eeeeee;
}
#modal-calculadora .modal-header h5 {
    letter-spacing: -0.2px;
    line-height: 1.2;
}
#modal-calculadora .modal-body {
    padding: 24px;
}

/* Aspa roja corporativa */
.calc-cerrar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}
.calc-cerrar:hover {
    background-color: rgba(207, 45, 58, 0.1);
    transform: scale(1.1);
}
.calc-cerrar i {
    color: #cf2d3a;
    font-size: 1.15rem;
    padding-top: 3px;
    line-height: 1;
}

.calc-intro {
    color: #666666;
    font-size: 0.95rem;
    margin: 0 0 1.5rem 0;
}

/* Una columna en móvil, dos en escritorio */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.calc-opciones {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

/* Paquete básico (siempre incluido) */
.calc-fija {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background-color: #fdfdfd;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    color: #333333;
    font-weight: 600;
}
.calc-fija i {
    color: #eb464c;
}
.calc-fija small {
    color: #757575;
    font-weight: normal;
}
.calc-fija strong {
    color: #eb464c;
    white-space: nowrap;
}

/* Perfiles con barra + casilla numérica */
.calc-perfil {
    background-color: #f9f9f9;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}
.calc-perfil-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.75rem;
}
.calc-perfil-cabecera label {
    font-weight: 600;
    color: #333333;
    font-size: 0.95rem;
}
.calc-precio-unidad {
    color: #dd4b39;
    font-weight: bold;
    font-size: 0.85rem;
}

.calc-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.calc-numero {
    width: 5.5rem;
    flex-shrink: 0;
    text-align: center;
    font-weight: bold;
}
.calc-numero:focus {
    border-color: #eb464c;
    box-shadow: 0 0 0 0.2rem rgba(235, 70, 76, 0.2);
}

/* Barra deslizante con tramo recorrido en rojo (--progreso lo fija calculadora.js) */
.calc-rango {
    flex-grow: 1;
    min-width: 0;
    height: 6px;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #eb464c var(--progreso, 0%), #dddddd var(--progreso, 0%));
    cursor: pointer;
}
.calc-rango::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #eb464c;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.calc-rango::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #eb464c;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.calc-rango:focus-visible {
    outline: 2px solid #eb464c;
    outline-offset: 4px;
}

/* Módulos con interruptor */
.calc-subtitulo {
    font-size: 1rem;
    color: #333333;
    margin: 0.5rem 0 0 0;
}
.calc-modulo {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: #fdfdfd;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    padding: 0.9rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.calc-modulo:hover {
    border-color: #eb464c;
}
.calc-modulo .form-check-input {
    margin: 0;
    flex-shrink: 0;
}
.calc-modulo .form-check-input:checked {
    background-color: #eb464c;
    border-color: #eb464c;
}
.calc-modulo-txt {
    flex-grow: 1;
    color: #333333;
    font-weight: 600;
    font-size: 0.95rem;
}
.calc-modulo-precio {
    color: #eb464c;
    font-weight: bold;
    white-space: nowrap;
}
.calc-modulo-precio small {
    color: #757575;
    font-size: 0.75rem;
}

/* Resumen */
.calc-resumen {
    background-color: #f9f9f9;
    border: 1px solid #eeeeee;
    border-top: 4px solid #dd4b39;
    border-radius: 8px;
    padding: 1.5rem;
    align-self: start;
}
.calc-resumen h5 {
    font-size: 1.05rem;
    color: #333333;
    margin: 0 0 1rem 0;
}
.calc-desglose {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}
.calc-desglose li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    color: #555555;
    padding: 0.35rem 0;
    border-bottom: 1px dashed #e2e2e2;
}
.calc-desglose li.calc-linea-cero {
    color: #b5b5b5;
}
.calc-desglose li span:last-child {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.calc-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    color: #333333;
    font-weight: 600;
}
.calc-total span {
    white-space: nowrap;
}
.calc-total strong {
    font-size: 2rem;
    font-weight: 800;
    color: #eb464c;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}
.calc-iva {
    text-align: right;
    font-size: 0.8rem;
    color: #757575;
    margin: 0 0 1rem 0;
}
.calc-prueba {
    font-size: 0.88rem;
    color: #333333;
    background-color: #fff8f7;
    border-left: 3px solid #eb464c;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
}
.calc-prueba i {
    color: #eb464c;
}
.calc-cta {
    display: block;
    text-align: center;
    padding: 0.9rem 1rem;
    background-color: #eb464c;
}
.calc-cta:hover {
    background-color: #cf2d3a;
    color: #ffffff;
}
.calc-nota {
    font-size: 0.78rem;
    color: #757575;
    line-height: 1.4;
    margin: 1rem 0 0 0;
}

@media (min-width: 992px) {
    .calc-grid {
        grid-template-columns: 1.5fr 1fr;
    }
    .calc-resumen {
        position: sticky;
        top: 0; /* Se queda visible al hacer scroll dentro de la modal */
    }
}

/* Botón «Calcular mi tarifa» junto a «Suscribirse» en la tarjeta de FichBox (secundario: borde, sin relleno) */
.tarjeta-app-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.btn-calcular-tarifa {
    display: inline-block;
    background-color: #ffffff;
    color: #dd4b39;
    border: 2px solid #dd4b39;
    text-decoration: none;
    padding: calc(1rem - 2px) 2rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.05rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-calcular-tarifa:hover,
.btn-calcular-tarifa:focus-visible {
    background-color: #fdecea;
    color: #bf2327;
    border-color: #bf2327;
    transform: translateY(-2px);
}

/* Con los dos botones, un poco menos de relleno lateral para que quepan juntos (en el móvil se apilan) */
.tarjeta-app-pie .btn-abrir-modal {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.tarjeta-app-pie .btn-calcular-tarifa {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}
.calc-iva strong { color: #444444; font-weight: 700; }
