/* === MODAL STYLES (from main.css) === */

/* === COMBO MODAL ANIMATIONS === */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0; 
        transform: scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

@keyframes pulseSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Анимация для переходов между видами */
.modal-view-transition {
    animation: fadeIn 0.3s ease-out;
}

.combo-image-transition {
    animation: slideInLeft 0.3s ease-out;
}

.product-selection-transition {
    animation: slideInRight 0.3s ease-out;
}

/* Анимация для карточек товаров */
.modal-selection-item {
    transition: all 0.2s ease;
    opacity: 0;
    animation: scaleIn 0.25s ease-out forwards;
}


/* Анимация для успешного выбора */
.modal-selection-item.success-animation {
    animation: pulseSuccess 0.4s ease-out;
}

/* Анимация для карточек комбо */
.combo-item-card {
    transition: all 0.3s ease;
}

.combo-item-card.newly-added {
    animation: slideInLeft 0.3s ease-out;
    animation-fill-mode: both;
}

/* Анимация для кнопки добавления в корзину */
.combo-add-to-cart {
    transition: all 0.2s ease;
}

.combo-add-to-cart:not(.disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.combo-add-to-cart.success-pulse {
    animation: pulseSuccess 0.5s ease-out;
}

/* Плавный переход для галочек */
.selection-badge {
    animation: scaleIn 0.2s ease-out;
}

/* === LOADING SPINNER === */
.modal-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 107, 53, 0.1);
    border-top: 3px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* === LOADING PLACEHOLDERS === */
.modal-selection-loading {
    padding: 20px;
    position: relative;
}

.modal-selection-loading .modal-loading-spinner {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-selection-loading .product-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.product-placeholder-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    filter: blur(2px);
    opacity: 0.6;
    animation: placeholderPulse 1.5s ease-in-out infinite;
}

.product-placeholder-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    margin-bottom: 10px;
    animation: shimmer 1.5s ease-in-out infinite;
}

