/* ==============================================================================
   MUCHOSPACIENTES.ES - CALCULADORA DE PRESUPUESTO INTERACTIVA
   ============================================================================== */

.calculator-section {
    padding: 80px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.calculator-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.calculator-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}

.calculator-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 165, 122, 0.12);
    color: #38A57A;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 15px;
    border: 1px solid rgba(56, 165, 122, 0.25);
}

.calculator-title {
    color: var(--primary, #071939);
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.25;
}

.calculator-subtitle {
    color: var(--text-muted, #475569);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Layout Principal a 1 Sola Columna: Configuración arriba, Resumen abajo */
.calc-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
}

.calc-config-column {
    width: 100%;
}

.calc-summary-column {
    width: 100%;
    margin-top: 15px;
    position: static;
}

/* Pasos / Bloques de Configuración */
.calc-step {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 26px 28px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(7, 25, 57, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.calc-step:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 25px rgba(7, 25, 57, 0.05);
}

.calc-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.calc-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #071939);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
}

.calc-step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary, #071939);
    margin: 0;
}

.calc-step-desc {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin-left: auto;
}

/* Period Switch (Anual vs Mensual) */
.calc-billing-toggle {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    width: 100%;
}

.calc-billing-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.calc-billing-btn.active {
    background: #ffffff;
    color: var(--primary, #071939);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.calc-billing-save {
    background: #38A57A;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* Modality Toggle (Outsource vs Insource) */
.calc-modality-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 640px) {
    .calc-modality-toggle {
        grid-template-columns: 1fr;
    }
}

.calc-modality-btn {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.calc-modality-btn:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(7, 25, 57, 0.05);
}

.calc-modality-btn.active {
    border-color: #38A57A;
    background: rgba(56, 165, 122, 0.03);
    box-shadow: 0 6px 20px rgba(56, 165, 122, 0.12);
}

.calc-modality-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.calc-modality-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--primary, #071939);
}

.calc-modality-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 50px;
    background: rgba(56, 165, 122, 0.12);
    color: #2b5c49;
}

.calc-modality-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0;
}

/* Radio Cards (Planes base y Mantenimiento) */
.calc-radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.calc-radio-card {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calc-radio-card:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
}

.calc-radio-card.selected {
    border-color: #38A57A;
    background: rgba(56, 165, 122, 0.02);
    box-shadow: 0 4px 15px rgba(56, 165, 122, 0.12);
}

.calc-radio-card input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.calc-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary, #071939);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calc-card-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
}

.calc-radio-card.selected .calc-card-tag {
    background: rgba(56, 165, 122, 0.15);
    color: #2b5c49;
}

.calc-card-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary, #071939);
    margin-bottom: 8px;
}

.calc-card-price small {
    font-size: 0.75rem;
    font-weight: normal;
    color: #64748b;
}

.calc-card-features {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    list-style: none;
}

.calc-card-features li {
    margin-bottom: 4px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.calc-card-features li span {
    color: #38A57A;
    font-weight: 800;
}

/* Social Pack Cards (Redes Sociales) */
.calc-social-pack-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.calc-social-pack-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 18px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.calc-social-pack-card:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(7, 25, 57, 0.06);
}

.calc-social-pack-card.selected,
.calc-social-pack-card.active {
    border-color: #38A57A;
    background: rgba(56, 165, 122, 0.03);
    box-shadow: 0 6px 20px rgba(56, 165, 122, 0.12);
}

/* Complementarios: Grid y Cards */
.calc-addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.calc-addon-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.calc-addon-item:hover {
    border-color: #cbd5e1;
}

.calc-addon-item.active {
    border-color: #38A57A;
    background: rgba(56, 165, 122, 0.02);
}

.calc-addon-info {
    flex: 1;
}

.calc-addon-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary, #071939);
    margin-bottom: 4px;
}

.calc-addon-desc {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.35;
}

