/* Add to cart + slide-out shopping bag (see inc/cart.php, js/cart.js). */

/* Counter badge: hidden while the bag is empty. */
.bbh-cart-count[data-count="0"] { display: none !important; }
.tf-toolbar-bottom .bbh-cart-count { background-color: #aa81a1; color: #fff !important; }

/* The bag opens after adding, so Woo's "View cart" link isn't needed. */
.added_to_cart.wc-forward { display: none !important; }

/*
 * Product cards on phones/tablets: the bag + heart buttons stay hidden and appear
 * when the card is touched (the first tap acts as "hover", see js/ui.js; a second
 * tap opens the product).
 */
@media (hover: none), (max-width: 991.98px) {
    .best-seller-card .group_btn {
        opacity: 0 !important;
        pointer-events: none;
        top: auto !important;
        bottom: 10px;
        left: 50%;
        transform: translate(-50%, 8px) !important;
        transition: opacity .25s ease, transform .25s ease;
    }
    .best-seller-card:hover .group_btn,
    .best-seller-card.is-active .group_btn {
        opacity: 1 !important;
        pointer-events: auto;
        transform: translate(-50%, 0) !important;
    }
    .best-seller-card .group_btn .btn-add-to-cart { opacity: 1 !important; }
}

/* Loading / added states on add-to-cart buttons. */
.btn-add-to-cart.loading,
.single_add_to_cart_button.loading { position: relative; pointer-events: none; color: transparent !important; }
.btn-add-to-cart.loading svg { visibility: hidden; }
.btn-add-to-cart.loading::after,
.single_add_to_cart_button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid currentColor;
    border-color: #000 transparent #000 transparent;
    border-radius: 50%;
    animation: bbh-spin .7s linear infinite;
}
.single_add_to_cart_button.loading::after { border-color: #fff transparent #fff transparent; }
@keyframes bbh-spin { to { transform: rotate(360deg); } }

/* Shopping bag */
#shoppingCart { width: 420px; max-width: 100%; }
#shoppingCart .offcanvas-body { display: flex; flex-direction: column; }
.bbh-mini-cart { display: flex; flex-direction: column; flex: 1; min-height: 100%; }
.bbh-mini-cart__empty { margin: auto 0; padding: 48px 0; color: #969696; }
.bbh-mini-cart__items { flex: 1; }
.bbh-mini-cart__item {
    display: grid;
    grid-template-columns: 80px 1fr 28px;
    gap: 14px;
    align-items: start;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    transition: opacity .2s;
}
.bbh-mini-cart__item.is-updating { opacity: .45; pointer-events: none; }
.bbh-mini-cart__thumb img { width: 80px; height: 100px; object-fit: cover; background: #f3f3f3; display: block; }
.bbh-mini-cart__name { display: block; color: #333 !important; text-decoration: none; font-weight: 500; line-height: 1.3; margin-bottom: 4px; }
.bbh-mini-cart__info .variation { font-size: 13px; color: #777; margin: 0 0 4px; }
.bbh-mini-cart__info .variation dt,
.bbh-mini-cart__info .variation dd { display: inline; margin: 0; }
.bbh-mini-cart__info .variation dd p { display: inline; margin: 0; }
.bbh-mini-cart__price { color: var(--text-color, #aa81a1); margin-bottom: 10px; }
.bbh-qty { display: inline-flex; align-items: center; border: 1px solid #ddd; }
.bbh-qty__btn {
    width: 36px;
    height: 36px;
    border: 0;
    background: #fff;
    font-size: 18px;
    line-height: 1;
    color: #333;
    cursor: pointer;
}
.bbh-qty__btn:disabled { color: #ccc; cursor: default; }
.bbh-qty__val { min-width: 32px; text-align: center; font-weight: 500; }
.bbh-mini-cart__remove {
    border: 0;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: #969696;
    padding: 0;
    width: 28px;
    height: 28px;
    cursor: pointer;
}
.bbh-mini-cart__remove:hover { color: #d63638; }
.bbh-mini-cart__footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 18px 0 8px;
    border-top: 1px solid #eee;
    margin-top: auto;
}
.bbh-mini-cart__subtotal { display: flex; justify-content: space-between; font-size: 17px; margin-bottom: 6px; }
.bbh-mini-cart__note { font-size: 13px; color: #777; margin-bottom: 16px; }

.bbh-btn {
    display: inline-block;
    padding: 14px 24px;
    text-align: center;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--footer-color, #aa81a1);
    transition: background-color .2s, color .2s;
}
.bbh-btn--primary { background: var(--footer-color, #aa81a1); color: #fff !important; }
.bbh-btn--primary:hover { background: #8f6a87; border-color: #8f6a87; }
.bbh-btn--outline { background: #fff; color: var(--footer-color, #aa81a1) !important; }
.bbh-btn--outline:hover { background: #f7f2f6; }

/* Toast */
.bbh-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 2147483000;
    max-width: calc(100% - 32px);
    padding: 12px 20px;
    background: #333;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.bbh-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.bbh-toast.is-error { background: #b32d2e; }
@media (max-width: 767.98px) {
    .bbh-toast { bottom: 84px; } /* above the bottom toolbar */
}
