/**
 * Purchase Order Styles
 */

/* Form Styles */
.purchase-order-form {
    margin: 20px 0;
}

.purchase-order-form .form-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.purchase-order-form .form-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.purchase-order-form .form-row {
    margin-bottom: 15px;
}

.purchase-order-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.purchase-order-form input[type="text"],
.purchase-order-form input[type="email"],
.purchase-order-form input[type="number"],
.purchase-order-form textarea,
.purchase-order-form select {
    width: 100%;
    padding: 8px;
    border: 1px solid #111;
    border-radius: 4px;
}

.purchase-order-form textarea {
    height: 100px;
}

.purchase-order-form .required {
    color: red;
}

/* Product Table Styles */
.product-table-container {
    margin-bottom: 20px;
}

.product-search {
    margin-bottom: 15px;
}

#search_products {
    width: 100%;
    padding: 10px;
    border: 1px solid #111;
    border-radius: 4px;
    font-size: 16px;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.product-table th {
    background-color: #f2f2f2;
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ddd;
}

.product-table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.product-table .product-quantity {
    width: 60px;
    text-align: center;
}

/* Order Table Styles */
.order-table-container {
    margin-bottom: 20px;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.order-table th {
    background-color: #f2f2f2;
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ddd;
}

.order-table td {
    padding: 10px;
    border: 1px solid #ddd;
}

.order-table .order-quantity {
    width: 50px;
    text-align: center;
    padding: .3rem .5rem;
    transition: all .3s;
    font-size: 12px;
}

/* Button Styles */
.add-to-order,
.remove-from-order {
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.add-to-order {
    background-color: #4CAF50;
    color: white;
    border: none;
}

.remove-from-order {
    background-color: #f44336;
    color: white;
    border: none;
}

/* Submit Button Styles */
.submit-order {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-order:hover {
    background-color: #0b7dda;
}
.item-count {
    font-weight: bold;
    color: #fff;
}
.toggle-variations {
    cursor: pointer;
}
.product-row {
    border-bottom: 1px solid #000;
}
.product-row.parent-product-row,
.order-table tr.parent-product-row {
    background-color: #f0f7ff;
    font-weight: bold;
}
.product-row.variation-row {
        background-color: #d6d6ec;
}

/* Success Message */
#order_success {
    display: none;
    padding: 20px;
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Error Styles */
.error {
    border-color: #f44336 !important;
}

.nav-links {
    margin-bottom: 20px;
}

.nav-links .button {
    display: inline-block;
    padding: 8px 12px;
    background-color: #f7f7f7;
    color: #555;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.nav-links .button:hover {
    background-color: #eee;
}

/* Confirmation Popup Styles */
#order_confirmation_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.confirmation-content {
    background-color: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.confirmation-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.confirmation-actions .button {
    min-width: 120px;
}

/* Offcanvas header with controls */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-header h3 {
    margin: 0;
}

.offcanvas-controls .close-offcanvas {
    background: #f00;
    border: none;
    font-size: 11px;
    cursor: pointer;
    padding: 0 4px;
    color: #fff;
}

.offcanvas-controls .close-offcanvas:hover {
    color: #000;
}


/* Progressive loading styles */
/*.product-table.loading {
    opacity: 0.7;
    position: relative;
}*/

.product-table-loading {
    display: block;
    top: 50%;
    left: 50%;
/*    transform: translate(-50%, -50%);*/
    background: #ffcc00;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 100000;
    width: 170px;
    height: 170px;
    /* margin: 0px auto; */
    position: fixed;
    text-align: center;
    
}
/* Loading Spinner for Product Table */
.product-table-loading .spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #2196F3;
    animation: spin 1s linear infinite;
    margin: 20px auto;
/*    background-color: #ffcc00;*/
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.add-icon.adding {
    background-color: #8BC34A;
    transform: scale(1.2);
    transition: all 0.3s ease;
}



.order-table tr.parent-product-row td {
    border-bottom: 2px solid #2196F3;
}
/* Product Cache Management Styles */
.status-active {
    color: green;
    font-weight: bold;
}

.status-inactive {
    color: red;
    font-weight: bold;
}

.card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}



.product-table-controls {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

#refresh-products {
    display: flex;
    align-items: center;
    gap: 5px;
}

#last-updated {
    margin-left: 10px;
    font-size: 12px;
    color: #777;
}

.price-placeholder {
    color: #888;
    font-style: italic;
    display: inline-block;
    animation: pulseFade 1.5s infinite;
}

@keyframes pulseFade {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}