.cart-container { background: #ffffff; padding: 3rem; border-radius: 8px; box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.08); }
.cart-title { font-size: 1.6rem; font-weight: 600; color: #222; margin-bottom: 2rem; }
.cart-content { display: grid; grid-template-columns: 1fr 380px; gap: 3rem; }
.cart-items { display: flex; flex-direction: column; gap: 1.5rem; overflow: hidden; }
.cart-item-image { width: 100px; height: 100px; border-radius: 8px; overflow: hidden; background: #eee; }
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-name { font-size: 1.1rem; font-weight: 500; color: #222; margin-bottom: 0.5rem; }
.cart-item-price { font-size: 0.9rem; color: #666; }
.cart-item-quantity { display: flex; align-items: center; margin: 1rem; gap: 0.5rem; }
.qty-btn { width: 32px; height: 32px; border: 1px solid #ddd; background: #fff; border-radius: 4px; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.qty-btn:hover { background: #222; color: #fff; border-color: #222; }
.qty-input { width: 57px; text-align: center; border: 1px solid #ddd; border-radius: 4px; padding: 0.4rem; font-size: 1rem; font-family: 'Manrope', sans-serif; }
.cart-item-total { font-size: 1.1rem; font-weight: 600; color: #222; text-align: right; }

.cart-summary { background: #f9f9f9; padding: 2rem; border-radius: 8px; height: fit-content; position: sticky; top: 2rem; }
.summary-title { font-size: 1.5rem; font-weight: 500; color: #222; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #e0e0e0; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 1rem; font-size: 1rem; color: #666; }
.summary-total { font-size: 1.3rem; font-weight: 600; color: #222; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #e0e0e0; }
.btn-checkout { width: 100%; background: var(--primary); color: #fff; border: none; padding: 1rem; border-radius: 50px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background 0.3s ease; margin-top: 1.5rem; font-family: 'Manrope', sans-serif; }
.btn-checkout:hover { background: var(--primary-h); }
.btn-clear-cart { width: 100%; background: transparent; color: #999; border: 1px solid #ddd; padding: 0.75rem; border-radius: 50px; font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; margin-top: 1rem; font-family: 'Manrope', sans-serif; }
.btn-clear-cart:hover { border-color: #e74c3c; color: #e74c3c; }
.btn-continue-shopping-mobile { display: none; text-align: center; margin-top: 1rem; color: #222; text-decoration: none; font-size: 0.95rem; }

.cart-empty { text-align: center; padding: 4rem 2rem; }
.cart-empty svg { margin-bottom: 2rem; }
.cart-empty h2 { font-size: 1.8rem; font-weight: 400; color: #222; margin-bottom: 1rem; }
.cart-empty p { font-size: 1.1rem; color: #666; margin-bottom: 2rem; }

.toast { position: fixed; bottom: 30px; right: 30px; background: #222; color: #fff; padding: 1rem 1.5rem; border-radius: 8px; font-size: 0.95rem; z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transform: translateY(100px); opacity: 0; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.toast.show { transform: translateY(0); opacity: 1; }

.out-of-stock-item { background: #fcfcfc; border: 1px dashed #ddd; }
.out-of-stock-badge { display: inline-block; margin-top: 0.5rem; padding: 0.35rem 0.75rem; background: #fff3f3; color: #e74c3c; font-size: 0.85rem; font-weight: 500; border-radius: 4px; border: 1px solid #f8d7da; }
.out-of-stock-placeholder { display: flex; align-items: center; justify-content: center; color: #999; font-size: 0.9rem; font-style: italic; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.9rem; color: #666; margin-bottom: 0.4rem; font-weight: 500; }
.form-input { width: 100%; padding: 0.75rem 1rem; border: 1px solid #eeeeee; border-radius: 50px; font-size: 0.95rem; font-family: 'Manrope', sans-serif; outline: none; transition: border-color 0.3s ease; box-sizing: border-box; }
.form-input:focus { border-color: #222; }
textarea.form-input { border-radius: 8px; resize: vertical; }

.btn-submit-order { width: 100%; background: var(--primary); color: #fff; border: none; padding: 1rem; border-radius: 50px; font-size: 1rem; font-weight: 500; cursor: pointer; transition: background 0.3s ease; margin-top: 1rem; font-family: 'Manrope', sans-serif; }
.btn-submit-order:hover { background: var(--primary-h); }
.btn-cancel-order { width: 100%; background: transparent; color: #999; border: 1px solid #ddd; padding: 0.75rem; border-radius: 50px; font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; margin-top: 0.5rem; font-family: 'Manrope', sans-serif; }
.btn-cancel-order:hover { border-color: #999; color: #666; }

/* Стили для выбора службы доставки */
.delivery-services { display: flex; flex-direction: column; gap: 0.75rem; }
.delivery-service-option { display: flex; align-items: center; padding: 1rem; border: 2px solid #ddd; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; }
.delivery-service-option:hover { border-color: #222; }
.delivery-service-option:has(input:checked) { border-color: #222; background: #f5f5f5; }
.delivery-service-option input[type="radio"] { display: none; }
.service-content { display: flex; flex-direction: column; flex: 1; }
.service-name { font-weight: 600; font-size: 1rem; color: #222; margin-bottom: 0.25rem; }
.service-desc { font-size: 0.85rem; color: #666; }

/* Стили для DPD */
.dpd-service-types { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.dpd-service-type { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem; border: 1px solid #ddd; border-radius: 50px; cursor: pointer; transition: all 0.2s ease; font-size: 0.9rem; }
.dpd-service-type:hover { border-color: #222; }
.dpd-service-type:has(input:checked) { border-color: #222; background: #f5f5f5; }
.dpd-service-type input[type="radio"] { display: none; }

.cities-dropdown { position: absolute; z-index: 1000; background: #fff; border: 1px solid #ddd; border-radius: 8px; max-height: 250px; overflow-y: auto; width: 100%; max-width: 320px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); margin-top: 0.5rem; }
.city-option { padding: 0.75rem 1rem; cursor: pointer; border-bottom: 1px solid #f0f0f0; transition: background 0.2s; }
.city-option:hover { background: #f5f5f5; }
.city-name { font-weight: 500; color: #222; }
.city-region { font-size: 0.85rem; color: #666; }

.cdek-pvz-list { margin-top: 1rem; max-height: 250px; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 8px; padding: 0.75rem; background: #fff; }
.cdek-pvz-title { font-size: 0.85rem; font-weight: 600; color: #444; display: block; margin-bottom: 0.5rem; }
.cdek-pvz-item { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.5rem; border-bottom: 1px solid #f0f0f0; cursor: pointer; font-size: 0.85rem; transition: background 0.2s; }
.cdek-pvz-item:last-child { border-bottom: none; }
.cdek-pvz-item:hover { background: #f5f5f5; }
.cdek-pvz-item input[type="radio"] { margin-top: 3px; }
.cdek-pvz-item-info { flex: 1; }
.cdek-pvz-item-name { font-weight: 600; color: #222; }
.cdek-pvz-item-address { color: #666; font-size: 0.8rem; }
.cdek-pvz-item-time { color: #999; font-size: 0.75rem; }

.cdek-delivery-info { margin-top: 1rem; padding: 1rem; background: #eaf7ee; border: 1px solid #b7e4c7; border-radius: 8px; }
.cdek-delivery-row { display: flex; justify-content: space-between; font-size: 0.9rem; color: #444; margin-bottom: 0.4rem; }
.cdek-delivery-cost { font-weight: 700; font-size: 1.05rem; color: #27ae60; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid #b7e4c7; }
.cdek-loading { text-align: center; padding: 1rem; color: #666; font-size: 0.9rem; }
.cdek-error { margin-top: 0.75rem; padding: 0.75rem; background: #fff3f3; color: #e74c3c; border-radius: 8px; font-size: 0.85rem; border: 1px solid #f8d7da; }

.btn-find-pvz { width: 100%; margin-top: 0.5rem; padding: 0.6rem; background: #3498db; color: #fff; border: none; border-radius: 50px; font-size: 0.9rem; cursor: pointer; font-family: 'Manrope', sans-serif; transition: background 0.3s; }
.btn-find-pvz:hover { background: #2980b9; }

.cdek-pvz-filter { position: relative; top: 0; background: #fff; border-bottom: 1px solid #f0f0f0; z-index: 2; }
.cdek-pvz-filter-input { padding: 0.5rem 0.9rem !important; font-size: 0.85rem !important; border-radius: 50px !important; background: #f5f5f5; border: 1px solid #e0e0e0 !important; }
.cdek-pvz-filter-input:focus { background: #fff; border-color: #222 !important; }
.cdek-pvz-filter-count { display: block; text-align: right; font-size: 0.75rem; color: #999; margin-top: 0.3rem; padding-right: 0.5rem; }
.cdek-pvz-empty { text-align: center; padding: 1.5rem 1rem; color: #999; font-size: 0.9rem; font-style: italic; }

.form-input:invalid { border-color: #e74c3c; }
.phone-error { animation: shake 0.4s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cart-item-delivery-methods {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.delivery-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #f7f7f7;
    cursor: help; /* Показывает значок вопроса при наведении */
    transition: background-color 0.2s, border-color 0.2s;
}

.delivery-icon-badge:hover {
    background: #ffffff;
    border-color: #ced4da;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
.cart-content { display: flow; grid-template-columns: 1fr; }
.cart-summary { position: static; margin-top: 2rem; }
.cart-item-header { display: inline-grid; grid-template-columns: 100px 1fr 115px 0px; }

}
@media (max-width: 640px) {
.cart-container { padding: 2rem 1rem; }
.cart-title { font-size: 2rem; }
.btn-continue-shopping-mobile { display: block; }
.dpd-service-types { grid-template-columns: 1fr; }
}
.cart-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 0.8rem;
    padding: 15px;
    border-radius: 8px;
}

.cart-item-header {
    grid-column: 2;
    display: inline-grid;
    grid-template-columns: 100px 1fr 110px 36px;
    align-items: center;
    gap: 0.8rem;
}

.cart-item-body {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 400px;
}
/* Стили для "Выбрать все" */
.cart-select-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    color: #222;
    font-weight: 500;
}

.select-all-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #222;
}

.btn-delete-selected {
    background: transparent;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Manrope', sans-serif;
}

.btn-delete-selected:hover {
    background: #e74c3c;
    color: #fff;
}

/* Стили для чекбоксов товаров */
.cart-item-checkbox-wrapper {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
}

.cart-item-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #222;
}
.cart-item-old-price,
.cart-item-old-total {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.cart-item-discount-badge {
    display: inline-block;
    background: #ff4757;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-right: 4px;
    font-weight: 600;
}

.cart-item-current-price,
.cart-item-current-total {
    font-weight: 600;
    color: #222;
}
/* 🆕 Стили для товаров, недоступных при выбранном способе доставки */
.cart-item-unavailable {
    opacity: 0.4;
    filter: grayscale(100%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Возвращаем чекбоксу нормальный вид, чтобы его можно было использовать для удаления товара */
.cart-item-unavailable .cart-item-checkbox-wrapper,
.cart-item-unavailable .cart-item-checkbox {
    opacity: 1;
    filter: none;
    pointer-events: auto;
}

/* Дополнительно: делаем неактивными кнопки изменения количества для таких товаров */
.cart-item-unavailable .qty-btn {
    pointer-events: none;
    opacity: 0.5;
}
/* Блок итоговой сводки внутри формы оформления */
.order-summary-block {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f0f7ff;
    border: 1px solid #eeeeee;
    border-radius: 8px;
}

.order-summary-block .summary-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    color: #222;
}

.order-summary-block .summary-row {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.order-summary-block .summary-total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #d0e3f5;
    font-size: 1.2rem;
    font-weight: 600;
    color: #222;
}
.cart-flash {
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
}
.cart-flash--error {
    background: #fff3f3;
    color: #e74c3c;
    border: 1px solid #f8d7da;
}
/* Адаптивность */
@media (max-width: 640px) {
    .cart-select-all {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .cart-item {
        grid-template-columns: 20px 1fr;
        gap: 0.8rem;
        padding: 0;
    }
    .btn-delete-selected {
        width: 100%;
    }
    .cart-item-body { width: 250px; }
    .cart-item-header { display: flow; }
}
@media (max-width: 480px) {
    .cart-item-body { width: 185px; }
}