/* MxChat WooCommerce Cart Styles
 * These styles are specifically for the cart icon and dropdown in the MxChat chatbot
 */

/* Cart Button Styles */
.chat-toolbar #woo-cart-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    margin: 0;
    outline: none;
    align-items: center;
    justify-content: center;
}

.chat-toolbar #woo-cart-btn:hover {
    opacity: 0.8;
}

.chat-toolbar #woo-cart-btn svg {
    width: 100%;
    height: 100%;
    fill: #212121;
    stroke: #212121;
    color: #212121;
}

.chat-toolbar .woo-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #f44336;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-weight: bold;
    padding: 0 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 10001;
}

.chat-toolbar .woo-cart-count.empty-cart {
    display: none;
}

/* Cart Dropdown Styles */
#woo-cart-dropdown {
    position: fixed;
    right: 25px;
    bottom: 20px;
    border-radius: 20px;
    width: 375px;
    height: 630px;
    max-width: 90vw;
    z-index: 100041;
    display: none;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    background: #fff;
}

#woo-cart-dropdown.active {
    display: flex;
    flex-direction: column;
    border-bottom: none;
}

#woo-cart-dropdown .woo-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
    border-radius: 20px 20px 0px 0px;
}

#woo-cart-dropdown .woo-cart-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212121;
}

#woo-cart-dropdown .woo-cart-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #212121;
    outline: none;
}

#woo-cart-dropdown .woo-cart-close-btn:hover {
    opacity: 0.7;
}

#woo-cart-dropdown .woo-cart-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2px;
}

#woo-cart-dropdown .woo-cart-items-container {
    overflow-y: auto;
    padding: 0;
    margin: 0;
    background-color: white;
}

#woo-cart-dropdown .woo-cart-items {
    padding: 10px 0;
    margin: 0;
}

#woo-cart-dropdown .woo-cart-item {
    display: flex;
    padding: 8px 15px;
    border-bottom: 1px solid #f5f5f5;
    margin: 0;
    align-items: center;
}

#woo-cart-dropdown .woo-cart-item:last-child {
    border-bottom: none;
}

#woo-cart-dropdown .woo-cart-item-image {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
}

#woo-cart-dropdown .woo-cart-item-details {
    flex: 1;
    min-width: 0; /* Ensures flex items can shrink below content size */
}

#woo-cart-dropdown .woo-cart-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    color: #212121;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#woo-cart-dropdown .woo-cart-item-price, 
#woo-cart-dropdown .woo-cart-item-quantity {
    font-size: 12px;
    color: #666;
    margin: 0;
}

#woo-cart-dropdown .woo-cart-item-remove {
    background: transparent;
    border: none;
    color: #f44336;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 8px;
    border-radius: 50%;
    outline: none;
    line-height: 1;
    text-decoration: none;
    font-family: sans-serif;
}

#woo-cart-dropdown .woo-cart-item-remove:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

#woo-cart-dropdown .woo-cart-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

#woo-cart-dropdown .woo-cart-empty {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

#woo-cart-dropdown .woo-cart-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    border-radius: 0px 0px 20px 20px;
}

#woo-cart-dropdown .woo-cart-subtotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-weight: 600;
    color: #212121;
}

#woo-cart-dropdown .woo-cart-view-btn, 
#woo-cart-dropdown .woo-cart-checkout-btn {
    display: block;
    text-align: center;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    cursor: pointer;
}

#woo-cart-dropdown .woo-cart-view-btn {
    background-color: white;
    color: #212121 !important;
    border: 1px solid #ccc;
}

#woo-cart-dropdown .woo-cart-checkout-btn {
    background-color: #212121;
    color: white !important;
    border: 1px solid #212121;
}

#woo-cart-dropdown .woo-cart-view-btn:hover {
    background-color: #f5f5f5;
}

#woo-cart-dropdown .woo-cart-checkout-btn:hover {
    background-color: #333;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    #woo-cart-dropdown {
        width: 100%;
        max-width: none;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0; /* Position from top instead of bottom */
        height: auto; /* Auto height instead of fixed */
        border-radius: 0;
        border: none;
        position: fixed; /* Ensure it's fixed */
        display: none;
        overflow-y: auto; /* Allow scrolling */
    }
    
    #woo-cart-dropdown.active {
        display: block; /* Full screen on mobile */
        min-height: 100%;
    }
    
    /* Ensure header stays at the top */
    #woo-cart-dropdown .woo-cart-header {
        position: sticky;
        top: 0;
        z-index: 10003;
        background-color: white;
        border-bottom: 1px solid #ddd;
    }
    
    /* Adjust the items container for mobile */
    #woo-cart-dropdown .woo-cart-items-container {
        min-height: 100%;
        max-height: 100%;
        height: auto;
    }
    
    /* Make sure footer stays at the bottom */
    #woo-cart-dropdown .woo-cart-footer {
        position: sticky;
        bottom: 0;
        background-color: white;
        z-index: 10003;
        border-top: 1px solid #ddd;
    }
}

/* Additional styles specifically for the toolbar icon */
.chat-toolbar #woo-cart-btn.toolbar-btn {
    align-items: center;
    justify-content: center;
}



