/* ==========================================================================
   PIN BUTTON (IN INPUT AREA)
   ========================================================================== */
#lcfw-chat-root-container #lcfw-pin-product-button {
    background-color: #e0e0e0;
    color: #555;
    border: none;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    transition: background-color 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

#lcfw-chat-root-container #lcfw-pin-product-button:hover {
    background-color: #d0d0d0;
    color: #333;
}

#lcfw-chat-root-container #lcfw-pin-product-button i {
    line-height: 1;
}

/* ==========================================================================
   OVERLAYS (MENU, PRODUCT LIST, ORDER LIST)
   ========================================================================== */
#lcfw-chat-root-container #lcfw-pin-options-menu,
#lcfw-chat-root-container #lcfw-product-list-container,
#lcfw-chat-root-container #lcfw-order-list-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fdfdfd;
    box-sizing: border-box;
    padding: 15px;
    z-index: 10;
}

/* Headers */
#lcfw-chat-root-container .lcfw-pin-options-header,
#lcfw-chat-root-container .lcfw-product-list-header,
#lcfw-chat-root-container .lcfw-order-list-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#lcfw-chat-root-container .lcfw-pin-options-header h3,
#lcfw-chat-root-container .lcfw-product-list-header h3,
#lcfw-chat-root-container .lcfw-order-list-header h3 {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Close Buttons */
#lcfw-chat-root-container #lcfw-close-pin-options,
#lcfw-chat-root-container #lcfw-close-product-list,
#lcfw-chat-root-container #lcfw-close-order-list {
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

#lcfw-chat-root-container #lcfw-close-pin-options:hover,
#lcfw-chat-root-container #lcfw-close-product-list:hover,
#lcfw-chat-root-container #lcfw-close-order-list:hover {
    color: #555;
}

/* Search Bars */
#lcfw-chat-root-container #lcfw-product-search-bar,
#lcfw-chat-root-container #lcfw-order-search-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    background-color: #fff;
}

#lcfw-chat-root-container #lcfw-product-search-input,
#lcfw-chat-root-container #lcfw-order-search-input {
    flex-grow: 1; padding: 5px; font-size: 0.9em; border: none; background: transparent;
}

#lcfw-chat-root-container #lcfw-product-search-bar .dashicons,
#lcfw-chat-root-container #lcfw-order-search-bar .dashicons {
    font-size: 1.2em; color: #888; margin-left: 5px;
}

/* Scroll Areas */
#lcfw-chat-root-container #lcfw-product-scroll-area,
#lcfw-chat-root-container #lcfw-order-scroll-area {
    flex-grow: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 5px;
}

/* Lists Reset */
#lcfw-chat-root-container .lcfw-pin-options-list,
#lcfw-chat-root-container #lcfw-product-list,
#lcfw-chat-root-container #lcfw-order-list {
    list-style: none; padding: 0; margin: 0;
}

/* Pin Options Menu Specifics */
#lcfw-chat-root-container .lcfw-pin-options-list { flex-grow: 1; }
#lcfw-chat-root-container .lcfw-pin-options-list li { margin-bottom: 10px; }

#lcfw-chat-root-container .lcfw-pin-option-button {
    width: 100%; display: flex; align-items: center; justify-content: flex-start;
    padding: 25px 15px; background-color: #fff; border: 1px solid #eee; border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); font-size: 1em; color: #333; cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
#lcfw-chat-root-container .lcfw-pin-option-button:hover { background-color: #f5f5f5; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); }
#lcfw-chat-root-container .lcfw-pin-option-button .dashicons { font-size: 1.5em; margin-right: 10px; line-height: 1; }


/* ==========================================================================
   LIST ITEMS (PRODUCT & ORDER SELECTION)
   ========================================================================== */
#lcfw-chat-root-container .lcfw-product-item,
#lcfw-chat-root-container .lcfw-order-item {
    background-color: #fff; border: 1px solid #eee; border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); transition: box-shadow 0.2s ease;
    margin-bottom: 8px; padding: 10px;
}

