/**
 * DS Parts - Wildberries UX/UI Cart Stylesheet
 * Brand Color: #0089e5
 */

:root {
    --ds-primary: #0089e5;
    --ds-primary-hover: #0072c4;
    --ds-primary-active: #0963a9;
    --ds-primary-light: #f0f7fd;
    --ds-primary-border: #c8e4fa;
    --ds-success: #10b981;
    --ds-success-bg: #ecfdf5;
    --ds-danger: #ef4444;
    --ds-danger-bg: #fef2f2;
    --ds-text: #1e242d;
    --ds-text-secondary: #64748b;
    --ds-text-muted: #94a3b8;
    --ds-bg-page: #f8fafc;
    --ds-bg-card: #ffffff;
    --ds-border: #e2e8f0;
    --ds-border-light: #f1f5f9;
    --ds-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --ds-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --ds-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --ds-radius-sm: 8px;
    --ds-radius: 14px;
    --ds-radius-lg: 20px;
    --ds-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bc-wb-cart-wrapper * {
    box-sizing: border-box;
}

.bc-wb-cart-wrapper {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto 40px;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ds-text);
}

/* Hide uncompiled Vue template until loaded */
.bc-cart-page-inner-w[v-cloak] {
    display: none !important;
}

/* Main 2-column Grid */
.bc-wb-cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

/* LEFT COLUMN - Items Main Area */
.bc-wb-cart-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Header Control Panel */
.bc-wb-cart-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow-sm);
}

.bc-wb-panel-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bc-wb-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-text);
}

.bc-wb-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bc-wb-custom-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--ds-transition);
    flex-shrink: 0;
}

.bc-wb-checkbox:checked + .bc-wb-custom-checkbox {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
}

.bc-wb-checkbox:checked + .bc-wb-custom-checkbox::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.bc-wb-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--ds-primary-light);
    color: var(--ds-primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--ds-primary-border);
}

.bc-wb-btn-delete-selected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--ds-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--ds-radius-sm);
    transition: var(--ds-transition);
}

.bc-wb-btn-delete-selected:hover {
    color: var(--ds-danger);
    background: var(--ds-danger-bg);
}

/* Product Cards List */
.bc-wb-cart-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Product Card */
.bc-wb-cart-card {
    display: grid;
    grid-template-columns: 28px 100px 1fr 140px 110px 48px;
    align-items: center;
    gap: 18px;
    padding: 20px;
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow-sm);
    transition: var(--ds-transition);
}

.bc-wb-cart-card:hover {
    border-color: var(--ds-primary-border);
    box-shadow: var(--ds-shadow);
}

/* Card Checkbox */
.bc-wb-card-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Box */
.bc-wb-card-image-box {
    width: 100px;
    height: 100px;
    border-radius: var(--ds-radius-sm);
    background: #f8fafc;
    border: 1px solid var(--ds-border-light);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bc-wb-card-img-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.bc-wb-card-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.bc-wb-cart-card:hover .bc-wb-card-img {
    transform: scale(1.05);
}

.bc-wb-card-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product Details */
.bc-wb-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.bc-wb-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ds-text);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--ds-transition);
}

.bc-wb-card-title:hover {
    color: var(--ds-primary);
}

.bc-wb-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    font-size: 12px;
}

.bc-wb-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bc-wb-meta-lbl {
    color: var(--ds-text-secondary);
}

.bc-wb-meta-val {
    color: var(--ds-text);
    font-weight: 500;
}