.product-placeholder-name {
    height: 16px;
    background: linear-gradient(90deg, #cbd5e1 25%, #e2e8f0 50%, #cbd5e1 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    margin-bottom: 8px;
    animation: shimmer 1.5s ease-in-out infinite;
}

.product-placeholder-price {
    height: 12px;
    width: 60%;
    background: linear-gradient(90deg, #cbd5e1 25%, #e2e8f0 50%, #cbd5e1 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes placeholderPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.4; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* === CATEGORY LOADING PLACEHOLDERS === */
.category-loading-container {
    position: relative;
    min-height: 300px;
    padding: 20px 0;
}

.category-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-loading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.category-placeholder-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    filter: blur(1.5px);
    opacity: 0.7;
    animation: placeholderPulse 2s ease-in-out infinite;
    height: 320px;
    display: flex;
    flex-direction: column;
}

.category-placeholder-image {
    width: 100%;
    height: 180px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    animation: shimmer 2s ease-in-out infinite;
}

.category-placeholder-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-placeholder-title {
    height: 20px;
    background: linear-gradient(90deg, #cbd5e1 25%, #e2e8f0 50%, #cbd5e1 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 2s ease-in-out infinite;
    margin-bottom: 8px;
}

.category-placeholder-description {
    height: 14px;
    width: 85%;
    background: linear-gradient(90deg, #cbd5e1 25%, #e2e8f0 50%, #cbd5e1 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 2s ease-in-out infinite;
    margin-bottom: 6px;
}

.category-placeholder-description:nth-child(2) {
    width: 75%;
}

.category-placeholder-description:nth-child(3) {
    width: 60%;
}

.category-placeholder-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-placeholder-price {
    height: 18px;
    width: 80px;
    background: linear-gradient(90deg, #cbd5e1 25%, #e2e8f0 50%, #cbd5e1 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 2s ease-in-out infinite;
}

.category-placeholder-button {
    height: 36px;
    width: 100px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    animation: shimmer 2s ease-in-out infinite;
}



/* === CUSTOM SCROLLBAR === */
/* Основные стили для WebKit браузеров */
.modal-selection-grid::-webkit-scrollbar,
.modal-combo-items::-webkit-scrollbar,
.combo-modal::-webkit-scrollbar {
    width: 8px;
}

.modal-selection-grid::-webkit-scrollbar-track,
.modal-combo-items::-webkit-scrollbar-track,
.combo-modal::-webkit-scrollbar-track {
    background: transparent;
}

.modal-selection-grid::-webkit-scrollbar-thumb,
.modal-combo-items::-webkit-scrollbar-thumb,
.combo-modal::-webkit-scrollbar-thumb {
    background-color: rgba(57, 57, 57, 0.3);
    border-radius: 4px;
    border: none;
    transition: background-color 0.3s ease;
}

.modal-selection-grid::-webkit-scrollbar-thumb:hover,
.modal-combo-items::-webkit-scrollbar-thumb:hover,
.combo-modal::-webkit-scrollbar-thumb:hover {
    background-color: rgba(57, 57, 57, 0.5);
}

/* Убираем стрелочки скроллбара - радикальный подход */
*::-webkit-scrollbar-button:single-button:vertical:decrement,
*::-webkit-scrollbar-button:single-button:vertical:increment,
*::-webkit-scrollbar-button:single-button:horizontal:decrement,
*::-webkit-scrollbar-button:single-button:horizontal:increment,
*::-webkit-scrollbar-button:double-button:vertical:decrement,
*::-webkit-scrollbar-button:double-button:vertical:increment,
*::-webkit-scrollbar-button:double-button:horizontal:decrement,
*::-webkit-scrollbar-button:double-button:horizontal:increment,
*::-webkit-scrollbar-button:start:decrement,
*::-webkit-scrollbar-button:end:increment,
*::-webkit-scrollbar-button:vertical:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:horizontal:end:increment,
*::-webkit-scrollbar-button,
.modal-selection-grid::-webkit-scrollbar-button,
.modal-combo-items::-webkit-scrollbar-button,
.combo-modal::-webkit-scrollbar-button {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background: none !important;
    border: none !important;
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

*::-webkit-scrollbar-corner,
.modal-selection-grid::-webkit-scrollbar-corner,
.modal-combo-items::-webkit-scrollbar-corner,
.combo-modal::-webkit-scrollbar-corner {
    background: none !important;
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Для Firefox */
.modal-selection-grid,
.modal-combo-items,
.combo-modal {
    scrollbar-width: thin;
    scrollbar-color: rgba(57, 57, 57, 0.3) transparent;
}

/* Глобальные стили для всего сайта */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(57, 57, 57, 0.3) transparent;
}

/* Полное переопределение скроллбара */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: transparent;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(57, 57, 57, 0.3);
    border-radius: 4px;
    border: none;
    transition: background-color 0.3s ease;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(57, 57, 57, 0.5);
}

/* Радикальное убирание стрелочек - все возможные селекторы */
*::-webkit-scrollbar-button {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    background: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

*::-webkit-scrollbar-corner {
    background: none !important;
    display: none !important;
}

/* Принудительное отключение системных стрелочек */
html, body, div, section, article, main, aside, nav, 
header, footer, form, fieldset, legend, table, tr, td, th, 
ul, ol, li, dl, dt, dd, menu, summary, details {
    scrollbar-arrow-color: transparent !important;
}

/* Для старых версий webkit */
*::-webkit-scrollbar-button:decrement, 
*::-webkit-scrollbar-button:increment {
    display: none !important;
    background: none !important;
    height: 0 !important;
    width: 0 !important;
}

/* === PIZZA MODAL STYLES === */

/* Специфичные стили для модального окна пиццы */
#pizza-modal {
    align-items: center;
    justify-content: center;
}

#pizza-modal[style*="display: block"] {
    display: flex !important;
}

#pizza-modal .modal-content {
    margin: 0;
    max-width: 1200px;
    width: 95vw;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    background: white;
}

#pizza-modal .close {
    backdrop-filter: blur(10px);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    top: 16px;
    right: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1001;
}

#pizza-modal .close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#pizza-modal .modal-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
}

#pizza-modal .modal-image img {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.1));
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1); /* Base size */
    position: relative;
    z-index: 2;
    width: 100%;
    height: auto;
    object-fit: cover;
}

#pizza-modal .modal-image.size-small img {
    transform: scale(0.75);
}

#pizza-modal .modal-image.size-medium img {
    transform: scale(0.85);
}

#pizza-modal .modal-image.size-large img {
    transform: scale(1.1);
}

/* === DOUGH PATTERN OVERLAY (smooth fade) === */
#pizza-modal .modal-image {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: background 0.4s ease-in-out;
}

#pizza-modal .modal-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

#pizza-modal .modal-image.dough-thin::before {
    background-image: url("../../images/svg/pattern1.svg");
    opacity: 0.1;
}
        
#pizza-modal .modal-image.dough-traditional::before {
    background-image: url("../../images/svg/pattern2.svg");
    opacity: 0.1;
}



#pizza-modal .modal-info {
    background: white;
}

#pizza-modal .modal-scrollable-content {
    padding: 32px;
    padding-bottom: 20px;
}

