/* combo-modal.css v6 — Идеальный однорукий бандит (с центровкой) */

/* ============ ЗОЛОТАЯ КНОПКА В САЙДБАРЕ ============ */
.category-button.golden-combo-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 30%, #FFDF00 60%, #FDB931 100%) !important;
    background-size: 300% 300% !important;
    animation: goldenShimmer 3s ease infinite !important;
    color: #7a4800 !important;
    font-weight: 800 !important;
    border: none !important;
    text-shadow: 0 1px 2px rgba(255,255,255,0.4);
    box-shadow: 0 4px 14px rgba(253,185,49,0.55) !important;
}
.category-button.golden-combo-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(253,185,49,0.7) !important;
}
@keyframes goldenShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============ МОДАЛЬНОЕ ОКНО ============ */
.combo-modal-content {
    width: 90%; max-width: 900px; max-height: 92vh;
    overflow-y: auto; display: flex; flex-direction: column;
    padding: 0; border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    position: relative; background: var(--light);
}
.combo-modal-content::-webkit-scrollbar { width: 8px; }
.combo-modal-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.combo-modal-content::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }
.combo-modal-close {
    position: absolute; top: 15px; right: 15px;
    background: rgba(0,0,0,.7); color: #fff;
    width: 44px; height: 44px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 18px; z-index: 10;
    transition: all var(--transition-medium);
}
.combo-modal-close:hover { transform: scale(1.1); background: var(--primary); }

