/* Sali Woo Checkout Mini-Cart Drawer Styling */

#sali-mini-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999999999 !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

body.sali-cart-drawer-open #sali-mini-cart-drawer {
    transform: translateX(0);
}

#sali-mini-cart-drawer-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Backdrop Blur */
#sali-mini-cart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9999999998 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.sali-cart-drawer-open #sali-mini-cart-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* Header Section */
.sali-cart-drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sali-cart-drawer-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sali-cart-title-counter {
    top: -6px;
    font-size: 11px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    padding: 2px 6px;
    font-weight: 700;
}

.sali-cart-drawer-close {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.sali-cart-drawer-close:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* Body / Product List */
.sali-cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.sali-cart-drawer-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 60%;
    color: #94a3b8;
    gap: 16px;
}

.sali-cart-drawer-empty p {
    font-size: 14px;
    margin: 0;
}

/* Cart Item Row */
.sali-cart-item {
    display: flex;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.sali-cart-item-image {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sali-cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sali-cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sali-cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.sali-cart-item-title {
    font-size: 13.5px;
    font-weight: 500;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.8em;
}

.sali-cart-item-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.sali-cart-item-title a:hover {
    color: #07456d;
}

.sali-cart-item-remove {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    transition: color 0.15s ease !important;
    display: flex !important;
    align-items: center !important;
}

.sali-cart-item-remove:hover {
    color: #ef4444 !important;
    background: none !important;
    border: none !important;
}

.sali-cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.sali-cart-item-qty-selector {
    display: flex !important;
    align-items: center !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    height: 28px !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

.sali-cart-item-qty-selector button {
    background: #f8fafc !important;
    border: none !important;
    box-shadow: none !important;
    width: 28px !important;
    height: 100% !important;
    cursor: pointer !important;
    font-size: 10px !important;
    color: #64748b !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: background 0.15s ease !important;
    padding: 0 !important;
}

.sali-cart-item-qty-selector button:hover:not(:disabled) {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.sali-cart-item-qty-selector button:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

.sali-qty-number {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    padding: 0 10px;
    min-width: 16px;
    text-align: center;
}

.sali-cart-item-price-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.sali-cart-item-price-label del {
    font-size: 11px;
    color: #94a3b8;
    margin-right: 4px;
}

.sali-cart-item-price-label ins {
    text-decoration: none;
}

/* Footer Section */
.sali-cart-drawer-footer {
    padding: 24px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.sali-cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sali-subtotal-text {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.sali-subtotal-price {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.sali-cart-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sali-btn-view-cart,
.sali-btn-checkout {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.sali-btn-view-cart {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.sali-btn-view-cart:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.sali-btn-checkout {
    background: #07456d;
    border: 1px solid #07456d;
    color: #ffffff;
    font-weight: 700;
}

.sali-btn-checkout:hover {
    background: #053757;
    border-color: #053757;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 69, 109, 0.15);
}

/* Floating cart trigger */
#sali-mini-cart-floating-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #07456d;
    color: #ffffff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 99999;
    transition: all 0.2s ease;
}

#sali-mini-cart-floating-trigger:hover {
    transform: translateY(-2px) scale(1.05);
    background: #053757;
    box-shadow: 0 6px 20px rgba(7, 69, 109, 0.3);
}

.sali-cart-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sali-cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none !important;
    padding: 0 2px;
    box-sizing: border-box;
}

/* Hide default theme mini-cart dropdown elements to prevent duplicate popups */
.widget_shopping_cart_content,
.cart-dropdown,
.mini-cart-dropdown,
.header-cart-dropdown,
.dropdown-menu-mini-cart,
.shopping-cart-widget,
ul.cart_list.product_list_widget,
.widget_shopping_cart .cart_list,
.widget_shopping_cart .total,
.widget_shopping_cart .buttons,
.header-cart-content {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
/* Hide popular WhatsApp chat floaters when cart is open to prevent overlapping the checkout button */
body.sali-cart-drawer-open .ht-ctc-chat,
body.sali-cart-drawer-open .joinchat,
body.sali-cart-drawer-open #whatsapp-widget,
body.sali-cart-drawer-open .wa-button,
body.sali-cart-drawer-open .ht_ctc_widget,
body.sali-cart-drawer-open #ht-ctc-chat {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Loading overlay for quantity updates */
#sali-mini-cart-drawer.sali-cart-loading .sali-cart-drawer-body,
#sali-mini-cart-drawer.sali-cart-loading .sali-cart-drawer-footer {
    opacity: 0.5 !important;
    pointer-events: none !important;
}