#pizza-modal .modal-header h2 {
    font-size: 2.2rem;
    font-weight: 500;
    color: #2c3e50;
    letter-spacing: -0.5px;
}

#pizza-modal .modal-header .pizza-composition {
    font-size: 14px;
    font-weight: 300;
    color: #7f8c8d;
    margin-bottom: 0;
}

#pizza-modal .modal-footer {
    background: linear-gradient(to top, #ffffff 0%, #fcfcfc 100%);
    border-top: 1px solid #e8ecf0;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

#pizza-modal .pizza-info-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

#pizza-modal .pizza-weight {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 400;
}

#pizza-modal .current-price {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -0.5px;
}



/* Опции пиццы - специфично для #pizza-modal */
#pizza-modal .pizza-options-section {

}

#pizza-modal .pizza-options-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: -0.3px;
    margin-top: 12px;
}

.pizza-options-section {
    
}

#combo-modal .modal-image img {
    height: auto;
    width: 100%;
    object-fit: cover;
}

.pizza-options-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Стили табов для #pizza-modal */
#pizza-modal .pizza-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 64px;
    overflow: hidden;
    padding: 2px;
    position: relative;
    --active-tab-index: 0;
    --tab-count: 2;
}

/* Анимированный слайдер */
#pizza-modal .pizza-tabs::before {
    content: '';
    position: absolute;
    top: 4px;
    left: calc(4px + (100% - 8px) / var(--tab-count) * var(--active-tab-index));
    height: calc(100% - 8px);
    width: calc((100%) / var(--tab-count));
    background: white;
    border-radius: 64px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

#pizza-modal .switch-option {
    padding: 12px 12px;
    flex-grow: 1;
    text-align: center;
    background: transparent;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    transition: all 0.3s ease;
    border-radius: 20px;
    border: none;
    position: relative;
    z-index: 2;
}

#pizza-modal .switch-option:hover {
    color: #2c3e50;
}

#pizza-modal .switch-option.active {
    color: #ff6b35;
    font-weight: 500;
}

/* Общие стили для совместимости */
.pizza-tabs {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
}

.switch-option {
    padding: 10px 16px;
    flex-grow: 1;
    text-align: center;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 1px solid #e0e0e0;
}

.switch-option:first-child {
    border-left: none;
}

.switch-option:hover {
    background-color: #f5f5f5;
}

.switch-option.active {
    background: #d96e2f;
    color: white;
    font-weight: 700;
}


/* Стили ингредиентов для #pizza-modal */
#pizza-modal .pizza-ingredients-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 16px;
    border: none;
}

#pizza-modal .ingredient-item {
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 12px;
    display: flex;            /* Создаём колонку */
    flex-direction: column;   /* Вертикальное расположение */
}

#pizza-modal .ingredient-item:hover {
    border-color: #ff6b35;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.15);
    transform: translateY(-2px);
}

#pizza-modal .ingredient-item.selected {
    border-color: #ff6b35;
    background: linear-gradient(135deg, #fff5f0 0%, #ffeee6 100%);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.2);
}

#pizza-modal .ingredient-info h4 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 400;
    color: #2c3e50;
    text-align: center;
}

#pizza-modal .ingredient-price {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #ff6b35;
}

/* Стили для количественного селектора */
#pizza-modal .ingredient-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: auto;          /* Прижимаем к нижнему краю */
    max-width: fit-content;
    align-self: center;
}

#pizza-modal .quantity-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: #ff6b35;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#pizza-modal .quantity-btn:hover:not(:disabled) {
    background: #e55a2b;
    transform: scale(1.1);
}

#pizza-modal .quantity-btn:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

#pizza-modal .quantity-display {
    min-width: 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0 4px;
}

/* Плашка с ценой */
#pizza-modal .ingredient-price-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #ff6b35 0%, #f5543d 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
    z-index: 10;
}

/* Общие стили для совместимости */
.pizza-ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.ingredient-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.ingredient-item:hover {
    border-color: #d96e2f;
    box-shadow: 0 2px 8px rgba(217, 110, 47, 0.1);
}

.ingredient-item.selected {
    border-color: #d96e2f;
    background: #fff5f0;
}

.ingredient-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.ingredient-placeholder {
    width: 100%;
    height: 60px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.ingredient-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.ingredient-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.ingredient-price {
    margin: 0 0 4px 0;
    font-size: 12px;
    font-weight: 600;
    color: #d96e2f;
}

.ingredient-weight {
    margin: 0;
    font-size: 11px;
    color: #666;
}

.ingredient-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
}

