/* =============================================
   Side Cart Drawer
   ============================================= */

/* ---------- Overlay ---------- */
.bo-side-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bo-side-cart-overlay[data-open="true"] {
    opacity: 1;
    visibility: visible;
}

/* ---------- Drawer ---------- */
.bo-side-cart {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 420px;
    z-index: 10001;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
    font-family: "Cabinet Grotesque", "Roboto", sans-serif;
}

.bo-side-cart[data-open="true"] {
    transform: translateX(0);
}

body.bo-side-cart-open {
    overflow: hidden;
}

/* ---------- Header ---------- */
.bo-side-cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.bo-side-cart__title {
    font-weight: 800;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.bo-side-cart__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #333;
    line-height: 0;
    border-radius: 4px;
    transition: background 0.15s;
}

.bo-side-cart__close:hover {
    background: #f5f5f5;
}

/* ---------- Body (scrollable, fragment-replaced) ---------- */
.bo-side-cart__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.bo-side-cart__empty {
    text-align: center;
    color: #999;
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* ---------- Cart items ---------- */
.bo-side-cart__items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bo-side-cart__item {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f5;
    transition: opacity 0.2s;
}

.bo-side-cart__item:last-child {
    border-bottom: none;
}

.bo-side-cart__item.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.bo-side-cart__item-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    background: #f9f9f9;
}

.bo-side-cart__item-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

a.bo-side-cart__item-name {
    text-decoration: none;
}

.bo-side-cart__item-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bo-side-cart__item-meta {
    font-size: 0.8rem;
    color: #888;
}

/* ---------- Quantity controls ---------- */
.bo-side-cart__qty {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 2px;
}

.bo-side-cart__qty-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 1rem;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    line-height: 1;
}

.bo-side-cart__qty-btn:hover {
    background: #f5f5f5;
}

.bo-side-cart__qty-val {
    min-width: 28px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    height: 30px;
    line-height: 30px;
}

/* ---------- Price & Remove ---------- */
.bo-side-cart__item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.bo-side-cart__item-price {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--e-global-color-accent, #f0c100);
    white-space: nowrap;
}

.bo-side-cart__item-price .woocommerce-Price-amount {
    font-size: inherit;
}

.bo-side-cart__item-price del {
    font-weight: 400;
    color: #999;
    font-size: 0.85em;
}

.bo-side-cart__item-price ins {
    text-decoration: none;
}

.bo-side-cart__remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #aaa;
    line-height: 0;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.bo-side-cart__remove:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* ---------- Totals ---------- */
.bo-side-cart__totals {
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #eee;
}

.bo-side-cart__totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    font-size: 0.9rem;
    color: #666;
}

.bo-side-cart__totals-row .woocommerce-Price-amount {
    font-size: inherit;
}

.bo-side-cart__totals-row--discount span:last-child {
    color: #17a34a;
    font-weight: 600;
}

.bo-side-cart__totals-row--total {
    padding: 10px 0 4px;
    margin-top: 4px;
    border-top: 1px solid #eee;
    font-size: 1.05rem;
    font-weight: 800;
    color: #000;
}

.bo-side-cart__totals-row--total span:last-child {
    color: var(--e-global-color-accent, #f0c100);
    font-size: 1.1rem;
}

.bo-side-cart__totals-row--total .includes_tax {
    display: block;
    font-size: 0.6em;
    font-weight: 400;
    color: #999;
    margin-top: 2px;
    text-transform: lowercase;
}

/* Shipping rows (WC renders as table) */
.bo-side-cart__totals .woocommerce-shipping-totals th,
.bo-side-cart__totals .woocommerce-shipping-totals td {
    padding: 4px 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
    border: 0;
}

.bo-side-cart__totals .woocommerce-shipping-totals td {
    text-align: right;
}

/* ---------- Footer (sticky bottom) ---------- */
.bo-side-cart__footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #fff;
}

.bo-side-cart__checkout {
    display: block;
    text-align: center;
    background: #f0c100;
    color: #000;
    font-weight: 900;
    font-size: 0.95rem;
    text-transform: uppercase;
    padding: 0.85rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    transition: background 0.2s;
    font-family: "Cabinet Grotesque", "Roboto", sans-serif;
}

.bo-side-cart__checkout:hover {
    background: #d4aa00;
    color: #000;
}

.bo-side-cart__continue {
    display: block;
    width: 100%;
    text-align: center;
    background: transparent;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    border: 1.5px solid #ddd;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-family: "Cabinet Grotesque", "Roboto", sans-serif;
}

.bo-side-cart__continue:hover {
    border-color: #bbb;
    background: #fafafa;
}

/* ---------- Cross-sell carousel inside drawer ---------- */
.bo-side-cart__body .bo-upsell-carousel {
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.bo-side-cart__body .bo-upsell-carousel__heading {
    font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .bo-side-cart {
        max-width: 100%;
    }
}