.bc-wb-meta-val.bc-wb-articul {
    font-weight: 600;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.bc-wb-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.bc-wb-stock-badge.in-stock {
    background: var(--ds-success-bg);
    color: var(--ds-success);
}

/* Price Section */
.bc-wb-card-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.bc-wb-price-current {
    font-size: 18px;
    font-weight: 700;
    color: var(--ds-text);
    white-space: nowrap;
}

.bc-wb-price-old-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bc-wb-price-old {
    font-size: 13px;
    color: var(--ds-text-muted);
    text-decoration: line-through;
    white-space: nowrap;
}

.bc-wb-discount-tag {
    display: inline-block;
    padding: 1px 5px;
    background: #fee2e2;
    color: #ef4444;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
}

/* Quantity Counter */
.bc-wb-card-counter-block {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bc-wb-counter {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 3px 4px;
    border: 1px solid var(--ds-border);
}

.bc-wb-counter-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 600;
    color: var(--ds-text);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: var(--ds-transition);
}

.bc-wb-counter-btn:hover:not(:disabled) {
    background: var(--ds-primary);
    color: #fff;
}

.bc-wb-counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.bc-wb-counter-input {
    width: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-text);
    padding: 0;
    outline: none;
    -moz-appearance: textfield;
}

.bc-wb-counter-input::-webkit-outer-spin-button,
.bc-wb-counter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Card Action Buttons (Fav & Del) */
.bc-wb-card-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bc-wb-card-act-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--ds-text-secondary);
    cursor: pointer;
    transition: var(--ds-transition);
}

.bc-wb-card-act-btn.btn-fav:hover {
    color: #ef4444;
    background: #fef2f2;
}

.bc-wb-card-act-btn.btn-fav.active {
    color: #ef4444;
    background: #fef2f2;
}

.bc-wb-card-act-btn.btn-fav.active svg {
    fill: #ef4444;
    stroke: #ef4444;
}

.bc-wb-card-act-btn.btn-delete:hover {
    color: var(--ds-danger);
    background: var(--ds-danger-bg);
}

/* RIGHT COLUMN - Sticky Order Summary */
.bc-wb-cart-sidebar {
    position: sticky;
    top: 90px;
}

.bc-wb-summary-box {
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    padding: 24px;
    box-shadow: var(--ds-shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bc-wb-summary-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--ds-text);
    margin: 0;
}

/* Delivery Preview */
.bc-wb-delivery-preview {
    background: #f8fafc;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bc-wb-delivery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bc-wb-delivery-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-text);
}

.bc-wb-delivery-change {
    font-size: 12px;
    color: var(--ds-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--ds-transition);
}

.bc-wb-delivery-change:hover {
    color: var(--ds-primary-hover);
    text-decoration: underline;
}

.bc-wb-delivery-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ds-text);
}

.bc-wb-delivery-hint {
    font-size: 11px;
    color: var(--ds-text-secondary);
    line-height: 1.35;
}

.bc-wb-summary-divider {
    height: 1px;
    background: var(--ds-border);
    margin: 0;
}

/* Rows Breakdown */
.bc-wb-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bc-wb-sum-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--ds-text-secondary);
}

.bc-wb-sum-val {
    font-weight: 600;
    color: var(--ds-text);
}

.bc-wb-sum-row.discount .bc-wb-sum-val {
    color: var(--ds-danger);
}

.bc-wb-delivery-text {
    color: var(--ds-primary);
}

/* Total */
.bc-wb-summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.bc-wb-total-lbl {
    font-size: 18px;
    font-weight: 700;
    color: var(--ds-text);
}

.bc-wb-total-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--ds-text);
    letter-spacing: -0.5px;
}

/* Minimal Order Warning */
.bc-wb-min-order-alert {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--ds-radius-sm);
    padding: 10px 14px;
    font-size: 12px;
}

.bc-wb-min-order-title {
    color: #92400e;
    font-weight: 600;
}

.bc-wb-min-order-diff {
    color: #b45309;
    margin-top: 2px;
}

/* Big Checkout Button */
.bc-wb-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    background: var(--ds-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--ds-radius);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 137, 229, 0.35);
    transition: var(--ds-transition);
}

.bc-wb-btn-checkout:hover:not(:disabled) {
    background: var(--ds-primary-hover);
    box-shadow: 0 6px 20px rgba(0, 137, 229, 0.45);
    transform: translateY(-1px);
}