#lcfw-chat-root-container .lcfw-product-item:hover,
#lcfw-chat-root-container .lcfw-order-item:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); }

/* Product Item Layout */
#lcfw-chat-root-container .lcfw-product-item { display: flex; align-items: center; }
#lcfw-chat-root-container .lcfw-product-image {
    width: 50px; height: 50px; object-fit: cover; border-radius: 3px; margin-right: 10px; flex-shrink: 0;
}
#lcfw-chat-root-container .lcfw-product-details {
    flex-grow: 1; display: flex; flex-direction: column; justify-content: center; margin-right: 10px;
}
#lcfw-chat-root-container .lcfw-product-title { font-weight: bold; font-size: 0.95em; color: #333; margin-bottom: 2px; }
#lcfw-chat-root-container .lcfw-product-price { font-size: 0.85em; color: #666; }

/* Order Item Layout */
#lcfw-chat-root-container .lcfw-order-item { display: flex; flex-direction: column; position: relative; }
#lcfw-chat-root-container .lcfw-order-details {
    flex-grow: 1; display: flex; flex-direction: column; justify-content: center; margin-bottom: 10px;
}
#lcfw-chat-root-container .lcfw-order-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px;
}
#lcfw-chat-root-container .lcfw-order-number { font-weight: bold; font-size: 1em; color: #333; }
#lcfw-chat-root-container .lcfw-order-date,
#lcfw-chat-root-container .lcfw-order-total { font-size: 0.85em; color: #666; margin-bottom: 2px; }

/* Status Badges */
#lcfw-chat-root-container .lcfw-order-status {
    font-size: 0.8em; font-weight: bold; padding: 3px 8px; border-radius: 12px;
    color: #fff; background-color: #999;
}
#lcfw-chat-root-container .lcfw-order-status.pending { background-color: #ffc107; }
#lcfw-chat-root-container .lcfw-order-status.processing { background-color: #17a2b8; }
#lcfw-chat-root-container .lcfw-order-status.completed { background-color: #28a745; }
#lcfw-chat-root-container .lcfw-order-status.on-hold { background-color: #fd7e14; }
#lcfw-chat-root-container .lcfw-order-status.cancelled { background-color: #dc3545; }
#lcfw-chat-root-container .lcfw-order-status.refunded { background-color: #6c757d; }
#lcfw-chat-root-container .lcfw-order-status.failed { background-color: #6f42c1; }

/* Selection Buttons */
#lcfw-chat-root-container .lcfw-select-product-button,
#lcfw-chat-root-container .lcfw-select-order-button {
    background-color: var(--lcfw-bubble-color); color: #fff; border: none; padding: 8px 12px;
    border-radius: 4px; cursor: pointer; font-size: 0.85em; transition: background-color 0.3s ease;
    flex-shrink: 0; align-self: flex-start;
}
#lcfw-chat-root-container .lcfw-select-product-button:hover,
#lcfw-chat-root-container .lcfw-select-order-button:hover {
    background-color: color-mix(in srgb, var(--lcfw-bubble-color) 80%, black);
}

/* Load More Button */
#lcfw-chat-root-container .lcfw-load-more-button {
    background-color: #f0f0f0; color: #555; border: 1px solid #ccc; padding: 10px 15px;
    border-radius: 4px; cursor: pointer; font-size: 0.9em; width: calc(100% - 30px); max-width: 250px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
#lcfw-chat-root-container .lcfw-load-more-button:hover {
    background-color: #e0e0e0; color: #333; border-color: #bbb;
}

/* ==========================================================================
   CARDS IN MESSAGES (DISPLAY)
   ========================================================================== */
#lcfw-chat-root-container .lcfw-product-card,
#lcfw-chat-root-container .lcfw-order-card {
    display: flex; flex-direction: column; background-color: #fff; border: 1px solid #ddd;
    border-radius: 8px; padding: 10px; max-width: 250px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); margin-top: 0;
}