.ingredient-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d96e2f;
}

.pizza-info-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.pizza-weight {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.pizza-composition {
    color: #666;
    line-height: 1.4;
}

.pizza-loading,
.pizza-ingredients-error {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.pizza-ingredients-error {
    color: #d32f2f;
}


/* === СТИЛИ ДЛЯ НАСТРАИВАЕМЫХ КОМБО === */

/* Секция категории в комбо */
.combo-category-section {
    margin-bottom: 24px;
}

.combo-category-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.combo-category-items .combo-item-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.combo-category-header {
    gap: 16px;
    display: flex;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
    flex-direction: row;
    align-items: center;
}

.combo-category-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
}

.combo-category-requirement {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.combo-category-status {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.combo-category-status.status-incomplete {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.combo-category-status.status-ok {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.combo-category-status.status-complete {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}



/* Выбранный товар */
.combo-selected-item {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    min-width: 200px;
    transition: all 0.3s ease;
    position: relative;
}

.combo-selected-item:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.combo-item-preview {
    display: flex;
    align-items: center;
    flex: 1;
}

.combo-item-preview img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
    border: 1px solid #dee2e6;
}

.combo-item-info .combo-item-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #212529;
    line-height: 1.2;
}

.combo-remove-item {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: background-color 0.2s ease;
}

.combo-remove-item:hover {
    background: #c82333;
}

/* Кнопка добавления товара */
.combo-add-item {
    background: white;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    padding: 20px;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combo-add-item:hover {
    border-color: #6c757d;
    background: #f8f9fa;
}

.combo-add-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.add-icon {
    font-size: 2rem;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 300;
}

.add-text {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Стили для модального окна выбора */
.modal-selection-item.selected {
    /* Убираем фон, оставляем только затемнение картинки и галочку */
}

.modal-selection-item.selected .modal-selection-image img {
    opacity: 0.6;
    filter: grayscale(30%);
}

.modal-selection-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.selection-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 107, 53, 0.9);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(108, 117, 125, 0.8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: inherit;
}

/* Улучшения для кнопок действий */
.action-button.secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.action-button.secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

/* Стили для disabled кнопки "В корзину" */
.order-button.disabled,
.order-button:disabled {
    background: #dedede !important;
    border-color: #adb5bd !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.8;
    height: 44px;
}

.order-button.disabled:hover,
.order-button:disabled:hover {
    background: #adb5bd !important;
    border-color: #adb5bd !important;
    transform: none !important;
}




/* === MODAL STYLES === */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 546px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #666;
    font-size: 24px;
    font-weight: normal;
    z-index: 1001;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1);
}

.modal-body {
    display: flex;
    flex: 1;
    min-height: 0; /* enable scrolling for whole modal body */
}

.modal-image {
    flex: 1;
    background: #f8f9fa;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 50%;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    height: 100%;
}

.modal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-height: 0;
    width: 50%;
    overflow-y: auto;
}

.modal-scrollable-content {
    flex: 1;
    overflow-y: visible; /* no internal vertical scroll */
    padding: 24px;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.modal-header h2 {
    font-size: 2.2rem;
    font-weight: 500;
    color: #333;
    font-family: 'Rubik', sans-serif;
}

.modal-header .combo-description {
    font-size: 14px;
    font-weight: 300;
    color: #7f8c8d;
    line-height: 1.2;
    font-family: 'Rubik', sans-serif;
}

.modal-combo-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
}

.combo-item-card {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    position: relative;
}

/* Кнопка удаления для настраиваемых комбо */
.combo-item-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
    z-index: 1;
}

.combo-item-remove-btn:hover {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
    transform: scale(1.1);
}

.combo-item-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.combo-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.combo-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.combo-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    font-family: 'Rubik', sans-serif;
}

.combo-item-size {
    font-size: 12px;
    color: #000000;
    opacity: 0.4;
    line-height: 1.2;
}

.combo-item-description {
    font-size: 14px;
    color: #000000;
    opacity: 0.6;
    line-height: 1.2;
    font-family: 'Rubik', sans-serif;
    margin-top: 6px;
}

.combo-item-actions {
    margin-top: auto; /* Pushes buttons to the bottom */
    padding-top: 8px; /* Adds space above buttons */
    display: flex;
    gap: 12px;
}

#combo-add-to-cart, #pizza-add-to-cart {
    width: max-content; 
}

.action-button {
    background: none;
    border: none;
    color: #ff6b35;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    font-family: 'Rubik', sans-serif;
}

.action-button:hover {
    background-color: rgba(255, 107, 53, 0.1);
}

