/* =====================================================
   CALCULADORA DE CONSUMO — Modal de producto
   ===================================================== */

/* Overlay */
.calc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.60);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.calc-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.calc-modal-overlay.is-closing {
    opacity: 0;
    visibility: hidden;
}

/* Bloquear scroll del body */
body.calc-modal-open {
    overflow: hidden;
}

/* Contenedor del modal */
.calc-modal {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px 40px 32px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    transform: translateY(12px);
    transition: transform 0.3s ease;
    scroll-behavior: smooth;
}

.calc-modal-overlay.is-open .calc-modal {
    transform: translateY(0);
}

/* Botón cerrar */
.calc-modal__close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}
.calc-modal__close:hover { color: #222; }

/* Header */
.calc-modal__title {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px;
}

.calc-modal__intro {
    font-size: 13px;
    color: #666;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* Formulario */
.calc-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.calc-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 200px;
    min-width: 0;
}

.calc-field--hidden {
    display: none;
}

.calc-field label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.calc-field input[type="number"],
.calc-field select {
    height: 44px;
    padding: 0 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #222;
    background: #fff;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.calc-field select {
    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='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.calc-field input[type="number"]:focus,
.calc-field select:focus {
    outline: none;
    border-color: #D4191A;
    box-shadow: 0 0 0 3px rgba(212,25,26,0.10);
}

/* Ocultar flechas de input number */
.calc-field input[type="number"]::-webkit-inner-spin-button,
.calc-field input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}
.calc-field input[type="number"] { -moz-appearance: textfield; }

/* Error */
.calc-error {
    font-size: 13px;
    color: #D4191A;
    margin: -10px 0 12px;
}

/* Botón calcular */
.calc-modal__btn-calcular {
    display: block;
    width: 100%;
    height: 48px;
    background: #D4191A;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.calc-modal__btn-calcular:hover { background: #b31416; }
.calc-modal__btn-calcular:active { transform: scale(0.98); }

/* ── Resultado ───────────────────────────────────────── */
.calc-modal__resultado {
    margin-top: 28px;
    border-top: 1px solid #eee;
    padding-top: 24px;
}

.calc-resultado__tabla {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}

.calc-resultado__header {
    background: #f5f5f5;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: right;
}

.calc-resultado__fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid #f0f0f0;
}

.calc-resultado__concepto {
    font-size: 14px;
    color: #444;
}

.calc-resultado__valor strong {
    font-size: 22px;
    font-family: 'Syne', sans-serif;
    color: #D4191A;
}

.calc-resultado__valor span {
    font-size: 14px;
    color: #555;
    margin-left: 4px;
}

/* Aviso doble capa */
.calc-doble-capa {
    background: #fff8e1;
    border-left: 3px solid #f0a500;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    color: #6b4c00;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Nota disclaimer */
.calc-resultado__nota {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

/* ── Complementarios ─────────────────────────────────── */
.calc-modal__complementarios {
    margin-top: 24px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.calc-complementarios__titulo {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 0 0 14px;
}

.calc-complementarios__grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.calc-comp-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    width: calc(25% - 9px);
    min-width: 90px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 10px 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.calc-comp-card:hover {
    border-color: #D4191A;
    box-shadow: 0 2px 8px rgba(212,25,26,0.10);
}

.calc-comp-card__img {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
}
.calc-comp-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.calc-comp-card__nombre {
    font-size: 11px;
    color: #333;
    line-height: 1.3;
}

/* ── Botón de apertura en ficha ──────────────────────── */
.btn-calc-consumo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    background: #fff;
    color: #D4191A;
    border: 1px solid #D4191A;
    border-radius: 22px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-top: 12px;
    margin-bottom: 16px;
}
.btn-calc-consumo:hover {
    background: #D4191A;
    color: #fff;
}
.btn-calc-consumo svg {
    flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .calc-modal {
        padding: 28px 22px 24px;
    }
    .calc-form-row {
        flex-direction: column;
    }
    .calc-comp-card {
        width: calc(50% - 6px);
    }
}