.calc-addon-price {
    font-size: 0.88rem;
    font-weight: 800;
    color: #071939;
    white-space: nowrap;
}

.calc-addon-price small {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: normal;
}

/* Toggle Checkbox para Setups */
.calc-toggle-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.calc-toggle-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #38A57A;
}

/* Stepper de Cantidad (+ / -) */
.calc-stepper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.calc-stepper-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: var(--primary, #071939);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calc-stepper-btn:hover:not(:disabled) {
    background: #38A57A;
    color: #ffffff;
    border-color: #38A57A;
}

.calc-stepper-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.calc-stepper-val {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary, #071939);
    min-width: 24px;
    text-align: center;
}

/* Casilla de Añadir para Addons Complementarios (alineada igual que el stepper) */
.calc-addon-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}

.calc-addon-action .calc-toggle-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary, #071939);
    user-select: none;
    padding: 3px 0;
}

.calc-addon-action .calc-toggle-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #38A57A;
    margin: 0;
}

/* Items no incluidos en comparativa de mantenimiento */
.calc-maintenance-not-included {
    color: #94a3b8 !important;
}

.calc-maintenance-not-included .calc-cross-icon {
    color: #e11d48 !important;
    font-weight: 900;
    margin-right: 6px;
    display: inline-block;
}

/* ==============================================================================
   DESPLEGABLE DE MANTENIMIENTO (DEBAJO DE COMPLEMENTARIOS)
   ============================================================================== */
.calc-maintenance-dropdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(7, 25, 57, 0.03);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.calc-maintenance-dropdown[open] {
    border-color: #38A57A;
    box-shadow: 0 8px 25px rgba(56, 165, 122, 0.1);
}

.calc-maintenance-summary {
    list-style: none;
    cursor: pointer;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: #ffffff;
    user-select: none;
    transition: background-color 0.2s ease;
}

.calc-maintenance-summary::-webkit-details-marker {
    display: none;
}

.calc-maintenance-summary:hover {
    background-color: #f8fafc;
}

.calc-maintenance-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.calc-maintenance-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(56, 165, 122, 0.12);
    color: #38A57A;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calc-maintenance-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary, #071939);
    margin: 0 0 3px 0;
}

.calc-maintenance-subtitle {
    font-size: 0.86rem;
    color: #64748b;
    margin: 0;
}

.calc-maintenance-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calc-maintenance-badge {
    background: rgba(56, 165, 122, 0.15);
    color: #2e8b63;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.calc-maintenance-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.calc-maintenance-dropdown[open] .calc-maintenance-arrow {
    transform: rotate(180deg);
    background: #38A57A;
    color: #ffffff;
}

.calc-maintenance-body {
    padding: 0 26px 26px 26px;
    border-top: 1px solid #f1f5f9;
    background: #fafcff;
}

.calc-maintenance-intro {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.55;
    margin: 18px 0 16px 0;
}

.calc-maintenance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 15px;
    margin-top: 12px;
}

.calc-maintenance-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calc-maintenance-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(7, 25, 57, 0.04);
}

.calc-maintenance-item-icon {
    color: #38A57A;
    font-weight: 900;
    font-size: 1.15rem;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.calc-maintenance-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary, #071939);
    margin-bottom: 4px;
}

.calc-maintenance-item-desc {
    font-size: 0.83rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0;
}

/* Panel de Resumen de Cotización (1 Sola Columna al Final) */
.calc-summary-card {
    background: #071939;
    color: #ffffff;
    border-radius: 16px;
    padding: 34px 30px;
    position: static;
    top: auto;
    z-index: 1;
    box-shadow: 0 20px 45px rgba(7, 25, 57, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-height: none;
    overflow-y: visible;
    width: 100%;
}

.calc-summary-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calc-summary-subtitle {
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 22px;
    line-height: 1.5;
}

.calc-summary-items {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 16px 0;
    margin-bottom: 22px;
    max-height: none;
    overflow-y: visible;
}

.calc-summary-items::-webkit-scrollbar {
    width: 4px;
}
.calc-summary-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.calc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.83rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.85);
}