/* Стили для разных типов комбо */

.combo-item-card.customizable-slot{
    width: 100%;
}

/* Общий стиль для всех заполненных карточек */
.combo-item-card.fixed-item,
.combo-item-card.customizable-slot.selected {
    background: #f8f9fa;
    cursor: default;
}

.combo-item-card.fixed-item:hover,
.combo-item-card.customizable-slot.selected:hover {
    transform: none; /* No hover effect on filled items */
    background: #f8f9fa;
}

/* Настраиваемый слот (общие стили) */
.combo-item-card.customizable-slot {
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Ховер-эффект только для кликабельных слотов */
.combo-item-card.customizable-slot:not(.selected):hover {
    background-color: #f1f3f5;
    transform: translateY(-1px);
}

.combo-item-card.customizable-slot.empty {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff 0%, #fff9f9 100%);
}

.combo-item-card.customizable-slot.selected {
    /* Make selected items look like fixed items */
    border-left-color: #ff6b35;
    cursor: default; /* Not clickable as a whole */
    background: #f8f9fa; /* Match fixed items */
}

.combo-item-card.customizable-slot.selected:hover {
    transform: none; /* No hover effect on selected items */
    background: #f8f9fa;
}

.combo-item-card.customizable-slot.empty .combo-item-name {
    color: #dc3545;
    font-weight: 600;
}

.combo-item-card.customizable-slot.selected .combo-item-name {
    color: #ff6b35;
    font-weight: 600;
}

/* Overlay с плюсиком для пустых слотов */
.select-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 107, 53, 0.9);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.combo-item-image {
    position: relative;
}

/* Дополнительные стили для better UX */
.combo-item-card.customizable-slot .combo-item-description {
    font-style: italic;
}

.combo-item-card.customizable-slot.empty .combo-item-description {
    color: #dc3545;
}

.combo-item-card.customizable-slot.selected .combo-item-description {
    color: #ff6b35;
}

/* === PLACEHOLDER STYLES FOR CUSTOMIZABLE SLOTS === */
.combo-item-card.placeholder .combo-item-image .placeholder-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #e9ecef;
}

.combo-item-card.placeholder .combo-item-details .combo-item-name {
    color: #212529;
    font-weight: 500;
}

.combo-item-card.placeholder .placeholder-shape {
    height: 1em;
    border-radius: 4px;
    background: #e9ecef;
}

.combo-item-card.placeholder .placeholder-shape.text-lg {
    width: 80%;
    margin-bottom: 8px;
}

.combo-item-card.placeholder .placeholder-shape.text-sm {
    width: 50%;
}

/* Shimmer Animation */
.placeholder-circle,
.placeholder-shape {
    background: linear-gradient(to right, #e9ecef 8%, #dee2e6 18%, #e9ecef 33%);
    background-size: 1000px 104px;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}


/* === PRODUCT SELECTION IN MODAL STYLES === */

.combo-image-view {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.product-selection-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: 100%;
    padding: 32px;
    overflow-x: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
}

.selection-header {
    margin-bottom: 20px;
}

.back-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    font-family: 'Rubik', sans-serif;
}

.back-button:hover {
    background: #5a6268;
}

.selection-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-family: 'Rubik', sans-serif;
}

.selection-header p {
    color: #666;
    font-size: 0.9rem;
    font-family: 'Rubik', sans-serif;
}

.modal-selection-loading,
.modal-selection-error {
    padding: 30px;
    text-align: center;
    color: #666;
    font-family: 'Rubik', sans-serif;
}

.modal-selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

