/**
 * Cart sidebar (drawer) styles
 */

.celm-cart-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    visibility: hidden;
    pointer-events: none;
}

.celm-cart-sidebar.is-open {
    visibility: visible;
    pointer-events: auto;
}

.celm-cart-sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.celm-cart-sidebar.is-open .celm-cart-sidebar-overlay {
    opacity: 1;
}

.celm-cart-sidebar-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.celm-cart-sidebar.is-open .celm-cart-sidebar-panel {
    transform: translateX(0);
}

.celm-cart-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.celm-cart-sidebar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.celm-cart-sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.celm-cart-sidebar-close:hover {
    color: #111827;
    background: #f3f4f6;
}

.celm-cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.celm-cart-sidebar-body .widget_shopping_cart_content,
.celm-cart-sidebar-body .woocommerce-mini-cart {
    padding: 0;
}

.celm-cart-sidebar-body .woocommerce-mini-cart-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.celm-cart-sidebar-body .woocommerce-mini-cart__buttons {
    margin-top: 16px;
}

.celm-cart-sidebar-body .woocommerce-mini-cart__buttons a {
    display: block;
    text-align: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.celm-cart-sidebar-body .woocommerce-mini-cart__empty-message {
    padding: 20px 0;
    color: #6b7280;
}

@media (max-width: 480px) {
    .celm-cart-sidebar-panel {
        max-width: 100%;
    }
}

/* ============================================
   Buy Now button redesign (single product)
   Works with WooCommerce, Woolentor, Elementor
   ============================================ */

.single-product form.cart .buy_now_button,
.single-product .buy_now_button,
.woocommerce .single-product .buy_now_button,
.woolentor-buy-now,
.wl-buy-now,
.elementor-widget-woocommerce-product-add-to-cart .buy_now_button,
.single-product form.cart > .button.buy_now_button,
.single-product form.cart > a.buy_now_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}

.single-product form.cart .buy_now_button:hover,
.single-product .buy_now_button:hover,
.woocommerce .single-product .buy_now_button:hover,
.woolentor-buy-now:hover,
.wl-buy-now:hover,
.single-product form.cart > .button.buy_now_button:hover,
.single-product form.cart > a.buy_now_button:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.45);
}

/* Ensure Add to Cart sits below with clear separation */
.single-product form.cart .single_add_to_cart_button,
.single-product form.cart .button.single_add_to_cart_button {
    margin-top: 0;
}