.calc-summary-row:last-child {
    margin-bottom: 0;
}

.calc-summary-row strong {
    color: #ffffff;
}

.calc-summary-row .price {
    font-weight: 700;
    white-space: nowrap;
    color: #ffffff;
}

.calc-row-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 68%;
}

.calc-row-label {
    font-weight: 700;
    color: #ffffff;
    font-size: 0.86rem;
    line-height: 1.35;
}

.calc-row-brief {
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 6px;
    border-radius: 4px;
    border-left: 2px solid #38A57A;
    margin-top: 3px;
}

/* Bloques de Totales */
.calc-total-block,
.calc-onetime-block {
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 14px;
}

.calc-total-recurring,
.calc-total-onetime {
    font-size: 1.65rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.15;
    margin: 6px 0 4px;
}

.calc-total-recurring small,
.calc-total-onetime small {
    font-size: 0.78rem;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-top: 3px;
}

.calc-tax-note {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 8px;
    line-height: 1.45;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    padding-top: 8px;
}

/* Espacio de respiración amplio entre el total y el botón de solicitar presupuesto */
.calc-summary-actions {
    margin-top: 34px; /* Espacio de respiración amplio y despejado */
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calc-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    background: #25D366;
    color: #ffffff !important;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.96rem;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.25);
}

.calc-btn-primary:hover {
    background: #1eb956;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    color: #ffffff !important;
}

.calc-btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    background: #25D366;
    color: #ffffff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.calc-btn-whatsapp:hover {
    background: #1eb956;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
    color: #ffffff;
}