.modal-selection-item {
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-selection-item:hover {
}

.modal-selection-image {
    position: relative;
    width: 100%;
    height: 116px;
    overflow: hidden;
    flex-shrink: 0;
}

.modal-selection-image img {
    width: auto;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.modal-selection-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #333;
    font-family: 'Rubik', sans-serif;
    line-height: 1.2;
    word-break: auto-phrase;
}

.modal-selection-info .product-composition {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.3;
    margin-bottom: 6px;
    font-family: 'Rubik', sans-serif;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.modal-selection-info .product-variant-info {
    font-size: 0.7rem;
    color: #888;
    font-style: italic;
    margin-bottom: 6px;
    font-family: 'Rubik', sans-serif;
}

.modal-selection-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.modal-selection-price .price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ff6b35;
    font-family: 'Rubik', sans-serif;
}

.modal-selection-price .variants-count {
    font-size: 0.7rem;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    font-family: 'Rubik', sans-serif;
}



.modal-footer {
    border-top: 1px solid #eee;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: white;
}

.modal-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pizza-price {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.current-price {
    font-size: 20px;
    font-weight: 500;
    color: #000;
    font-family: 'Rubik', sans-serif;
}

.old-price {
    font-size: 1.2rem;
    color: #999;
    text-decoration: line-through;
    font-family: 'Rubik', sans-serif;
}

.order-button {
    background: #ffe1d6;
    color: #fe6b35;
    border: none;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rubik', sans-serif;
    width: 100%;
}

.order-button:hover {
    background: #fe6b35;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}


/* === PLACEHOLDER STYLES FOR COMBO SELECTIONS === */
.combo-add-item.placeholder-pizza {
    width: 100px;
    height: 100px;
    min-width: 100px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combo-add-item.placeholder-default {
    width: 200px;
    height: 100px;
    min-width: 200px;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combo-add-item.placeholder-pizza .add-icon {
    margin-bottom: 0;
    font-size: 2rem;
}

.combo-add-item.placeholder-pizza .add-text {
    font-size: 0.8rem;
    margin-top: 4px;
} 

/* === OVERRIDES FOR COMBO PRODUCT SELECTION === */
.back-button {
    display: none !important;
}

.modal-selection-grid {
    grid-template-columns: repeat(3, 1fr);
}


/* === АДАПТИВНЫЕ СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА === */
@media (max-width: 1680px) {
    
}

@media (max-width: 1367px) {
    .order-button {
        font-size: 14px;
    }
}

/* === OVERLAY FOR DOUGH PATTERN CROSSFADE === */
#pizza-modal .modal-image .dough-overlay {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    z-index: 1;
}

#pizza-modal .modal-image .dough-overlay.visible {
    opacity: 0.2;
}

/* === PIZZA MODAL PLACEHOLDER STYLES === */

/* Плейсхолдер для изображения пиццы */
.pizza-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.pizza-image-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, rgba(255, 255, 255, 0.4) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.pizza-placeholder-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.1) 0%, 
        rgba(255, 107, 53, 0.05) 25%,
        rgba(255, 107, 53, 0.1) 50%,
        rgba(255, 107, 53, 0.05) 75%,
        rgba(255, 107, 53, 0.1) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.1);
}

.pizza-placeholder-icon {
    font-size: 4rem;
    color: #ff6b35;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
    animation: pulse 2s ease-in-out infinite;
}

/* Стили для эмодзи пиццы в плейсхолдере */
.pizza-placeholder-icon img.emoji {
    width: 4rem;
    height: 4rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    opacity: 1 !important;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Плейсхолдер для контента пиццы */
.pizza-content-placeholder {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pizza-title-placeholder {
    height: 36px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 8px;
    animation: shimmer 1.5s ease-in-out infinite;
    width: 70%;
}

.pizza-description-placeholder {
    height: 16px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s ease-in-out infinite;
    width: 85%;
    margin-bottom: 8px;
}

.pizza-description-placeholder:nth-child(3) {
    width: 60%;
}

.pizza-tabs-placeholder {
    display: flex;
    background: #f8f9fa;
    border-radius: 64px;
    overflow: hidden;
    padding: 2px;
    height: 44px;
}

.pizza-tab-placeholder {
    flex: 1;
    height: 40px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 20px;
    margin: 0 2px;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* Плейсхолдер для ингредиентов */
.pizza-ingredients-placeholder {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 16px;
    max-height: 320px;
    overflow: hidden;
}

.ingredient-placeholder-item {
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    background: white;
    min-height: 120px;
}

.ingredient-placeholder-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: shimmer 1.5s ease-in-out infinite;
}

.ingredient-placeholder-name {
    height: 16px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s ease-in-out infinite;
    width: 80%;
    align-self: center;
}

.ingredient-placeholder-price {
    height: 12px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s ease-in-out infinite;
    width: 50%;
    align-self: center;
    margin-top: auto;
}

/* Состояния загрузки */
.modal-loading-state .modal-image {
    opacity: 0.7;
    pointer-events: none;
}

.modal-loading-state .modal-info {
    opacity: 0.7;
    pointer-events: none;
}

/* Плавные переходы при загрузке */
.pizza-content-loaded {
    animation: fadeInUp 0.4s ease-out;
}

.pizza-image-loaded {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === IMAGE LOADING OVERLAY === */
#pizza-modal .pizza-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    z-index: 3;
    transition: opacity 0.35s ease;
}

#pizza-modal .pizza-image-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#pizza-modal .modal-image img {
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#pizza-modal .modal-image img.image-visible {
    opacity: 1;
}

@media (max-width: 1367px) {
    .modal-image {
        width: 50%;
    }

    #pizza-modal .modal-info {
        width: 60%;
    }

    #combo-modal .modal-info {
        width: 50%;
    }
}

