/* ============================================================
   HELLOBOOK CALC — CSS completamente encapsulado
   Todos los selectores usan .hellobook-calc como prefijo.
   NINGÚN estilo afecta al resto del sitio web.
============================================================ */

/* Variables locales (no :root para no contaminar) */
.hellobook-calc {
    --hb-yellow: #f4c430;
    --hb-yellow-soft: #fff4cc;
    --hb-white: #ffffff;
    --hb-gray-50: #f9fafb;
    --hb-gray-100: #f3f4f6;
    --hb-gray-300: #d1d5db;
    --hb-gray-600: #4b5563;
    --hb-gray-800: #1f2937;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: var(--hb-gray-800);

    /* Anti-passepartout: sin fondo, sin borde, sin sombra, sin margen exterior */
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.hellobook-calc *, .hellobook-calc *::before, .hellobook-calc *::after {
    box-sizing: border-box;
}

/* ── Títulos ── */
.hellobook-calc h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--hb-gray-800);
}

/* ── Tabla principal ── */
.hellobook-calc .main-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.hellobook-calc .main-table th {
    background: var(--hb-gray-800);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px;
    border: none;
}

.hellobook-calc .main-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--hb-gray-300);
}

.hellobook-calc .main-table .sec td {
    background: linear-gradient(90deg, var(--hb-yellow), var(--hb-yellow-soft));
    color: var(--hb-gray-800);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
}

.hellobook-calc .main-table .lbl {
    background: var(--hb-gray-50);
    font-weight: 600;
    color: var(--hb-gray-600);
}

.hellobook-calc .main-table .total td {
    background: var(--hb-gray-100);
    font-weight: 700;
}

.hellobook-calc .main-table .net-row td {
    background: linear-gradient(90deg, var(--hb-yellow), #ffd966);
    font-size: 13px;
    font-weight: 800;
    color: var(--hb-gray-800);
}

.hellobook-calc .main-table .net-row input {
    color: var(--hb-gray-800) !important;
}

.hellobook-calc .main-table .big-divider td {
    background: linear-gradient(90deg, #111827, #374151);
    color: #ffffff;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 14px;
    border-top: 4px solid var(--hb-yellow);
    border-bottom: 4px solid var(--hb-yellow);
}

/* 5ª columna (Unidad/Lógica) */
.hellobook-calc .main-table tbody td:nth-child(5) {
    background: #fffdf0;
    font-weight: 600;
}

/* ── Inputs ── */
.hellobook-calc input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: right;
    font-size: 11px;
    color: var(--hb-gray-800);
}

.hellobook-calc input.edit {
    background: var(--hb-yellow-soft);
    border-radius: 6px;
    padding: 6px;
    border: 1px solid var(--hb-yellow);
    font-weight: 600;
}

.hellobook-calc input.read {
    pointer-events: none;
    font-weight: 700;
}

/* ── Summary box (sin fondo) ── */
.hellobook-calc .summary-box {
    width: 100%;
    padding: 20px 0;
    background: transparent;
    overflow: hidden;
}

.hellobook-calc .summary-box h3 {
    margin: 0 0 16px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--hb-gray-800);
}

/* ── Simulation controls ── */
.hellobook-calc .simulation-controls {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 30px auto;
}

.hellobook-calc .scenario-section-box {
    flex: 1;
    min-width: 320px;
    margin: 0;
    padding: 10px 15px;
    border: 1px solid #f1e3a0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fffdf5, #ffffff);
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.hellobook-calc .scenario-section-box .scenario-title {
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--hb-gray-800);
}

.hellobook-calc .scenario-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.hellobook-calc .sc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 4px 10px;
    background: #ffffff;
    border: 1px solid #f3e7b0;
    border-radius: 10px;
}

.hellobook-calc .sc-item .sc-label {
    font-size: 11px;
    font-weight: 600;
    min-width: 60px;
}

.hellobook-calc .sc-item input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 50px;
    max-width: 150px;
    height: 4px;
    background: linear-gradient(90deg, var(--hb-yellow), #ffe48f);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    border: none;
    padding: 0;
    text-align: left;
}

.hellobook-calc .sc-item input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 10px;
}

.hellobook-calc .sc-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hb-gray-800);
    border: 2px solid var(--hb-yellow);
    margin-top: -5px;
    transition: all .15s ease;
}

