#wqo-quick-order-form {
    position: relative;
    max-width: 100%;
    z-index: 10;
}

#wqo-products-table {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0.5rem;
}

.wqo-product-row {
    display: flex;
    padding: 1rem;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    animation: fadeIn 0.3s ease-out;
    background: #ffffff;
    border-radius: 8px;
    flex-direction: row;
    align-content: center;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.wqo-header-row {
    font-weight: bold;
    background: #f3f4f6;
}

.wqo-product-row > div,
.wqo-product-row > button {
    padding: 0 10px;
}

.wqo-product-row > div:nth-child(1) {
    flex: 0 0 35%;
}

.wqo-product-row > div:nth-child(n+2):nth-child(-n+6) {
    flex: 0 0 13%;
}

.wqo-product-info {
    display: flex;
    align-items: center;
}

.wqo-product-image {
    max-width: 50px;
    max-height: 50px;
    margin-right: 10px;
}

.wqo-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.wqo-product-details {
    display: flex;
    flex-direction: column;
}

.wqo-product-sku {
    font-size: 0.9em;
    color: #666;
}

.tomselect-result-product {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.tomselect-result-product__image {
    max-width: 30px;
    max-height: 30px;
    margin-right: 10px;
    object-fit: contain;
}

.tomselect-result-product__meta {
    flex-grow: 1;
}

.tomselect-result-product__title {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 1.1rem;
}

.tomselect-result-product__price {
    font-size: 1.1rem;
    color: #4CAF50;
    font-family: "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace;
    font-weight: 600;
}

.tomselect-result-product__stockstatus {
    color: #333;
    margin-left: 5px;
}

.tomselect-result-product__unit {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.tomselect-result-product__unit span {
    display: block;
}

.wqo-add-to-cart,
.wqo-remove-from-cart {
    background-color: #f0f0f0;
    border: none;
    padding: 10px 15px;
    margin: 5px 0;
    border-radius: 5px;
    height: 40px;
    line-height: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    position: relative;
    min-width: 100px;
}

.wqo-add-to-cart {
    background: #4f46e5;
    color: #ffffff;
}

.wqo-remove-from-cart {
    background: #ff4d4d;
    color: #fff;
}

.wqo-add-to-cart:hover,
.wqo-remove-from-cart:hover {
    opacity: 0.9;
}

.wqo-add-to-cart.loading,
.wqo-remove-from-cart.loading {
    color: transparent !important;
    pointer-events: none;
}

.wqo-add-to-cart .spinner,
.wqo-remove-from-cart .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: none;
}

.wqo-add-to-cart.loading .spinner,
.wqo-remove-from-cart.loading .spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.wqo-unit {
    display: flex;
    flex-direction: column;
    font-size: 0.85em;
    line-height: 1.2;
    position: relative;
    margin-bottom: 16px;
}

.wqo-unit span {
    text-align: left;
}

.wqo-price {
    display: flex;
    flex-direction: column;
}

.wqo-extended-price {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-top: 4px;
}

.wqo-available-value,
.wqo-quantity-available,
.wqo-price-value,
.wqo-price > span {
    color: inherit;
    display: inline-block;
    white-space: nowrap;
    font-family: "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace;
    font-weight: 600;
}

.wqo-price > span {
    color: inherit;
}

.wqo-unit-value {
    gap: 4px; /* Adds space between rows */
}

.row-item {
    display: block; /* Ensures each row takes full width */
    margin-bottom: 8px; /* Optional spacing for rows */
}

.purchasing-content,
.sales-content {
    display: inline-block; /* Ensures styling works properly within the row */
}

.wqo-pill {
    background-color: #fff;
    border: 1px solid #333;
    border-radius: 4px;
    padding-left: 5px;
    margin: 5px;
    justify-content: space-between;
    display: flex;
    align-items: center;
}

.wqo-pill-inner {
    display: inline-block;
    padding: 2px 10px;
    margin-left: 5px;
    font-weight: 600;
    background-color: #333;
    color: #fff;
    font-family: "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.wqo-product-row.removing {
    animation: fadeOut 0.3s ease-out;
}

.wqo-header-row label,
.wqo-product-row:not(.wqo-header-row) label {
    display: none;
}

.wqo-quantity input[type="number"] {
    width: 100%;
    min-width: 100px;
    padding: 12px 14px;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background-color: #f0f0f0;
    appearance: none;
    box-sizing: border-box;
    font-family: "Inconsolata", "Fira Mono", "Source Code Pro", Monaco, Consolas, "Lucida Console", monospace;
    font-weight: 600;
}

.wqo-quantity input[type="number"]:focus {
    border-color: var(--common-input-active);
    outline: none;
}

@media (max-width: 768px) {
    #wqo-quick-order-form {
        padding: 0;
    }

    #wqo-products-table {
        display: block !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .wqo-product-row {
        display: flex !important;
        flex-direction: column !important;
    }

    .wqo-header-row {
        display: none !important;
    }

    .wqo-product-row > div {
        width: 100%;
        position: relative;
        padding: 0 16px;
    }

    .wqo-product-row input[type="number"],
    .wqo-product-row select {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        box-sizing: border-box;
        background-color: #fff;
    }

    .wqo-header-row label,
    .wqo-product-row:not(.wqo-header-row) label {
        display: block;
        font-weight: 800;
        line-height: 1.8rem;
    }

    input[type="number"],
    input[type="text"] {
        padding: 14px;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        background: #ffffff;
        font-size: 1rem;
        margin: 0;
    }

    .wqo-product-search {
        margin-bottom: 16px;
    }

    .wqo-action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .wqo-product-row img {
        height: auto;
    }
}