@media (max-width: 1024px) {
    .modal-image {
        width: 50%;
    }

    #pizza-modal .ingredient-info h4 {
        font-size: 13px;
    }

    #pizza-modal .modal-scrollable-content {
        padding: 24px;
    }

    #pizza-modal .modal-footer {
        padding: 12px 24px;
    }

    .modal-selection-item {
        align-items: center;
    }

    .modal-selection-info {
        text-align: center;
        font-size: 10px;
    }

    .modal-selection-image {
        height: max-content;
    }

    .modal-selection-image img {
        object-fit: cover;
        height: auto;
        width: 100%;
    }

    .modal-selection-grid {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-selection-item {
        width: 30%;
    }

    .product-selection-view,
    .modal-scrollable-content {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 28px;
    }

    .modal-footer {
        padding: 12px 20px;
    }

    #pizza-modal .ingredient-item {
        padding: 0px;
    }
    
}

@media (max-width: 768px) {
    /* Полноэкранный выбор товаров для комбо */
    #combo-modal.selection-view-active .modal-content {
        position: relative;
        width: 90vw !important;
        height: 90% !important;
        margin: 0 !important;
        border-radius: 20px;
    }
    #combo-modal.selection-view-active #product-selection-view {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        background: #fff;
        z-index: 10;
        display: flex;
        flex-direction: column;
    }
    #combo-modal.selection-view-active #combo-image-view {
        display: none !important;
    }

    #combo-modal .close {
        color: #000000;
        background: #fff;
    }

    .modal-content {
        position: relative;
        background-color: white;
        margin: 0 auto;
        padding: 0;
        border-radius: 20px;
        width: 90vw;
        height: 90%;
        max-width: 100vw;
        max-height: 100vh;
        overflow: hidden;
        animation: modalFadeIn 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
    }

    #pizza-modal .modal-content {
        margin: 0;
        max-width: 100vw;
        width: 100vw;
        height: 100%;
        max-height: 100vh;
        border-radius: 0px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
        overflow: hidden;
        background: white;
    }

    .modal-body {
        flex-direction: column;
        display: flex;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .modal-image {
        width: 100%;
        box-sizing: border-box;
        height: 360px !important;
        max-height: 360px;
        overflow: hidden;
    }

    #promotion-modal .modal-image {
        height: max-content !important;
        max-height: max-content !important;
    }

    #combo-modal .modal-image {
        width: 100%;
        box-sizing: border-box;
        height: max-content;
        max-height: max-content;
        overflow: hidden;
    }

    #pizza-modal .modal-scrollable-content {
        padding: 20px;
    }

    #combo-modal .modal-scrollable-content {
        padding-bottom: 32px;
        width: 100%;
        box-sizing: border-box;
    }

    .modal-header {
        margin-bottom: 0px;
    }

    #pizza-modal .modal-header h2,
    #combo-modal .modal-header h2  {
        font-size: 20px;
    }

    #pizza-modal .modal-header .pizza-composition {
        font-size: 12px;
    }

    #pizza-modal .switch-option {
        font-size: 12px;
    }

    #combo-modal .modal-info,
    #pizza-modal .modal-info {
        width: 100%;
        overflow-y: visible; /* убираем внутренний скролл, чтобы вся модалка прокручивалась вместе с изображением */
    }

    #pizza-modal .pizza-options-section h3 {
        font-size: 16px;
    }

    #pizza-modal .modal-footer,
    #combo-modal .modal-footer {
        padding: 12px 20px;
        box-sizing: border-box;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1001;
    }

    #pizza-modal .pizza-ingredients-grid {
        padding: 4px;
        height: max-content;
        max-height: max-content;
    }

    #pizza-modal .ingredient-info h4 {
        font-size: 11px;
    }

    #pizza-modal .pizza-info-summary {
        margin-bottom: 0px;
    }

    #pizza-modal .current-price {
        font-size: 20px;
    }

    #pizza-modal .pizza-weight {
        font-size: 12px;
    }

    .combo-image-view {
        display: flex;
        align-content: flex-end;
        align-items: flex-end;
        object-position: bottom;
    }

    #combo-modal .modal-image img {
        object-position: bottom;
    }

    .modal-scrollable-content > div:nth-of-type(4) {
        padding-bottom: 60px;
    }

    .modal-selection-grid {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-selection-item {
    width: 30%;
    }

    .modal-selection-image img {
    width: 100%;
    height: auto;
    }
    
    .modal-selection-info h4 {
    text-align: center;
    }

    .modal-selection-image {
    height: max-content;
    }

    #pizza-modal .ingredient-item {
        padding: 4px 4px;
        align-items: center;
    }

    .ingredient-item img {
        width: 80%;
        height: auto;
    }

    #pizza-modal .modal-image {
        width: 100%;
    }

    #pizza-modal .modal-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    #pizza-modal .modal-image.size-medium img {
        transform: scale(1.1);
    }

    #pizza-modal .modal-image.size-large img {
        transform: scale(1.4);
    }
}



