/* ==========================================================================
   CART COMPONENTS — Модальное окно выбора размера/цвета + элементы корзины
   Используется на: store.show, store.product
   ========================================================================== */

/* ===== МОДАЛЬНОЕ ОКНО РАЗМЕРОВ И ЦВЕТОВ ===== */
#size-color-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
#size-color-modal:not(.hidden) {
    display: flex;
}
#size-color-modal .sc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#size-color-modal .sc-dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}
@media (max-width: 640px) {
    #size-color-modal .sc-dialog {
        padding: 20px;
        max-width: 100%;
        border-radius: 14px;
    }
}

/* ===== КОНТЕЙНЕР РАЗМЕРОВ В МОДАЛКЕ — горизонтальный скролл ===== */
#sc-sizes {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}
#sc-sizes::-webkit-scrollbar {
    display: none;
}

/* ===== КНОПКИ РАЗМЕРОВ В МОДАЛКЕ ===== */
.sc-size-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 5px 8px 4px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.1;
    white-space: nowrap;
    gap: 1px;
    flex-shrink: 0;
}
.sc-size-btn:hover:not(:disabled) {
    border-color: #9ca3af;
    background: #f9fafb;
}
.sc-size-btn.active {
    background: #eff6ff;
    border-color: #2563eb;
}
.sc-size-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}
.sc-size-btn .sz-label {
    font-size: 9px;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}
.sc-size-btn .sz-value {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}
.sc-size-btn .sz-stock {
    font-size: 9px;
    color: #16a34a;
    font-weight: 600;
    line-height: 1;
}
.sc-size-btn.active .sz-label {
    color: #1d4ed8;
}
.sc-size-btn.active .sz-value {
    color: #1d4ed8;
}
.sc-size-btn.active .sz-stock {
    color: #1d4ed8;
}

/* ===== КНОПКИ РАЗМЕРОВ В МОДАЛКЕ (десктоп — чуть крупнее) ===== */
@media (min-width: 641px) {
    .sc-size-btn {
        min-width: 68px;
        padding: 10px 12px 8px;
        border-radius: 10px;
        gap: 4px;
    }
    .sc-size-btn .sz-label {
        font-size: 11px;
    }
    .sc-size-btn .sz-value {
        font-size: 16px;
    }
    .sc-size-btn .sz-stock {
        font-size: 11px;
    }
}

/* ===== ЦВЕТА В КОРЗИНЕ (кружочки) ===== */
.cart-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.cart-swatch:hover {
    transform: scale(1.12);
}
.cart-swatch.on {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #2563eb;
}

/* ===== КНОПКИ РАЗМЕРОВ В КОРЗИНЕ ===== */
.cart-size {
    border: 1.5px solid #d1d5db;
    background: #fff;
    color: #111827;
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
}
.cart-size:hover {
    border-color: #9ca3af;
}
.cart-size.on {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}
.cart-size:disabled {
    opacity: 0.45;
    text-decoration: line-through;
    cursor: not-allowed;
}
.cart-size .cs-l {
    font-size: 9px;
    color: #6b7280;
    font-weight: 500;
}
.cart-size.on .cs-l {
    color: #1d4ed8;
}