.bc-wb-btn-checkout:active:not(:disabled) {
    background: var(--ds-primary-active);
    transform: translateY(0);
}

.bc-wb-btn-checkout:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Trust & Guarantee Perks */
.bc-wb-summary-perks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.bc-wb-perk-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--ds-text-secondary);
    font-weight: 500;
}

/* EMPTY CART STATE */
.bc-wb-empty-cart {
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    padding: 60px 24px;
    text-align: center;
    box-shadow: var(--ds-shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 720px;
    margin: 30px auto;
}

.bc-wb-empty-icon-circle {
    width: 110px;
    height: 110px;
    background: var(--ds-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    border: 2px solid var(--ds-primary-border);
}

.bc-wb-empty-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ds-text);
    margin: 0 0 10px 0;
}

.bc-wb-empty-text {
    font-size: 15px;
    color: var(--ds-text-secondary);
    max-width: 460px;
    margin: 0 0 28px 0;
    line-height: 1.5;
}

.bc-wb-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    background: var(--ds-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--ds-radius);
    box-shadow: 0 4px 14px rgba(0, 137, 229, 0.3);
    transition: var(--ds-transition);
}

.bc-wb-empty-btn:hover {
    background: var(--ds-primary-hover);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 137, 229, 0.45);
    transform: translateY(-2px);
}

/* Category Recommendations */
.bc-wb-empty-suggestions {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--ds-border);
    width: 100%;
}

.bc-wb-sugg-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ds-text);
    margin: 0 0 16px 0;
}

.bc-wb-sugg-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.bc-wb-chip {
    padding: 8px 16px;
    background: #f1f5f9;
    color: var(--ds-text);
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid var(--ds-border);
    transition: var(--ds-transition);
}

.bc-wb-chip:hover {
    background: var(--ds-primary-light);
    color: var(--ds-primary);
    border-color: var(--ds-primary-border);
}

/* Toast Notifications */
.bc-wb-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.bc-wb-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.bc-wb-toast.success {
    background: #0f172a;
    border-left: 4px solid var(--ds-success);
}

/* =======================================================
   RESPONSIVE DESIGN FOR TABLETS & MOBILES
   ======================================================= */

@media (max-width: 991px) {
    .bc-wb-cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .bc-wb-cart-sidebar {
        position: static;
        order: 2;
    }

    .bc-wb-cart-main {
        order: 1;
    }

    .bc-wb-cart-card {
        grid-template-columns: 24px 80px 1fr 110px 40px;
        gap: 14px;
        padding: 16px;
    }

    .bc-wb-card-price-block {
        grid-column: 3 / 4;
        margin-top: 4px;
    }
}

@media (max-width: 576px) {
    .bc-wb-cart-panel {
        padding: 12px 14px;
    }

    .bc-wb-checkbox-text {
        font-size: 13px;
    }

    .bc-wb-count-badge {
        font-size: 11px;
        padding: 2px 8px;
    }

    .bc-wb-btn-delete-selected span {
        display: none;
    }

    .bc-wb-btn-delete-selected {
        padding: 6px;
    }

    .bc-wb-cart-card {
        grid-template-columns: 20px 70px 1fr;
        grid-template-rows: auto auto;
        gap: 12px 10px;
        padding: 14px 12px;
    }

    .bc-wb-card-image-box {
        width: 70px;
        height: 70px;
    }

    .bc-wb-card-info {
        grid-column: 3 / 4;
    }

    .bc-wb-card-price-block {
        grid-column: 2 / 3;
        grid-row: 2 / 3;
    }

    .bc-wb-card-counter-block {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
        justify-content: flex-start;
    }

    .bc-wb-card-actions {
        grid-column: 3 / 4;
        grid-row: 2 / 3;
        flex-direction: row;
        justify-content: flex-end;
    }

    .bc-wb-price-current {
        font-size: 16px;
    }

    .bc-wb-summary-box {
        padding: 18px 16px;
    }
}