@media (max-width: 480px) {
    /* Полноэкранный выбор товаров для комбо */
    #combo-modal.selection-view-active .modal-content {
        position: relative;
        width: 100vw !important;
        height: 100% !important;
        margin: 0 !important;
        border-radius: 0;
    }
    #combo-modal.selection-view-active #product-selection-view {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        background: #fff;
        z-index: 10;
        display: flex;
        flex-direction: column;
    }
    #combo-modal.selection-view-active #combo-image-view {
        display: none !important;
    }

    #combo-modal .close {
        color: #000000;
        background: #fff;
    }

    .modal-content {
        position: relative;
        background-color: white;
        margin: 0 auto;
        padding: 0;
        border-radius: 0px;
        width: 100vw;
        height: 100%;
        max-width: 100vw;
        max-height: 100vh;
        overflow: hidden;
        animation: modalFadeIn 0.3s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
    }

    #pizza-modal .modal-content {
        margin: 0;
        max-width: 100vw;
        width: 100vw;
        height: 100%;
        max-height: 100vh;
        border-radius: 0px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
        overflow: hidden;
        background: white;
    }

    .modal-body {
        flex-direction: column;
        display: flex;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    #pizza-modal .modal-image {
        width: 100%;
        box-sizing: border-box;
        height: 800px !important;
        max-height: 800px;
        overflow: hidden;
        padding: 16px;
    }

    #pizza-modal .modal-image.size-medium img {
        transform: scale(0.95);
    }

    #pizza-modal .modal-image.size-large img {
        transform: scale(1.12);
    }

    #pizza-modal .modal-info {
        width: 100%;
        box-sizing: border-box;
    }

    #combo-modal .modal-info {
        width: 100%;
    }

    #combo-modal .modal-image {
        width: 100%;
        box-sizing: border-box;
        height: max-content;
        max-height: max-content;
        overflow: hidden;
    }

    #pizza-modal .modal-scrollable-content {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    #pizza-modal .modal-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    #combo-modal .modal-scrollable-content {
        padding-bottom: 32px;
    }

    .modal-header {
        margin-bottom: 0px;
    }

    #pizza-modal .modal-header h2,
    #combo-modal .modal-header h2  {
        font-size: 20px;
    }

    #pizza-modal .modal-header .pizza-composition {
        font-size: 12px;
    }

    #pizza-modal .switch-option {
        font-size: 12px;
    }

    .modal-info {
        width: 100%;
        overflow-y: visible; /* убираем внутренний скролл, чтобы вся модалка прокручивалась вместе с изображением */
    }

    #pizza-modal .pizza-options-section h3 {
        font-size: 16px;
    }

    #pizza-modal .modal-footer,
    #combo-modal .modal-footer {
        padding: 12px 20px;
        box-sizing: border-box;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100vw;
        z-index: 1001;
    }

    #pizza-modal .pizza-ingredients-grid {
        padding: 4px;
        height: max-content;
        max-height: max-content;
    }

    #pizza-modal .ingredient-info h4 {
        font-size: 11px;
    }

    #pizza-modal .pizza-info-summary {
        margin-bottom: 0px;
    }

    #pizza-modal .current-price {
        font-size: 20px;
    }

    #pizza-modal .pizza-weight {
        font-size: 12px;
    }

    .combo-image-view {
        height: max-content;
    }

    .modal-scrollable-content > div:nth-of-type(4) {
        padding-bottom: 60px;
    }

    .modal-selection-grid {
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        padding-bottom: 60px;
    }

    .modal-selection-item {
    width: 30%;
    }

    .modal-selection-image img {
    width: 100%;
    height: auto;
    }
    
    .modal-selection-info h4 {
    text-align: center;
    }

    .modal-selection-image {
    height: max-content;
    }

    #pizza-modal .ingredient-item {
        padding: 4px 4px;
        align-items: center;
    }

    .ingredient-item img {
        width: 80%;
        height: auto;
    }
}