/* Base & Vars */
:root {
    --calc-primary: #00abc7;
    --calc-primary-hover: #149fb5;
    --calc-bg: #ffffff;
    --calc-bg-secondary: #f8f9fa;
    --calc-border: #dddddd;
    --calc-text: #333333;
    --calc-text-muted: #666666;
    --calc-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --calc-radius: 12px;
}

#calc.calculator {
    max-width: 1100px;
    min-height: 520px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--calc-bg);
    border-radius: var(--calc-radius);
    box-shadow: var(--calc-shadow);
    color: var(--calc-text);
    font-family: system-ui, -apple-system, sans-serif;
}

/* Layout */
#calc .calculator-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

#calc .totals-column {
    position: sticky;
    top: 2rem;
}

/* Headings */
#calc .section-heading {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
}

/* Toggle */
#calc .toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0 auto 2rem;
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    background: var(--calc-bg-secondary);
    border: 1px solid #e9ecef;
    width: fit-content;
}

#calc .toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: #99dde9;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#calc .toggle-switch.active {
    background: var(--calc-primary);
}

#calc .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#calc .toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

#calc .toggle-label {
    user-select: none;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--calc-text-muted);
}

#calc .toggle-label.active {
    color: var(--calc-primary);
    background: #dff3f6;
    font-weight: 700;
}

/* Plans */
#calc .plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Items */
#calc .item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--calc-border);
    border-radius: var(--calc-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

#calc .item:hover:not(.not-available) {
    border-color: var(--calc-primary);
    box-shadow: 0 2px 8px rgba(0, 171, 199, 0.12);
    transform: translateY(-1px);
}

/* Selected / Principal States */
#calc .item.selected,
#calc .item.principal {
    background-color: var(--calc-primary);
    border-color: var(--calc-primary);
    color: white;
}

#calc .item.selected label,
#calc .item.principal label {
    color: white;
}

#calc .item.selected .price-indicator {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Disabled State */
#calc .item.not-available {
    background: #f9f9f9;
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #eee;
}

/* Radio Specifics */
#calc .item[data-type="radio"] {
    justify-content: center;
    text-align: center;
    min-height: 60px;
    padding: 0;
    align-items: stretch;
}

#calc .item[data-type="radio"] label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 100%;
    height: auto;
}

/* Checkbox Layout */
#calc .item[data-type="checkbox"] {
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* Text & Labels */
#calc .item label {
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: inherit;
    font-size: 1rem;
    line-height: 1.4;
}

#calc .price-indicator {
    font-size: 0.85rem;
    color: var(--calc-text-muted);
    background: var(--calc-bg-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    width: fit-content;
    margin-top: 0.25rem;
}

/* Inputs */
#calc .hidden-checkbox,
#calc input[type="radio"] {
    appearance: none;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#calc input[type="number"] {
    width: 70px;
    padding: 0.4rem;
    border: 1px solid var(--calc-border);
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
}

/* Groups */


#calc .features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Totals */
#calc .totals-container {
    background: var(--calc-bg-secondary);
    border: 1px solid var(--calc-border);
    border-radius: var(--calc-radius);
    padding: 1.5rem;
}

#calc #tPrincipal {
    font-size: 2rem;
    font-weight: 700;
    color: var(--calc-primary);
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
}

#calc #secondaryInfo {
    display: block;
    margin-bottom: 1rem;
    color: var(--calc-text-muted);
    font-size: 0.9rem;
}

#calc .pago-unico {
    background: rgba(0, 171, 199, 0.05);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

#calc .descuento-mensaje {
    margin-top: 1rem;
    background: #dff3f6;
    border: 1px solid #61cfe0;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    color: #005d70;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Empty State / Select Plan Message */
#calc .select-plan-message {
    text-align: center;
    padding: 2rem;
    color: var(--calc-text-muted);
    font-style: italic;
    background: var(--calc-bg-secondary);
    border: 1px dashed var(--calc-border);
    border-radius: var(--calc-radius);
}

#calc .text-center {
    text-align: center;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

#calc .shake-animation {
    animation: shake 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 900px) {
    #calc .calculator-layout {
        grid-template-columns: 1fr;
    }

    #calc .totals-column {
        position: static;
        order: -1;
        /* Mover totales arriba en móvil */
    }

    #calc .plans-grid {
        grid-template-columns: 1fr;
        /* Stackear planes verticalmente */
    }

    #calc .item {
        margin-bottom: 0.75rem;
    }
}