/* ============================================
   MODAL DE PERSONALIZACIÓN (UI PREMIUM)
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 17, 9, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeInBackdrop 0.25s ease;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal__content {
    background: white;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    border-radius: 32px;
    overflow: hidden;
    animation: modalSlideIn 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal__header {
    padding: 24px 28px;
    background: linear-gradient(135deg, #8B5A2B 0%, #6B3A1A 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal__header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal__close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.modal__body {
    padding: 28px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Opciones del modal */
.modal-opcion {
    margin-bottom: 24px;
}

.modal-opcion label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: #1A1109;
}

.modal-opcion select, .modal-opcion input {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #F0E8DC;
    border-radius: 16px;
    font-size: 0.9rem;
    background: #FDF9F2;
    transition: all 0.2s;
}

.modal-opcion select:focus, .modal-opcion input:focus {
    outline: none;
    border-color: #8B5A2B;
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

/* Selector de toppings con checkboxes */
.toppings-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topping-check {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F5EDE3;
    padding: 10px 18px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.topping-check:hover {
    background: #E8DCCE;
    transform: scale(1.02);
}

.topping-check input {
    width: auto;
    margin: 0;
}

.topping-check:has(input:checked) {
    background: linear-gradient(135deg, #8B5A2B 0%, #6B3A1A 100%);
    color: white;
}

/* Botones de variantes para cookies */
.variantes-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.variante-btn {
    flex: 1;
    padding: 14px;
    background: #F5EDE3;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.variante-btn.active {
    border-color: #8B5A2B;
    background: white;
    color: #8B5A2B;
    box-shadow: 0 4px 12px rgba(139, 90, 43, 0.15);
}

.variante-btn:hover:not(.active) {
    background: #E8DCCE;
    transform: translateY(-2px);
}

/* Selector de cantidad (unidad/media/docena) */
.modal-cantidad {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.cantidad-btn {
    flex: 1;
    padding: 14px 10px;
    border: 2px solid #F0E8DC;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.cantidad-btn small {
    display: block;
    font-size: 0.7rem;
    font-weight: normal;
    color: #6B5B4F;
    margin-top: 4px;
}

.cantidad-btn.active {
    background: linear-gradient(135deg, #8B5A2B 0%, #6B3A1A 100%);
    color: white;
    border-color: #8B5A2B;
}

.cantidad-btn.active small {
    color: rgba(255, 255, 255, 0.8);
}

.cantidad-btn:hover:not(.active) {
    border-color: #D4A574;
    transform: translateY(-2px);
}

/* Subtotal modal */
.modal-subtotal {
    text-align: right;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 24px 0 20px;
    padding-top: 20px;
    border-top: 2px solid #F0E8DC;
    color: #8B5A2B;
}

/* Acciones del modal */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.modal-actions .btn {
    flex: 1;
    padding: 14px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 480px) {
    .modal__header {
        padding: 18px 20px;
    }
    
    .modal__body {
        padding: 20px;
    }
    
    .modal-cantidad {
        flex-direction: column;
    }
    
    .cantidad-btn {
        padding: 12px;
    }
    
    .variantes-buttons {
        flex-direction: column;
    }
    
    .toppings-group {
        gap: 8px;
    }
    
    .topping-check {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}