/* ============================================
   КОРЗИНА — СТИЛИ
   ============================================ */

/* ===== ИКОНКА В ШАПКЕ ===== */
.cart-icon-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.cart-icon-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.cart-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cart-icon-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #C9A87C;
    color: #1A1A1A;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    line-height: 1;
}

.cart-total {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ===== ПАНЕЛЬ ===== */
.cart-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-panel-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cart-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 440px;
    max-width: 90vw;
    height: 100vh;
    z-index: 9999;
    background: #FFFFFF;
    box-shadow: -4px 0 40px rgba(0, 0, 0, 0.1);
    transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}

.cart-panel.open {
    right: 0;
}

/* Шапка панели */
.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.cart-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1A1A1A;
}

.cart-panel-icon {
    font-size: 1.3rem;
}

.cart-panel-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: #8A8A8A;
}

.cart-panel-close {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.cart-panel-close:hover {
    background: #e8e8e8;
    transform: rotate(90deg);
}

/* Тело панели */
.cart-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Пустая корзина */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #bbb;
}

.cart-empty svg {
    margin-bottom: 16px;
}

.cart-empty p {
    font-size: 1.1rem;
    color: #888;
    margin: 0 0 12px;
}

.cart-empty-link {
    color: #C9A87C;
    text-decoration: none;
    font-weight: 600;
}

.cart-empty-link:hover {
    text-decoration: underline;
}

/* Список товаров */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-item {
    display: flex;
    gap: 14px;
    padding: 12px 14px;
    background: #f8f8f8;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.cart-item:hover {
    background: #f3f1ee;
}

.cart-item-image {
	flex-shrink: 0;
	width: 70px;
	height: 70px;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	display: flex;
	align-items: center;
}

.cart-item-image img {
    width: 100%;
font-size: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1A1A1A;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 2px;
}

.cart-item-name:hover {
    color: #C9A87C;
}

.cart-item-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: #8A8A8A;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-qty-btn:hover {
    border-color: #C9A87C;
    background: #C9A87C;
    color: #fff;
}

.cart-item-qty {
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    font-size: 0.95rem;
}

.cart-item-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1A1A1A;
    margin-left: auto;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.cart-item-remove:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}

/* Футер панели */
.cart-panel-footer {
    flex-shrink: 0;
    padding: 16px 24px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.cart-panel-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 16px;
}

.cart-panel-total-price {
    font-size: 1.3rem;
    color: #C9A87C;
}

.cart-panel-actions {
    display: flex;
    gap: 10px;
}

.cart-panel-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cart-panel-btn-secondary {
    background: #f0f0f0;
    color: #1A1A1A;
}

.cart-panel-btn-secondary:hover {
    background: #e5e5e5;
}

.cart-panel-btn-primary {
    background: #C9A87C;
    color: #fff;
}

.cart-panel-btn-primary:hover {
    background: #A8885E;
    transform: translateY(-1px);
}

/* ===== ТОСТ ===== */
.cart-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 14px 28px;
    background: #1A1A1A;
    color: #fff;
    border-radius: 12px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.cart-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.cart-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #27ae60;
    border-radius: 50%;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ===== ВЫДЕЛЕНИЕ РАЗМЕРА ===== */
.size-item.error,
.product_size.error {
    border-color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.08) !important;
}

.size-item.active,
.product_size.active {
    border-color: #C9A87C !important;
    background: #C9A87C !important;
    color: #fff !important;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .cart-panel {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }
    
    .cart-panel-header {
        padding: 14px 16px;
    }
    
    .cart-panel-body {
        padding: 12px 14px;
    }
    
    .cart-item {
        padding: 10px 12px;
    }
    
    .cart-item-image {
        width: 56px;
        height: 56px;
    }
    
    .cart-panel-footer {
        padding: 12px 16px 16px;
    }
    
    .cart-panel-actions {
        flex-direction: column;
    }
    
    .cart-icon-btn .cart-total {
        display: none;
    }
    
    .cart-toast {
        bottom: 20px;
        padding: 12px 20px;
        font-size: 0.85rem;
        max-width: 90%;
    }
}

/* ===== БЛОКИРОВКА СКРОЛЛА ===== */
body.cart-panel-open {
    overflow: hidden;
}