.calc-guarantee-note {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

/* Páginas dedicadas exclusivamente a la calculadora */
html:has(body.page-calculator),
body.page-calculator {
    background-color: #f8fafc;
    overflow-x: hidden !important;
    max-width: 100vw;
}

body.page-calculator .header {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.page-calculator .header .nav-menu a {
    color: var(--text-dark, #1e293b) !important;
}

body.page-calculator .header .nav-menu a:hover,
body.page-calculator .header .nav-menu a.active {
    color: var(--primary, #071939) !important;
}

/* Menú hamburguesa visible en la cabecera blanca de la calculadora */
body.page-calculator .mobile-toggle:not(.active) span {
    background-color: var(--primary, #071939) !important;
}

/* Al abrir el menú drawer, volver la cabecera transparente para que no tape la pantalla */
body.page-calculator .header.menu-open {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.page-calculator .header.menu-open .mobile-toggle span,
body.page-calculator .mobile-toggle.active span {
    background-color: #ffffff !important;
}

/* Enlaces del drawer móvil y tablet en páginas de calculadora: 100% legibles en blanco */
@media (max-width: 1024px) {
    body.page-calculator .nav-right.mobile-active .nav-menu a,
    body.page-calculator .nav-right.mobile-active .nav-menu .dropdown > a {
        color: #ffffff !important;
    }

    body.page-calculator .nav-right.mobile-active .nav-menu a:hover,
    body.page-calculator .nav-right.mobile-active .nav-menu .dropdown > a:hover {
        color: #ffffff !important;
        opacity: 0.85;
    }

    body.page-calculator .nav-right.mobile-active .dropdown-content a {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    body.page-calculator .nav-right.mobile-active .dropdown-content a.dropdown-configurar {
        color: #4ade80 !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
}

body.page-calculator .calculator-section {
    padding-top: 130px;
    padding-bottom: 90px;
    min-height: 85vh;
}

/* Opciones de 3 botones de período para Packs */
.calc-billing-toggle.three-btns .calc-billing-btn {
    font-size: 0.82rem;
    padding: 8px 10px;
}


/* Modal Pop-up para Solicitar Presupuesto */
.calc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 25, 57, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.calc-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.calc-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 35px 30px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.calc-modal-backdrop.active .calc-modal {
    transform: translateY(0) scale(1);
}

.calc-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.calc-modal-close:hover {
    background: #e2e8f0;
    color: var(--primary, #071939);
}

.calc-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.calc-modal-header {
    text-align: center;
    margin-bottom: 22px;
}

.calc-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary, #071939);
    margin-bottom: 8px;
}

.calc-modal-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted, #64748b);
    line-height: 1.45;
    margin: 0;
}

.calc-modal-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 22px;
}

.calc-modal-summary-header {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary, #071939);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.calc-modal-summary-preview {
    font-size: 0.82rem;
    color: #334155;
    line-height: 1.5;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 5px;
}

.calc-modal-field {
    margin-bottom: 22px;
}

.calc-modal-field label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary, #071939);
    margin-bottom: 8px;
}

.calc-modal-field input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--primary, #071939);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.calc-modal-field input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.calc-modal-submit-btn {
    width: 100%;
    padding: 15px;
    background: #25D366;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.calc-modal-submit-btn:hover {
    background: #1eb956;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}

/* Selector de Plataforma (Google Ads vs Meta Ads) */
.calc-platform-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.calc-platform-btn {
    border: 2px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--primary, #071939);
}

.calc-platform-btn:hover {
    border-color: #94a3b8;
    transform: translateY(-2px);
}

.calc-platform-btn.active {
    border-color: var(--primary, #071939);
    background: rgba(7, 25, 57, 0.03);
    box-shadow: 0 4px 15px rgba(7, 25, 57, 0.08);
}

/* SECCIÓN INFORMATIVA DE PRESUPUESTO PERSONALIZADO DEBAJO DE LA CALCULADORA */
.custom-budget-section {
    background-color: #f8fafc;
    padding: 85px 20px 95px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.custom-budget-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg, 16px);
    padding: 50px 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.custom-budget-title {
    color: var(--primary, #071939);
    font-weight: 800;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.custom-budget-desc {
    color: var(--text-muted, #64748b);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* ==============================================================================
   VERSIÓN TABLET CALCULADORA (768px a 1024px) - MAYOR AMPLITUD Y VISIBILIDAD
   ============================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .calculator-section {
        padding: 70px 24px;
    }

    .calculator-wrapper.container,
    .calculator-wrapper {
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .calc-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .calc-summary-column {
        max-width: 100%;
        margin: 0 auto;
        width: 100%;
    }

    .calc-summary-card {
        position: static !important;
        top: auto !important;
        max-height: none !important;
        width: 100%;
    }

    .calc-step {
        padding: 30px 32px;
    }

    .calc-radio-cards {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 16px;
    }

    .calc-addons-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 16px;
    }

    .custom-budget-card {
        max-width: 100%;
        padding: 45px 30px;
    }
}

/* ==============================================================================
   VERSIÓN MÓVIL CALCULADORA (max-width: 768px) - AJUSTE PERFECTO DE ANCHO
   ============================================================================== */
@media (max-width: 768px) {
    html:has(body.page-calculator),
    body.page-calculator {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .calculator-section {
        padding: 40px 12px 60px !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    body.page-calculator .calculator-section {
        padding-top: 105px !important;
        padding-bottom: 50px !important;
    }

    .calculator-wrapper.container,
    .calculator-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .calculator-header {
        margin-bottom: 25px;
        padding: 0 8px;
    }

    .calculator-title {
        font-size: clamp(1.35rem, 5.2vw, 1.7rem) !important;
        line-height: 1.3 !important;
        word-break: break-word;
        overflow-wrap: break-word;
        margin-bottom: 10px;
    }

    .calculator-subtitle {
        font-size: 0.92rem !important;
        line-height: 1.5 !important;
    }

    .calc-grid {
        grid-template-columns: 1fr !important;
        gap: 22px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-step {
        padding: 18px 14px !important;
        border-radius: 12px;
        margin-bottom: 18px;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .calc-step-header {
        flex-wrap: wrap;
        gap: 8px 10px;
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .calc-step-title {
        font-size: 1rem !important;
    }

    .calc-step-desc {
        width: 100%;
        margin-left: 0;
        font-size: 0.78rem;
    }

    /* Selector de Duración de 3 botones (Packs) en Móvil: Apilado vertical elegante */
    .calc-billing-toggle.three-btns {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-billing-toggle.three-btns .calc-billing-btn {
        width: 100% !important;
        padding: 12px 14px !important;
        background: #f8fafc !important;
        border: 2px solid #e2e8f0 !important;
        border-radius: 10px !important;
        font-size: 0.86rem !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    .calc-billing-toggle.three-btns .calc-billing-btn.active {
        background: rgba(56, 165, 122, 0.05) !important;
        border-color: #38A57A !important;
        color: var(--primary, #071939) !important;
        box-shadow: 0 2px 10px rgba(56, 165, 122, 0.12) !important;
    }

    /* Selector de Duración de 2 botones (Web / Funnel / Anuncios) en Móvil */
    .calc-billing-toggle:not(.three-btns) {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-billing-toggle:not(.three-btns) .calc-billing-btn {
        width: 100% !important;
        padding: 12px 14px !important;
        background: #f8fafc !important;
        border: 2px solid #e2e8f0 !important;
        border-radius: 10px !important;
        font-size: 0.88rem !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    .calc-billing-toggle:not(.three-btns) .calc-billing-btn.active {
        background: rgba(56, 165, 122, 0.05) !important;
        border-color: #38A57A !important;
        color: var(--primary, #071939) !important;
        box-shadow: 0 2px 10px rgba(56, 165, 122, 0.12) !important;
    }

    /* Selector de Plataforma (Google Ads vs Meta Ads) en Móvil */
    .calc-platform-toggle {
        grid-template-columns: 1fr !important;
        gap: 10px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-platform-btn {
        padding: 13px !important;
        font-size: 0.88rem !important;
        justify-content: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tarjetas de Planes y Complementarios en Móvil */
    .calc-radio-cards {
        grid-template-columns: 1fr !important;
        gap: 12px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-radio-card {
        padding: 14px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .calc-addons-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-addon-item {
        padding: 14px 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .calc-addon-price {
        font-size: 0.85rem;
    }

    /* Resumen Lateral en Móvil: Flujo natural a ancho completo */
    .calc-summary-column {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .calc-summary-card {
        position: static !important;
        top: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        padding: 22px 16px !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .calc-summary-title {
        font-size: 1.15rem;
    }

    .calc-total-recurring,
    .calc-total-onetime {
        font-size: 1.45rem !important;
    }

    .calc-btn-primary {
        padding: 15px 16px !important;
        font-size: 0.92rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .calc-summary-row {
        gap: 8px;
    }

    .calc-summary-row > div:first-child,
    .calc-summary-row span:first-child {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Sección de Presupuesto Personalizado en Móvil */
    .custom-budget-section {
        padding: 50px 12px 60px !important;
        box-sizing: border-box !important;
    }

    .custom-budget-card {
        padding: 35px 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .custom-budget-title {
        font-size: 1.25rem !important;
    }

    .custom-budget-desc {
        font-size: 0.92rem !important;
        margin-bottom: 22px;
    }

    /* Modal en Móvil */
    .calc-modal {
        padding: 26px 16px !important;
        width: 95% !important;
        max-width: 440px !important;
        box-sizing: border-box !important;
    }
}

/* Pantallas Muy Pequeñas (max-width: 380px) */
@media (max-width: 380px) {
    .calculator-section {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .calc-step {
        padding: 16px 10px !important;
    }

    .calc-summary-card {
        padding: 20px 12px !important;
    }
}