.hellobook-calc .sc-item input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.hellobook-calc .sc-item input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hb-gray-800);
    border: 2px solid var(--hb-yellow);
}

.hellobook-calc .slider-value {
    font-weight: 800;
    font-size: 12px;
    min-width: 40px;
    text-align: center;
    color: var(--hb-gray-800);
}

/* ── Triple summary cards ── */
.hellobook-calc .triple-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-bottom: 24px;
}

@media (max-width: 1000px) {
    .hellobook-calc .triple-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .hellobook-calc .triple-summary {
        grid-template-columns: 1fr;
    }
    .hellobook-calc .summary-box {
        padding: 15px 10px;
    }
}

.hellobook-calc .summary-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    text-align: center;
}

.hellobook-calc .summary-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
}

.hellobook-calc .summary-card .desc {
    font-size: 11px;
    color: #555;
    margin-bottom: 12px;
}

.hellobook-calc .summary-card table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 6px;
}

.hellobook-calc .summary-card th {
    font-size: 10px;
    background: #1f2937;
    color: #fff;
    padding: 6px;
    border-radius: 6px;
}

.hellobook-calc .summary-card td {
    background: linear-gradient(90deg, #f4c430, #ffd966);
    font-size: 16px;
    font-weight: 900;
    padding: 12px 6px;
    border-radius: 10px;
}

.hellobook-calc .summary-card.highlight {
    background: linear-gradient(135deg, #fff6d1, #ffffff);
    border: 2px solid #f4c430;
}

.hellobook-calc .summary-card small {
    display: block;
    margin-top: 10px;
    font-size: 10px;
    color: #666;
}

.hellobook-calc .card-detail-list {
    font-size: 11px;
    margin-bottom: 8px;
    color: #555;
}

/* ── Separador ── */
.hellobook-calc .table-divider {
    border: none;
    height: 4px;
    background: linear-gradient(to right, transparent, #9ca3af, transparent);
    margin: 50px 0;
}

/* ── Comparativa ── */
.hellobook-calc .comparison-container {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.hellobook-calc .comparison-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--hb-gray-800);
    margin-bottom: 20px;
}

.hellobook-calc .comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.hellobook-calc .comparison-table th,
.hellobook-calc .comparison-table td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.hellobook-calc .comparison-table th {
    background: #f8f9fa;
    color: var(--hb-gray-800);
    font-weight: 600;
}

.hellobook-calc .comparison-table th:first-child,
.hellobook-calc .comparison-table td:first-child {
    text-align: left;
    padding-left: 24px;
    color: var(--hb-gray-600);
    width: 30%;
}

.hellobook-calc .comparison-table th:not(:first-child),
.hellobook-calc .comparison-table td:not(:first-child) {
    text-align: center;
    width: 22%;
}

.hellobook-calc .comparison-table tr:hover {
    background-color: #fcfcfc;
}

.hellobook-calc .col-p { border-bottom: 3px solid #e74c3c !important; }
.hellobook-calc .col-b { border-bottom: 3px solid #3498db !important; }
.hellobook-calc .col-o { border-bottom: 3px solid #27ae60 !important; }

/* ── Interpretación ── */
.hellobook-calc .interpretacion-box {
    background: #fff8db;
    border-left: 6px solid #f4c430;
    padding: 20px;
    margin-top: 25px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
}

/* ── Gráficas ── */
.hellobook-calc .grafico-box {
    display: none;
}

.hellobook-calc .chart-highlight {
    background: linear-gradient(135deg, #fcfaf2, #ffffff);
    border: 2px solid #ffdb70;
    max-width: 950px;
    margin: 0 auto 50px;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    height: 380px;
    position: relative;
    overflow: hidden;
}

.hellobook-calc .chart-highlight canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ── Botón reset ── */
.hellobook-calc .reset-btn {
    margin-bottom: 20px;
    padding: 10px 18px;
    background: #1f2937;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
}

.hellobook-calc .reset-btn:hover {
    background: #111827;
    transform: translateY(-1px);
}

.hellobook-calc .reset-btn:active {
    transform: translateY(0);
}

/* ── Currency label ── */
.hellobook-calc .summary-header .currency-label {
    display: block;
    font-size: 12px;
    font-weight: normal;
    color: #252525;
    text-align: center;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
