﻿/* =====================================================
   BD CART PAGE
   ===================================================== */

.bd-page-body { padding: 40px 0 60px; }

.bd-cart-page { padding: 10px 0 60px; }

.bd-cart-title-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.bd-cart-title-bar h1 {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bd-cart-title-bar h1 i { color: #ff4da6; }

.bd-item-badge {
    background: #fdf2f8;
    color: #be185d;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

/* Empty cart */
.bd-empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    border: 2px dashed #e5e7eb;
}

.bd-empty-cart .bd-empty-icon {
    font-size: 64px;
    color: #e5e7eb;
    margin-bottom: 20px;
}

.bd-empty-cart h3 { font-size: 22px; margin-bottom: 8px; color: #374151; }
.bd-empty-cart p  { color: #6b7280; margin-bottom: 24px; }

/* Layout */
.bd-cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}

/* ----- Cart Items Column ----- */
.bd-cart-items-col {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.bd-cart-grid { display: flex; flex-direction: column; }

.bd-cart-grid-head {
    display: grid;
    grid-template-columns: 40px 1fr 100px 110px 100px;
    gap: 12px;
    padding: 12px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
}

.bd-cart-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px 110px 100px;
    gap: 12px;
    padding: 16px 20px;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.bd-cart-row:last-child { border-bottom: none; }
.bd-cart-row:hover { background: #fafafa; }

/* Remove button */
.bd-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.bd-remove-btn:hover { color: #ef4444; background: #fef2f2; }

/* Product cell */
.bd-cr-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bd-cart-thumb img {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

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

.bd-cart-item-name {
    display: block;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Price / Total cells */
.bd-cr-price,
.bd-cr-total {
    font-weight: 600;
    color: #111827;
    font-size: 15px;
}

/* Qty input */
.bd-cr-qty .qty {
    width: 64px !important;
    padding: 7px 10px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    background: #fff;
    color: #111827;
}

.bd-cr-qty .qty:focus { border-color: #ff4da6 !important; outline: none !important; }

/* Actions bar */
.bd-cart-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 2px solid #f0f0f0;
    flex-wrap: wrap;
}

.bd-coupon-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }

.bd-coupon-input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    padding: 8px 16px;
    flex: 1;
    background: #f9fafb;
    transition: border-color 0.2s;
}

.bd-coupon-input-box:focus-within { border-color: #ff4da6; background: #fff; }
.bd-coupon-input-box i { color: #9ca3af; }

.bd-coupon-input-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    flex: 1;
    color: #111827;
}

/* ----- Totals Column (rendered by WC collaterals) ----- */
.bd-cart-totals-col .cart_totals {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.bd-cart-totals-col .cart_totals h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
    color: #111827;
}

.bd-cart-totals-col .shop_table { width: 100%; border-collapse: collapse; }
.bd-cart-totals-col .shop_table th,
.bd-cart-totals-col .shop_table td {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    vertical-align: middle;
}

.bd-cart-totals-col .shop_table th {
    color: #6b7280;
    font-weight: 600;
    width: 40%;
}

.bd-cart-totals-col .shop_table td {
    text-align: right;
    font-weight: 700;
    color: #111827;
}

.bd-cart-totals-col .order-total th,
.bd-cart-totals-col .order-total td {
    font-size: 17px;
    font-weight: 800;
    border-bottom: none;
    padding-top: 16px;
}

.bd-cart-totals-col .order-total td { color: #ff4da6; }

.bd-cart-totals-col .wc-proceed-to-checkout {
    margin-top: 20px;
}

.bd-cart-totals-col .checkout-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    background: linear-gradient( 90deg, #ff4da6, #2563eb ) !important;
    color: #fff !important;
    border-radius: 50px !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
    border: none !important;
    cursor: pointer;
}

.bd-cart-totals-col .checkout-button:hover { opacity: 0.88; }

/* Shared button styles */
.bd-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    background: linear-gradient( 90deg, #ff4da6, #2563eb );
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    transition: opacity 0.2s;
}

.bd-btn-primary:hover { opacity: 0.88; color: #fff; }

.bd-btn-sm-outline {
    padding: 9px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    background: transparent;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.bd-btn-sm-outline:hover { border-color: #ff4da6; color: #ff4da6; }

.bd-btn-sm-ghost {
    padding: 9px 18px;
    border: 2px solid transparent;
    border-radius: 50px;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.bd-btn-sm-ghost:hover { background: #f3f4f6; color: #111827; }

/* WooCommerce notices */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    list-style: none;
}

.woocommerce-message { background: #f0fdf4; border-left: 4px solid #10b981; color: #065f46; }
.woocommerce-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
.woocommerce-error   { background: #fef2f2; border-left: 4px solid #ef4444; color: #991b1b; }

/* Responsive */
@media ( max-width: 900px ) {
    .bd-cart-layout { grid-template-columns: 1fr; }
    .bd-cart-totals-col .cart_totals { position: static; }
}

@media ( max-width: 640px ) {
    .bd-cart-grid-head { display: none; }
    .bd-cart-row {
        grid-template-columns: 1fr 40px;
        grid-template-areas:
            "prod rm"
            "price price"
            "qty   total";
        padding: 16px;
    }
    .bd-cr-remove  { grid-area: rm; }
    .bd-cr-product { grid-area: prod; }
    .bd-cr-price   { grid-area: price; font-size: 13px; color: #6b7280; }
    .bd-cr-qty     { grid-area: qty; }
    .bd-cr-total   { grid-area: total; text-align: right; }

    .bd-cr-price::before  { content: attr( data-label ) ': '; color: #9ca3af; font-size: 12px; }
    .bd-cr-qty::before    { content: attr( data-label ) ': '; color: #9ca3af; font-size: 12px; }
    .bd-cr-total::before  { content: attr( data-label ) ': '; color: #9ca3af; font-size: 12px; }

    .bd-coupon-wrap { flex-direction: column; width: 100%; }
    .bd-cart-title-bar h1 { font-size: 22px; }
}

/* Dark mode */
body.dark-mode .bd-cart-items-col,
body.dark-mode .bd-cart-totals-col .cart_totals {
    background: #1e293b;
    border-color: rgba(255,255,255,0.08);
}

body.dark-mode .bd-cart-grid-head { background: #0f172a; }
body.dark-mode .bd-cart-row:hover { background: rgba(255,255,255,0.03); }
body.dark-mode .bd-cart-item-name,
body.dark-mode .bd-cr-price,
body.dark-mode .bd-cr-total { color: #e2e8f0; }
body.dark-mode .bd-cart-title-bar h1 { color: #f1f5f9; }
body.dark-mode .bd-coupon-input-box { background: #0f172a; border-color: rgba(255,255,255,0.1); }
body.dark-mode .bd-coupon-input-box input { color: #e2e8f0; }
body.dark-mode .bd-cart-totals-col .shop_table th { color: #94a3b8; }
body.dark-mode .bd-cart-totals-col .shop_table td { color: #e2e8f0; }
body.dark-mode .bd-empty-cart { background: #1e293b; border-color: rgba(255,255,255,0.08); }
