/**
 * BC Mini Cart — off-canvas panel + count badge.
 * Lightweight replacement for etheme-off-canvas.css (~26KB).
 * Targets same class names so XStore markup renders correctly.
 */

/* ===========================================
   Cart Count Badge (on header icon)
   =========================================== */
.bc-nav-bar__cart-wrapper {
    position: relative;
    display: inline-flex;
}

.bc-cart-count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    background: var(--bc-hot-pink);
    color: #fff;
    font-family: var(--bc-font-body);
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

/* ===========================================
   Overlay / backdrop
   =========================================== */
#bc-mini-cart .etheme-elementor-off-canvas__container {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0s 0.4s;
}

#bc-mini-cart.etheme-elementor-off-canvas--active .etheme-elementor-off-canvas__container {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s, visibility 0s;
}

/* ===========================================
   Panel
   =========================================== */
#bc-mini-cart .etheme-elementor-off-canvas__main {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    width: 370px;
    max-width: 100%;
    padding: 20px 30px;
    background: #fff;
    color: var(--et_dark-2-white, #222);
    font-size: 14px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0s 0.3s;
}

#bc-mini-cart.etheme-elementor-off-canvas--active .etheme-elementor-off-canvas__main {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s, opacity 0.3s, visibility 0s;
}

body.etheme-elementor-off-canvas--shown {
    overflow: hidden;
}

@media (max-width: 420px) {
    #bc-mini-cart .etheme-elementor-off-canvas__main {
        width: calc(100vw - 3em - 20px);
    }
}

/* ===========================================
   Close button (circle outside panel)
   =========================================== */
#bc-mini-cart .etheme-elementor-off-canvas__close-button {
    position: absolute;
    right: calc(100% + 15px);
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75em;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #222;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

#bc-mini-cart .etheme-elementor-off-canvas__close-button:hover {
    background: #e1e1e1;
    color: #555;
}

#bc-mini-cart .etheme-elementor-off-canvas__close-button svg {
    width: 1em;
    height: 1em;
}

/* ===========================================
   Head (cart icon)
   =========================================== */
#bc-mini-cart .etheme-elementor-off-canvas_content-head {
    font-size: 1.2em;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--et_border-color, #e1e1e1);
    padding-bottom: 15px;
}

#bc-mini-cart .etheme-elementor-off-canvas_content-head a {
    color: currentColor;
    text-decoration: none;
}

#bc-mini-cart .etheme-elementor-off-canvas_content-head-icon {
    font-size: 1.4em;
    line-height: 1;
}

/* ===========================================
   Content (scrollable cart items)
   =========================================== */
#bc-mini-cart .etheme-elementor-off-canvas_content {
    flex: 1;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

#bc-mini-cart .etheme-elementor-off-canvas_content:not(:hover)::-webkit-scrollbar-thumb,
#bc-mini-cart .etheme-elementor-off-canvas_content:not(:hover)::-webkit-scrollbar {
    opacity: 0;
    visibility: hidden;
}

/* --- Cart item list ------------------------------------------ */
#bc-mini-cart .cart-widget-products {
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: none;
}

#bc-mini-cart .cart-widget-products li {
    padding: 20px 12px;
    border-radius: 3px;
    transition: background 0.3s;
}

#bc-mini-cart .cart-widget-products li:not(:last-child) {
    border-bottom: 1px solid var(--et_border-color, #e1e1e1);
}

#bc-mini-cart .cart-widget-products li:hover {
    background: var(--et_light-color, #f8f8f8);
}

/* Remove button — visible only on hover */
#bc-mini-cart .cart-widget-products .remove {
    display: inline-flex;
    align-items: center;
    margin-inline-end: 10px;
    margin-top: 10px;
    line-height: 1;
    transition: opacity 0.2s, margin 0.2s;
}

@media (hover: hover) {
    #bc-mini-cart .cart-widget-products li:not(:hover) .remove {
        margin-inline-end: 0;
        opacity: 0;
    }
}

/* Product title */
#bc-mini-cart .product-title a {
    white-space: wrap;
    overflow: visible;
    text-overflow: ellipsis;
}

/* Variation attributes on separate line */
#bc-mini-cart .bc-mini-cart-attrs {
    display: block;
    font-size: 90%;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 2px;
}

/* ===========================================
   Footer (subtotal + buttons)
   =========================================== */
#bc-mini-cart .etheme-elementor-off-canvas_content-footer12 {
    flex-shrink: 0;
    padding-top: 15px;
}

/* Subtotal row */
#bc-mini-cart .cart-widget-subtotal {
    border-top: 1px solid var(--et_border-color, #e1e1e1);
    border-bottom: 1px solid var(--et_border-color, #e1e1e1);
    padding: 1em 0;
}

#bc-mini-cart .cart-widget-subtotal .big-coast {
    font-size: 114%;
}

#bc-mini-cart .cart-widget-subtotal .small-h {
    text-transform: uppercase;
}

/* "View cart" button in footer */
#bc-mini-cart .mini-cart-buttons .wc-forward:not(.btn-checkout) {
    color: var(--et_btn-color, #222);
    background-color: var(--et_btn-bg-color, #f2f2f2);
    border: 2px solid var(--et_btn-br-color, #f2f2f2);
}

#bc-mini-cart .mini-cart-buttons .wc-forward:not(.btn-checkout):hover {
    opacity: 0.85;
}

/* Action buttons */
#bc-mini-cart .mini-cart-buttons {
    margin-bottom: 0;
    line-height: 1.6;
    font-size: 1.14rem;
}

#bc-mini-cart .mini-cart-buttons a {
    display: block;
    padding: 1rem 1.7rem;
    text-align: center;
    line-height: 1;
    font-size: 85%;
    text-decoration: none;
}

#bc-mini-cart .mini-cart-buttons a:not(:first-child) {
    margin-top: 9px;
}

/* Empty cart — hide footer */
#bc-mini-cart:has(.woocommerce-mini-cart__empty-message) .etheme-elementor-off-canvas_content-footer12,
#bc-mini-cart:has(.product_list_widget:empty) .etheme-elementor-off-canvas_content-footer12 {
    display: none;
}

#bc-mini-cart .woocommerce-mini-cart__empty-message {
    text-align: center;
    padding: 2em 0;
}
