.floating-widget {
    position: fixed;
    z-index: 1030;
    border-radius: 6px;
    background-color: white;
    display: flex; /* Keep for internal flex layout of header/content */
    flex-direction: column; /* Header above content */

    /* Default state: Minimized in bottom-right corner */
    bottom: 10px;
    right: 10px;
    width: auto; /* Fit content of minimized handle */
    min-width: 180px; /* Example minimum width for minimized state */
    height: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    cursor: pointer; /* Indicates clickable to maximize */
}

/* Hide main header and content when minimized by default */
.floating-widget .widget-header:not(.widget-minimized-handle),
.floating-widget .widget-content {
    display: none;
}

/* Show minimized handle by default */
.floating-widget .widget-minimized-handle {
    display: flex !important; /* Override other display rules */
    align-items: center; /* Vertically align items in minimized handle */
    padding: 0.5rem 0.75rem; /* Adjust padding for card-header-title look */
    border-bottom: none; /* No border when minimized */
    /* Inherit card-header styles or add specific ones for background */
}
.floating-widget .widget-minimized-handle .card-header-title {
    padding: 0; /* Remove default padding if using Bulma's card-header-title */
}


/* Styles for when widget is MAXIMIZED (when .is-minimized class is NOT present) */
.floating-widget:not(.is-minimized) {
    width: 400px;  /* <<< Fixed width when maximized */
    height: auto;  /* Height will be determined by content up to max-height */
    max-height: 500px; /* <<< Max height when maximized */
    cursor: default;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    /* top/left will be set by JS after first drag or to a default */
    /* Remove bottom/right when maximized to allow top/left positioning */
    bottom: auto !important;
    right: auto !important;
}

.floating-widget:not(.is-minimized) .widget-header:not(.widget-minimized-handle) {
    display: flex; /* Show regular header */
    cursor: grab; /* Draggable cursor for header */
}
.floating-widget:not(.is-minimized) .widget-content {
    display: block; /* Show content */
    padding: 0.75rem; /* Slightly reduced padding for smaller widget */
    overflow-y: auto; /* Allow vertical scroll if content exceeds max-height */
    flex-grow: 1; /* Allow content to fill available space */
}
.floating-widget:not(.is-minimized) .widget-minimized-handle {
    display: none !important; /* Hide minimized handle when maximized */
}


/* General Header Styles */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none; /* Prevent text selection during drag */
}
.widget-header:not(.is-minimized):active { /* Grabbing cursor only when maximized and dragging */
    cursor: grabbing;
}

.widget-controls .button {
    margin-left: 0.5em;
}

/* Result item styling (can remain similar) */
.widget-results-container {
    /* max-height set by .widget-content */
}
.widget-results-container .product-result-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}
.widget-results-container .product-result-item:last-child { border-bottom: none; margin-bottom: 0; }
.widget-results-container .product-image {
    width: 50px; /* Slightly smaller for a 300px wide widget */
    height: 50px;
    object-fit: contain; border: 1px solid #dbdbdb; border-radius: 4px; margin-right: 8px; float: left;
}
.widget-results-container .stock-in-list { list-style: none; padding-left: 0; margin-left: 18px; font-size: 0.75rem; color: #555; }
.widget-results-container .stock-in-list li { margin-bottom: 0.1em; }


.product-search-results {

    background: #ffffff;
    box-shadow: 5px 6px 6px 0px rgba(163,163,163,0.55);
}

.product-search-results .dropdown-item{
    border-bottom: 1px solid #ccc;
}

.product-search-results .dropdown-item:last-child {
    border: none;
}