/* ============ ШАПКА ============ */
.combo-modal-header {
    padding: 25px 25px 15px; text-align: center;
    border-bottom: 1px solid #eee; flex-shrink: 0;
}
.combo-modal-title { font-size: 24px; color: var(--secondary); margin: 0; padding-right: 50px; font-weight: 800; }
.combo-modal-subtitle { font-size: 14px; color: #888; margin: 6px 0 0; line-height: 1.4; }

/* ============ РАЗМЕРЫ ============ */
.combo-size-selector { padding: 15px 25px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.combo-section-title { font-size: 15px; color: var(--secondary); margin: 0 0 10px; font-weight: 600; }
.combo-sizes { display: flex; gap: 10px; flex-wrap: wrap; }
.combo-sizes .size-option {
    flex: 1; min-width: 100px; max-width: 160px;
    padding: 10px 8px; border: 2px solid #ddd; border-radius: var(--border-radius-sm);
    cursor: pointer; transition: all .2s; background: #fff;
    box-shadow: var(--shadow-sm); text-align: center;
    display: flex; flex-direction: column; align-items: center;
}
.combo-sizes .size-option:hover { background: var(--primary-light); border-color: var(--primary); transform: translateY(-2px); }
.combo-sizes .size-option.selected { border-color: var(--primary); background: rgba(255,90,0,.1); box-shadow: 0 4px 12px rgba(255,90,0,.2); }
.combo-size-name { font-weight: 700; color: var(--secondary); font-size: 14px; }
.combo-size-price { font-size: 12px; color: #999; margin-top: 2px; }

/* ============ СЛОТЫ — ГОРИЗОНТАЛЬНЫЕ КОЛОНКИ ============ */
.combo-slots-container {
    padding: 15px 25px 5px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
}

/* Блокировка барабанов пока не выбран размер */
.combo-slots-container.size-locked .combo-slot {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.4);
    transition: opacity .25s, filter .25s;
}
.combo-slots-container.size-locked ~ #combo-random-btn {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
}

/* Колонка-слот */
.combo-slot {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: var(--border-radius);
    border: 1px solid #eee;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Заголовок слота */
.combo-slot-header {
    padding: 10px 10px 6px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.combo-slot-label {
    font-size: 13px; font-weight: 700; color: var(--secondary);
    text-transform: uppercase; letter-spacing: .04em;
    display: block;
}
.combo-slot-selected-name {
    font-size: 12px; color: var(--primary); font-weight: 600;
    display: block; margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Кнопка стрелки снаружи viewport */
.combo-slot-arrow-outer {
    width: 44px; height: 28px;
    border-radius: 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #666;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all .2s;
    font-size: 13px;
    margin: 6px auto 4px;
    flex-shrink: 0;
}
.combo-slot-arrow-outer:hover:not(:disabled) { background: var(--primary); color: #fff; border-color: var(--primary); }
.combo-slot-arrow-outer:active { transform: scale(.94); }
.combo-slot-arrow-outer:disabled { opacity: .3; cursor: not-allowed; }

/* Viewport барабана */
.combo-slot-viewport {
    width: 100%;
    height: 190px; /* УВЕЛИЧЕНО (~1.5 высоты элемента), чтобы было видно соседей */
    overflow: hidden; position: relative;
    user-select: none; touch-action: pan-y;
    cursor: grab;
    background: #f9f9f9;
}
.combo-slot-viewport:active { cursor: grabbing; }

/* Подсветка центрального элемента */
.combo-slot-highlight {
    position: absolute; top: 50%; left: 6px; right: 6px;
    height: 130px; /* ИЗМЕНЕНО: Равно высоте 1 элемента (ITEM_H = 130) */
    transform: translateY(-50%);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-sm);
    background: rgba(255,90,0,.04);
    z-index: 1; pointer-events: none;
    box-shadow: 0 0 12px rgba(255,90,0,.1);
}

/* Градиенты-шторки сверху и снизу (увеличены для плавности) */
.combo-slot-viewport::before,
.combo-slot-viewport::after {
    content: ''; position: absolute;
    left: 0; right: 0; height: 35px; z-index: 2; pointer-events: none;
}
.combo-slot-viewport::before { top: 0; background: linear-gradient(to bottom, #f9f9f9, transparent); }
.combo-slot-viewport::after  { bottom: 0; background: linear-gradient(to top, #f9f9f9, transparent); }

/* Трек */
.combo-slot-track {
    position: absolute; left: 0; right: 0;
    top: 50%; /* ИЗМЕНЕНО: Привязываем к центру экрана */
    margin-top: -65px; /* ИЗМЕНЕНО: Сдвигаем вверх ровно на половину элемента (130 / 2) */
    transition: transform .35s cubic-bezier(.23,1,.32,1);
    will-change: transform;
}
.combo-slot-track.dragging { transition: none; }

/* Элемент барабана */
.combo-slot-item {
    height: 130px; /* Жестко зафиксировано */
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; padding: 8px;
    box-sizing: border-box;
    transition: opacity .25s, transform .25s;
    cursor: pointer; text-align: center;
}
.combo-slot-item.active { opacity: 1; transform: scale(1); }
.combo-slot-item:not(.active) { opacity: .32; transform: scale(.9); }

.combo-slot-item-image {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    flex-shrink: 0;
}
.combo-slot-item-info { width: 100%; overflow: hidden; }
.combo-slot-item-name {
    font-size: 13px; font-weight: 700; color: var(--secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-slot-item-desc {
    font-size: 11px; color: #bbb;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 1px;
}
.combo-slot-item-price {
    font-size: 13px; font-weight: 800; color: var(--primary);
    flex-shrink: 0;
}

/* Счётчик */
.combo-slot-counter-wrap {
    padding: 4px 0 6px;
    display: flex; align-items: center; justify-content: center;
}
.combo-slot-counter {
    font-size: 11px; color: #bbb;
}

/* ============ INLINE МОДИФИКАТОРЫ ============ */
.combo-slot-modifiers { border-top: 1px solid #f0f0f0; width: 100%; }
.combo-slot-mods-toggle {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 8px 12px;
    background: none; border: none; cursor: pointer;
    font-size: 12px; font-weight: 600; color: var(--primary);
    transition: background .2s;
    justify-content: center;
}
.combo-slot-mods-toggle:hover { background: rgba(255,90,0,.04); }
.combo-slot-mods-list { padding: 0 12px 10px; }
.combo-mod-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0; border-bottom: 1px solid #f5f5f5;
    gap: 6px;
}
.combo-mod-item:last-child { border-bottom: none; }
.combo-mod-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.combo-mod-name { font-size: 12px; color: var(--secondary); font-weight: 500; }
.combo-mod-price { font-size: 11px; color: #999; }
.combo-mod-qty { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.combo-mod-btn {
    width: 26px; height: 26px; border: 1.5px solid #ddd; background: #fff;
    color: var(--secondary); font-size: 14px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .15s; user-select: none;
}
.combo-mod-btn:first-child { border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm); }
.combo-mod-btn:last-child  { border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0; }
.combo-mod-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: rgba(255,90,0,.05); }
.combo-mod-btn:disabled { opacity: .3; cursor: not-allowed; }
.combo-mod-count {
    width: 30px; height: 26px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--secondary);
    border-top: 1.5px solid #ddd; border-bottom: 1.5px solid #ddd;
    background: #fafafa;
}

/* ============ КНОПКА РАНДОМ ============ */
.combo-random-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 4px 25px 10px; padding: 12px 20px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #fff; border: none; border-radius: var(--border-radius-sm);
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: all .25s; box-shadow: 0 3px 10px rgba(255,152,0,.25);
    width: calc(100% - 50px);
}
.combo-random-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(255,152,0,.35); }
.combo-random-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ============ ПРЕВЬЮ ПОЛОВИНОК ============ */
.combo-preview { padding: 10px 25px; display: flex; justify-content: center; flex-shrink: 0; }
.combo-preview-circle {
    width: 250px; height: 180px; border-radius: 50%;
    overflow: hidden; display: flex; position: relative;
    border: 3px solid #eee; box-shadow: 0 8px 30px rgba(0,0,0,.08);
    transition: border-color .3s;
}
.combo-preview-circle.complete { border-color: var(--primary); box-shadow: 0 8px 30px rgba(255,90,0,.15); }
.combo-preview-left, .combo-preview-right {
    width: 50%; height: 100%; overflow: hidden;
    position: relative; display: flex; align-items: center; justify-content: center;
    background: #f5f5f5;
}
.combo-preview-left img, .combo-preview-right img {
    position: absolute; top: 0; width: 200%; height: 100%; object-fit: cover;
    transition: all .4s cubic-bezier(.23,1,.32,1);
}
.combo-preview-left img { left: 0; }
.combo-preview-right img { right: 0; left: auto; }
.combo-preview-divider {
    position: absolute; top: 0; bottom: 0; left: 50%;
    width: 2px; background: #fff; transform: translateX(-50%); z-index: 3;
}
.combo-preview-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #ccc; font-size: 11px; }
.combo-preview-placeholder i { font-size: 20px; }
@keyframes comboSlideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.combo-preview-left img.entering, .combo-preview-right img.entering { animation: comboSlideIn .3s ease forwards; }

/* ============ ФУТЕР ============ */
.combo-footer { padding: 15px 25px 20px; border-top: 1px solid #eee; margin-top: auto; flex-shrink: 0; }
.combo-pricing { margin-bottom: 12px; }
.combo-pricing-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.combo-pricing-label { font-size: 14px; color: #888; }
.combo-pricing-value { font-size: 14px; color: #888; }
.combo-pricing-total .combo-pricing-label { font-size: 18px; font-weight: 800; color: var(--secondary); }
.combo-total-price { font-size: 22px; font-weight: 900; color: var(--primary); }
.combo-add-to-cart {
    width: 100%; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; border: none; padding: 15px 20px;
    border-radius: var(--border-radius-sm); cursor: pointer;
    font-weight: 700; font-size: 16px; transition: all .25s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 4px 12px rgba(255,90,0,.3); position: relative; overflow: hidden;
}
.combo-add-to-cart:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(255,90,0,.4); }
.combo-add-to-cart:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }
.combo-add-to-cart::after {
    content: ''; position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
    transition: .5s;
}
.combo-add-to-cart:hover:not(:disabled)::after { left: 100%; }

/* ============ БЕЙДЖ В КОРЗИНЕ ============ */
.cart-combo-badge {
    display: inline-block; background: var(--primary); color: #fff;
    font-size: 10px; font-weight: 700; padding: 2px 6px;
    border-radius: 3px; margin-right: 4px; vertical-align: middle;
    text-transform: uppercase; letter-spacing: .03em;
}

/* ============ АДАПТИВ ============ */
@media (max-width: 768px) {
    .combo-modal-content { width: 100%; max-height: 100vh; border-radius: 0; }
    .combo-modal-close { position: fixed; top: 10px; right: 10px; z-index: 100; }
    .combo-modal-title { font-size: 19px; }
    .combo-preview-circle { width: 140px; height: 140px; }

    .combo-slots-container { padding: 10px 8px 5px; gap: 8px; }

    .combo-slot-item { height: 115px; } /* ITEM_H_M = 115 */
    .combo-slot-viewport { height: 170px; } /* ~1.5 * 115 */
    .combo-slot-track { margin-top: -57.5px; } /* ИЗМЕНЕНО: -115 / 2 */
    .combo-slot-highlight { height: 115px; } /* ИЗМЕНЕНО: Равно 115 */

    .combo-slot-item-image { width: 52px; height: 52px; }
    .combo-slot-item-name { font-size: 11px; }
    .combo-slot-item-price { font-size: 11px; }
    .combo-slot-label { font-size: 11px; }
    .combo-slot-arrow-outer { width: 36px; height: 24px; font-size: 11px; }

    .combo-sizes .size-option { min-width: 70px; padding: 8px 6px; }
    .combo-random-btn { margin: 4px 8px 10px; width: calc(100% - 16px); }
    .combo-modal-header, .combo-size-selector, .combo-footer { padding-left: 15px; padding-right: 15px; }
}

@media (max-width: 480px) {
    .combo-slots-container { gap: 5px; padding: 8px 6px 4px; }

    .combo-slot-item { height: 105px; gap: 4px; } /* ITEM_H_XS = 105 */
    .combo-slot-viewport { height: 155px; } /* ~1.5 * 105 */
    .combo-slot-track { margin-top: -52.5px; } /* ИЗМЕНЕНО: -105 / 2 */
    .combo-slot-highlight { height: 105px; } /* ИЗМЕНЕНО: Равно 105 */

    .combo-slot-item-image { width: 46px; height: 46px; }
    .combo-slot-item-name { font-size: 10px; }
    .combo-slot-arrow-outer { width: 32px; height: 22px; }
    .combo-mod-btn { width: 24px; height: 24px; font-size: 13px; }
    .combo-mod-count { width: 26px; height: 24px; font-size: 12px; }
}