/* Order History Button Styles */
.chat-toolbar #woo-orders-btn {
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    margin: 0;
    outline: none;
    align-items: center;
    justify-content: center;
}

.chat-toolbar #woo-orders-btn:hover {
    opacity: 0.8;
}

.chat-toolbar #woo-orders-btn svg {
    width: 100%;
    height: 100%;
    fill: #dd3333;
    stroke: #dd3333;
    color: #dd3333;
}

/* Order History Dropdown Styles */
#woo-orders-dropdown {
position: fixed;
    right: 25px;
    bottom: 20px;
    width: 375px;
    height: 630px;
    max-width: 90vw;
    z-index: 100041;
    display: none;
    overflow: hidden;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    border-radius: 20px;
    background: #fff;
}

#woo-orders-dropdown.active {
    display: flex;
    flex-direction: column;
    border-bottom: none;
}

#woo-orders-dropdown .woo-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

#woo-orders-dropdown .woo-orders-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212121;
}

#woo-orders-dropdown .woo-orders-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #212121;
    outline: none;
}

#woo-orders-dropdown .woo-orders-close-btn:hover {
    opacity: 0.7;
}

#woo-orders-dropdown .woo-orders-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2px;
}

#woo-orders-dropdown .woo-orders-container {
    min-height: 360px;
    max-height: 100%;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    background-color: white;
}

#woo-orders-dropdown .woo-orders-list {
    padding: 10px 0;
    margin: 0;
}

/* Order item styles */
#woo-orders-dropdown .woo-order-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
}

#woo-orders-dropdown .woo-order-item:last-child {
    border-bottom: none;
}

#woo-orders-dropdown .woo-order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

#woo-orders-dropdown .woo-order-number {
    font-weight: 600;
    color: #212121;
}

#woo-orders-dropdown .woo-order-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    background-color: #f0f0f0;
    color: #666;
}

/* Status-specific styles */
#woo-orders-dropdown .status-completed {
    background-color: #c8e6c9;
    color: #2e7d32;
}

#woo-orders-dropdown .status-processing {
    background-color: #bbdefb;
    color: #1565c0;
}

#woo-orders-dropdown .status-on-hold {
    background-color: #fff9c4;
    color: #f57f17;
}

#woo-orders-dropdown .status-cancelled {
    background-color: #ffcdd2;
    color: #c62828;
}

#woo-orders-dropdown .status-refunded {
    background-color: #f5f5f5;
    color: #616161;
}

#woo-orders-dropdown .status-failed {
    background-color: #ff8a80;
    color: #d50000;
}

#woo-orders-dropdown .status-pending {
    background-color: #ffe0b2;
    color: #e65100;
}

#woo-orders-dropdown .woo-order-date {
    font-size: 12px;
    color: #757575;
    margin-bottom: 8px;
}

#woo-orders-dropdown .woo-order-items {
    margin: 8px 0;
    color: #424242;
    font-size: 13px;
    line-height: 1.4;
}

#woo-orders-dropdown .woo-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

#woo-orders-dropdown .woo-order-total {
    font-weight: 600;
    color: #212121;
}

#woo-orders-dropdown .woo-order-view-btn {
    padding: 4px 12px;
    background-color: #f5f5f5;
    color: #212121;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s;
}

#woo-orders-dropdown .woo-order-view-btn:hover {
    background-color: #e0e0e0;
}

#woo-orders-dropdown .woo-orders-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    position: absolute;
    bottom: 0;
    width: 100%;
}

#woo-orders-dropdown .woo-orders-view-all-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #212121;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

#woo-orders-dropdown .woo-orders-view-all-btn:hover {
    background-color: #424242;
}

/* Loading, error, and empty states */
#woo-orders-dropdown .woo-orders-loading,
#woo-orders-dropdown .woo-orders-error,
#woo-orders-dropdown .woo-orders-empty,
#woo-orders-dropdown .woo-orders-login-required {
    text-align: center;
    padding: 40px 20px;
    color: #757575;
}

#woo-orders-dropdown .woo-orders-login-required {
    color: #f57f17;
}

/* Responsive styles */
/* Responsive styles */
@media (max-width: 480px) {
    #woo-orders-dropdown {
        width: 100%;
        max-width: none;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0; /* Position from top instead of bottom */
        height: auto; /* Auto height instead of fixed */
        border-radius: 0;
        border: none;
        position: fixed; /* Ensure it's fixed */
        display: none;
        overflow-y: auto; /* Allow scrolling */
    }
    
    #woo-orders-dropdown.active {
        display: block; /* Full screen on mobile */
    }
    
    /* Ensure header stays at the top */
    #woo-orders-dropdown .woo-orders-header {
        position: sticky;
        top: 0;
        z-index: 10003;
        background-color: white;
        border-bottom: 1px solid #ddd;
    }
    
    /* Adjust the items container for mobile */
    #woo-orders-dropdown .woo-orders-container {
        min-height: 100%;
        max-height: 100%;
        height: auto;
    }
    
    /* Make sure footer stays at the bottom */
    #woo-orders-dropdown .woo-orders-footer {
        position: sticky;
        bottom: 0;
        background-color: white;
        z-index: 10003;
        border-top: 1px solid #ddd;
    }
}