/* Admin Card Background Override */
#lcfw-chat-root-container .lcfw-message-content.admin .lcfw-product-card,
#lcfw-chat-root-container .lcfw-message-content.admin .lcfw-order-card {
    background-color: #f7f7f7;
}

/* Product Card */
#lcfw-chat-root-container .lcfw-product-card-image {
    width: 100%; max-height: 150px; object-fit: contain; border-radius: 4px; margin-bottom: 4px;
}
#lcfw-chat-root-container .lcfw-product-card-title { font-weight: bold; font-size: 1em; color: #333; margin-bottom: 4px; }
#lcfw-chat-root-container .lcfw-product-card-price { font-size: 0.9em; color: #666; margin-bottom: 4px; }

/* Order Card */
#lcfw-chat-root-container .lcfw-order-card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px;
}
#lcfw-chat-root-container .lcfw-order-card-number { font-weight: bold; font-size: 1em; color: #333; }
#lcfw-chat-root-container .lcfw-order-card-status {
    font-size: 0.8em; font-weight: bold; padding: 3px 8px; border-radius: 12px; color: #fff; background-color: #999;
}
#lcfw-chat-root-container .lcfw-order-card-status.pending { background-color: #ffc107; }
#lcfw-chat-root-container .lcfw-order-card-status.processing { background-color: #17a2b8; }
#lcfw-chat-root-container .lcfw-order-card-status.completed { background-color: #28a745; }
#lcfw-chat-root-container .lcfw-order-card-status.on-hold { background-color: #fd7e14; }
#lcfw-chat-root-container .lcfw-order-card-status.cancelled { background-color: #dc3545; }
#lcfw-chat-root-container .lcfw-order-card-status.refunded { background-color: #6c757d; }
#lcfw-chat-root-container .lcfw-order-card-status.failed { background-color: #6f42c1; }

#lcfw-chat-root-container .lcfw-order-card-date,
#lcfw-chat-root-container .lcfw-order-card-total { font-size: 0.9em; color: #666; margin-bottom: 4px; }

/* Card Buttons/Links */
#lcfw-chat-root-container .lcfw-product-card-link,
#lcfw-chat-root-container .lcfw-order-card-link {
    display: inline-block; background-color: var(--lcfw-bubble-color); color: #fff;
    padding: 8px 12px; border-radius: 4px; text-align: center; text-decoration: none;
    font-size: 0.9em; transition: background-color 0.3s ease; align-self: flex-start;
    max-width: fit-content; margin-top: 5px;
}
#lcfw-chat-root-container .lcfw-product-card-link:hover,
#lcfw-chat-root-container .lcfw-order-card-link:hover {
    background-color: color-mix(in srgb, var(--lcfw-bubble-color) 80%, black);
}

/* Card Links in Visitor Bubble (Invert Colors) */
#lcfw-chat-root-container .lcfw-message-content.visitor .lcfw-product-card-link,
#lcfw-chat-root-container .lcfw-message-content.visitor .lcfw-order-card-link {
    background-color: #fff; color: var(--lcfw-bubble-color);
}
#lcfw-chat-root-container .lcfw-message-content.visitor .lcfw-product-card-link:hover,
#lcfw-chat-root-container .lcfw-message-content.visitor .lcfw-order-card-link:hover {
    background-color: #f0f0f0; color: color-mix(in srgb, var(--lcfw-bubble-color) 80%, black);
}

/* WooCommerce Price Fixes (Common for List and Card) */
#lcfw-chat-root-container .lcfw-product-price del,
#lcfw-chat-root-container .lcfw-product-card-price del {
    text-decoration: line-through; opacity: 0.7; margin-right: 5px; color: #999;
}
#lcfw-chat-root-container .lcfw-product-price ins,
#lcfw-chat-root-container .lcfw-product-card-price ins {
    color: #e74c3c; font-weight: bold;
}
#lcfw-chat-root-container .lcfw-product-price .woocommerce-Price-amount,
#lcfw-chat-root-container .lcfw-product-card-price .woocommerce-Price-amount {
    display: inline;
}