/* Модальное окно модификаторов */
.modifiers-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modifiers-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

.modifiers-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modifiers-modal-title {
    font-size: 1.6em;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.modifiers-modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modifiers-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Группы и модификаторы */
.modifier-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.modifier-group.required {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.modifier-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.modifier-group-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modifier-group-limit {
    font-size: 0.9em;
    color: #6c757d;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
}

.modifier-group-limit.reached {
    background: #dc3545;
    color: white;
}

.modifier-required-hint {
    font-size: 0.85em;
    color: #e53e3e;
    font-weight: normal;
    background: #fed7d7;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.modifiers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modifier-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.modifier-item:not(.disabled):hover {
    border-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.modifier-item.disabled {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.modifier-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modifier-name {
    font-weight: 500;
    color: #333;
    font-size: 1.05em;
}

.modifier-price {
    font-size: 0.95em;
}

.modifier-price.positive {
    color: #28a745;
    font-weight: bold;
}

.modifier-price.negative {
    color: #dc3545;
    font-weight: bold;
}

.modifier-price.free {
    color: #6c757d;
}

/* Стили для переключателя (когда max_per_item = 1) */
.modifier-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
}

.toggle-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-checkbox:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-checkbox:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-checkbox:disabled + .toggle-slider {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Стили для счетчика количества (когда max_per_item > 1) */
.modifier-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modifier-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
}

.quantity-btn:hover:not(:disabled) {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

.quantity-btn:disabled {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

.mod-quantity {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

.modifiers-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.modifiers-confirm-btn,
.modifiers-cancel-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modifiers-confirm-btn {
    background: #4CAF50;
    color: white;
}

.modifiers-confirm-btn:hover:not(:disabled) {
    background: #45a049;
}

.modifiers-confirm-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.modifiers-cancel-btn {
    background: #6c757d;
    color: white;
}

.modifiers-cancel-btn:hover {
    background: #5a6268;
}

/* Анимации */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 576px) {
    .modifiers-modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    .modifiers-modal-buttons {
        flex-direction: column;
    }
    
    .modifier-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .modifier-controls {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .modifier-group {
        padding: 15px;
    }
    
    .modifier-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .modifier-group-title {
        font-size: 1.1em;
    }
}