/* ========================================
   Cart Drawer - Shopify Style
   ======================================== */

/* Drawer Container */
.kilia-cart-drawer {
    position: fixed;
    top: 0;
    right: -100% !important;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    z-index: 99999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kilia-cart-drawer.active {
    right: 0 !important;
}

/* Inner wrapper - ensures proper layout */
.kilia-cart-drawer-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #E5E5E5;
    background: #fff;
    flex-shrink: 0;
}

.drawer__heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #000;
}

.drawer__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: #000;
    transition: opacity 0.2s;
}

.drawer__close:hover {
    opacity: 0.6;
}

/* Countdown Timer */
.cart-timer {
    background: #000;
    color: #fff;
    padding: 12px 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}

.countdown-timer {
    font-weight: 700;
}

/* Cart Body */
.cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.cart-drawer-items {
    padding: 0;
}

/* Individual Cart Item */
.cart-drawer-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid #E5E5E5;
    background: #fff;
}

.cart-item__media {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: #F5F5F5;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-drawer-item__right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-drawer-item__details-and-delete {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.cart-item__details {
    flex: 1;
}

.cart-item__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px 0;
    color: #000;
}

.cart-item__name a {
    color: #000;
    text-decoration: none;
}

.product-option {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.cart-item__bogo-badge {
    display: inline-block;
    background: #D4F4DD;
    color: #2D6A3E;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 6px;
}

.cart-drawer-item__remove {
    flex-shrink: 0;
}

.remove-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: color 0.2s;
}

.remove-item:hover {
    color: #000;
}

/* Quantity and Prices */
.cart-drawer-item__quantity-and-prices {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.quantity {
    display: flex;
    align-items: center;
    border: 1px solid #D1D1D1;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.quantity__button {
    background: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
    color: #000;
    transition: background 0.2s;
    line-height: 1;
}

.quantity__button:hover {
    background: #F5F5F5;
}

.quantity__input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #D1D1D1;
    border-right: 1px solid #D1D1D1;
    padding: 8px 4px;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    background: #fff;
}

.cart-item__totals {
    text-align: right;
}

.cart-item__discounted-prices {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-item__old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

.price--end {
    font-size: 16px;
    font-weight: 700;
    color: #000;
}

.cart-drawer-item__saving {
    font-size: 11px;
    color: #2D6A3E;
    margin-top: 2px;
}

/* Footer */
.drawer__footer {
    border-top: 1px solid #E5E5E5;
    padding: 20px;
    background: #fff;
    flex-shrink: 0;
}

.cart-totals__savings {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #FF6B35;
}

.savings-label {
    font-weight: 400;
}

.savings-amount {
    font-weight: 700;
}

.cart-totals__subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #E5E5E5;
    margin-bottom: 16px;
}

.cart-totals__subtotal strong {
    font-weight: 700;
    color: #000;
}

.cart-discounts {
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.discount-label {
    font-weight: 600;
    color: #000;
}

.discount-badge {
    display: inline-block;
    background: #D4F4DD;
    color: #2D6A3E;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
}

.checkout-button {
    display: block !important;
    width: 100% !important;
    background: #FF9933 !important;
    color: #fff !important;
    text-align: center !important;
    padding: 11px 24px !important;
    border-radius: 12px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    margin-bottom: 16px !important;
    border: none !important;
    cursor: pointer !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.checkout-button:hover {
    background: #E68829 !important;
}

.payment-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
    flex-wrap: wrap;
}

/* Overlay */
.kilia-cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.kilia-cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Empty Cart */
.woocommerce-mini-cart__empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 15px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .kilia-cart-drawer {
        width: 100%;
        max-width: 100%;
    }
}

/* Loading State */
.kilia-cart-drawer.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Scrollbar Styling */
.cart-drawer__body::-webkit-scrollbar {
    width: 6px;
}

.cart-drawer__body::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.cart-drawer__body::-webkit-scrollbar-thumb {
    background: #D1D1D1;
    border-radius: 3px;
}

.cart-drawer__body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Hide WooCommerce default buttons */
.woocommerce-mini-cart__buttons,
.woocommerce-mini-cart__total,
.woocommerce-mini-cart-item .remove,
a.button.wc-forward {
    display: none !important;
}

/* Fix for WooCommerce mini-cart list */
.woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-mini-cart-item {
    list-style: none;
}

/* Override WooCommerce defaults */
.woocommerce .kilia-cart-drawer ul.cart_list,
.woocommerce .kilia-cart-drawer ul.product_list_widget {
    list-style: none;
    padding: 0;
    margin: 0;
}
