/* ================================================================
   BINNDU — Cart Sidebar CSS
   File: assets/css/cart-sidebar.css
   ================================================================ */

/* ── Overlay ── */
.cart-sidebar__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 299;
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
    backdrop-filter: blur(2px);
}
.cart-sidebar__overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Sidebar Panel ── */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100%;
    background: #fff;
    z-index: 300;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,.15);
}
.cart-sidebar.open {
    transform: translateX(0);
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        border-radius: 0;
    }
}

/* ── Header ── */
.cart-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    flex-shrink: 0;
}

.cart-sidebar__title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-sidebar__title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: #5C1E3A;
    border-radius: 2px;
}

.cart-sidebar__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #5C1E3A;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
}

/* Close button */
.cart-sidebar__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}
.cart-sidebar__close:hover {
    background: #fdf2f6;
    border-color: #5C1E3A;
    color: #5C1E3A;
}

/* ── Body (scrollable) ── */
.cart-sidebar__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}
.cart-sidebar__body::-webkit-scrollbar {
    width: 4px;
}
.cart-sidebar__body::-webkit-scrollbar-track {
    background: transparent;
}
.cart-sidebar__body::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 2px;
}

/* ── WooCommerce Mini Cart Override ── */
.cart-sidebar__body .woocommerce-mini-cart {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cart-sidebar__body .woocommerce-mini-cart__empty-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.cart-sidebar__body .woocommerce-mini-cart__empty-message::before {
    content: '🛍️';
    font-size: 52px;
    margin-bottom: 16px;
    display: block;
}

.cart-sidebar__body .woocommerce-mini-cart__empty-message p,
.cart-sidebar__body p.woocommerce-mini-cart__empty-message {
    font-size: 15px;
    color: #6b7280;
    font-weight: 500;
    margin: 0 0 4px;
}

/* ── Cart Items ── */
.cart-sidebar__body .woocommerce-mini-cart-item,
.cart-sidebar__body .mini_cart_item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    transition: background .15s;
}
.cart-sidebar__body .woocommerce-mini-cart-item:hover,
.cart-sidebar__body .mini_cart_item:hover {
    background: #fdf2f6;
}

/* Product image */
.cart-sidebar__body .woocommerce-mini-cart-item img,
.cart-sidebar__body .mini_cart_item img {
    width: 72px !important;
    height: 90px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    border: 1px solid #e5e7eb !important;
    flex-shrink: 0 !important;
    order: 2; /* Image right side */
}

/* Item details */
.cart-sidebar__body .woocommerce-mini-cart-item > a:not(.remove_from_cart_button),
.cart-sidebar__body .mini_cart_item > a:not(.remove_from_cart_button) {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.4;
    display: block;
    order: 1;
}
.cart-sidebar__body .woocommerce-mini-cart-item > a:not(.remove_from_cart_button):hover {
    color: #5C1E3A;
}

/* Quantity x Price */
.cart-sidebar__body .woocommerce-mini-cart-item .quantity,
.cart-sidebar__body .mini_cart_item .quantity {
    font-size: 13px;
    color: #6b7280;
    display: block;
    margin-top: 4px;
}

.cart-sidebar__body .woocommerce-mini-cart-item .woocommerce-Price-amount,
.cart-sidebar__body .mini_cart_item .woocommerce-Price-amount {
    color: #5C1E3A;
    font-weight: 700;
    font-size: 15px;
}

/* Remove button */
.cart-sidebar__body .remove_from_cart_button {
    position: absolute;
    top: 14px;
    left: 24px;
    width: 22px;
    height: 22px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    text-decoration: none;
    line-height: 1;
    transition: all .2s;
    font-weight: 700;
}
.cart-sidebar__body .remove_from_cart_button:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* ── Footer — Total + Buttons ── */
.cart-sidebar__body .woocommerce-mini-cart__total,
.cart-sidebar__body .total {
    padding: 16px 24px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
}

.cart-sidebar__body .woocommerce-mini-cart__total strong,
.cart-sidebar__body .total strong {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}

.cart-sidebar__body .woocommerce-mini-cart__total .woocommerce-Price-amount,
.cart-sidebar__body .total .woocommerce-Price-amount {
    font-size: 20px;
    font-weight: 800;
    color: #5C1E3A;
}

/* CTA buttons */
.cart-sidebar__body .woocommerce-mini-cart__buttons,
.cart-sidebar__body .wc-proceed-to-checkout {
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

.cart-sidebar__body .woocommerce-mini-cart__buttons a,
.cart-sidebar__body .wc-proceed-to-checkout a {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all .2s;
    cursor: pointer;
}

/* View Cart button */
.cart-sidebar__body .woocommerce-mini-cart__buttons .button:not(.checkout),
.cart-sidebar__body .woocommerce-mini-cart__buttons a.cart {
    background: #fff;
    color: #5C1E3A;
    border: 2px solid #5C1E3A;
}
.cart-sidebar__body .woocommerce-mini-cart__buttons .button:not(.checkout):hover {
    background: #fdf2f6;
}

/* Checkout button */
.cart-sidebar__body .woocommerce-mini-cart__buttons .checkout,
.cart-sidebar__body .woocommerce-mini-cart__buttons a.checkout {
    background: #5C1E3A !important;
    color: #fff !important;
    border: 2px solid #5C1E3A !important;
}
.cart-sidebar__body .woocommerce-mini-cart__buttons .checkout:hover,
.cart-sidebar__body .woocommerce-mini-cart__buttons a.checkout:hover {
    background: #4a1830 !important;
    border-color: #4a1830 !important;
}

/* ── Free Shipping Progress Bar ── */
.cart-sidebar__shipping-bar {
    padding: 14px 24px;
    background: #fdf2f6;
    border-bottom: 1px solid #f3e8ed;
}
.cart-sidebar__shipping-text {
    font-size: 12px;
    font-weight: 600;
    color: #5C1E3A;
    margin-bottom: 8px;
    text-align: center;
}
.cart-sidebar__shipping-track {
    height: 5px;
    background: #f9e4ed;
    border-radius: 10px;
    overflow: hidden;
}
.cart-sidebar__shipping-fill {
    height: 100%;
    background: #5C1E3A;
    border-radius: 10px;
    transition: width .5s ease;
    min-width: 4px;
}

/* ── Trust badges in cart ── */
.cart-sidebar__trust {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px 24px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}
.cart-sidebar__trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

/* ── Loading state ── */
.cart-sidebar__body.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    .cart-sidebar__header { padding: 16px 20px; }
    .cart-sidebar__body .woocommerce-mini-cart-item,
    .cart-sidebar__body .mini_cart_item { padding: 14px 20px; }
    .cart-sidebar__body .woocommerce-mini-cart__buttons,
    .cart-sidebar__body .wc-proceed-to-checkout { padding: 14px 20px 20px; }
    .cart-sidebar__body .woocommerce-mini-cart__total,
    .cart-sidebar__body .total { padding: 14px 20px; }
    .cart-sidebar__body .woocommerce-mini-cart-item img,
    .cart-sidebar__body .mini_cart_item img {
        width: 60px !important;
        height: 75px !important;
    }
}