@keyframes loading-spinner {
    /* For buttons */
    to {
        transform: rotate(360deg);
    }
}

/* Style for the overlay spinner (No longer needed for the overlay itself) */
/* @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} */

/* Apply wait cursor globally when body has the class (still useful) */
body.pos-processing * {
    cursor: wait !important;
}

/* Spinner for buttons */
.loading-animation::before {
    content: "";
    display: block;
    width: 1em;
    height: 1em;
    margin-right: 8px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: loading-spinner 0.75s linear infinite;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Optional: Style for the select/button group */
.payment-method-selector-group {
    /* display: flex; */
    /* REMOVED: Change to block layout */
    /* gap: 5px; */
    /* REMOVED: Not needed for block layout */
    margin-top: 10px;
    /* align-items: stretch; */
    /* REMOVED: Not needed for block layout */
}

.payment-method-select {
    /* flex-grow: 1; */
    /* REMOVED: Not needed */
    width: 100%;
    /* ADDED: Make select full width */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-height: 40px;
    background-color: white;
    box-sizing: border-box;
    /* ADDED: Ensure padding doesn't add to width */
    margin-bottom: 10px;
    /* ADDED: Space between select and button */
}

.payment-method-submit-btn {
    width: 100%;
    /* ADDED: Make button full width */
    padding: 10px 15px;
    min-height: 40px;
    background-color: #5bc0de;
    color: white;
    border: none;
    cursor: pointer;
    /* flex-shrink: 0; */
    /* REMOVED: Not needed */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-family: "Arial Rounded MT Bold", "Helvetica Rounded", Arial, sans-serif;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease,
        background-color 0.2s ease;
    transform: scale(1);
    /* margin-top: 0; */
    /* REMOVED: Margin is now on the select element */
    box-sizing: border-box;
    /* ADDED: Ensure padding doesn't add to width */
}

.payment-method-submit-btn:disabled {
    background-color: #a0a0a0 !important;
    /* Use !important to override dynamic style if needed */
    cursor: not-allowed !important;
    /* Ensure cursor is not-allowed when disabled */
    opacity: 0.6;
}

/* Style adjustments when loading (Spinner only, cursor handled by dynamic style) */
.payment-method-submit-btn.loading-animation {
    /* cursor: wait; */
    /* Removed: Handled by getSelectedGatewayButtonStyle */
}

.customer-form-section {
    background-color: #f0f0f0;
    /* padding: 10px 15px; */
    /* Padding moved to header/fields */
    padding: 0;
    /* Remove section padding */
    margin-bottom: 15px;
    border-radius: 15px;
    border: 1px solid #ddd;
    position: relative;
    overflow: hidden;
    /* Contain background/border */
    /* text-align: right; */
    /* Removed from CSS - applied inline in template */
}

.customer-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 15px;
    /* Add padding to the header */
    background-color: #ffffff;
    /* Light background for the header */
    border-bottom: 1px solid #ddd;
    /* Separator line */
    /* Remove bottom border/padding when collapsed - handled by field visibility */
}

.customer-form-header-title {
    margin: 0;
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
}

.customer-toggle-btn {
    /* background: #6c757d; */
    color: rgb(0, 0, 0);
    border: none;
    outline: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    background-color: transparent;
}

/* Show customer.svg as background when collapsed (plus state) */
.customer-toggle-btn:not(.expanded) {
    background-image: url("/wp-content/plugins/duckpos/assets/images/customer.svg");
}

/* Remove background image when expanded (minus state) */
.customer-toggle-btn.expanded {
    background-image: none;
}

.customer-form-fields {
    /* padding-top: 10px; */
    /* Use padding on the container */
    /* margin-top: 10px; */
    /* Remove margin */
    /* border-top: 1px solid #ccc; */
    /* Border is on header now */
    padding: 15px;
    /* Add padding around the fields */
    background-color: #f8f9fa;
    /* Slightly different background for fields */
}

.customer-form-group {
    margin-bottom: 8px;
    display: flex;
    /* Use flexbox for alignment */
    align-items: center;
    /* Vertically center label and input */
    gap: 5px;
    justify-content: space-between;
    /* Add a small gap between label and input */
}

.customer-form-group label {
    /* display: block; */
    /* No longer needed with flex */
    /* margin-bottom: 3px; */
    /* No longer needed */
    font-size: 0.85em;
    font-weight: bold;
    color: #555;
    flex-shrink: 0;
    /* Prevent label from shrinking */
    /* Optional: Set a fixed width if desired */
    /* width: 80px; */
    /* text-align: right; */
    /* Align text right if using fixed width */
}

.product-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.3) 100%
    );
    border-radius: 20px;
}

.customer-form-group input[type="text"],
.customer-form-group input[type="email"],
.customer-form-group input[type="tel"] {
    /* width: 100%; */
    /* Flex-grow handles width */
    max-width: 70%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    /* Ensures padding is included in width */
    font-size: 0.9em;
    flex-grow: 1;
    /* Make input fill remaining space */
}

/* Customer Search */
.customer-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

.customer-search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9em;
}

.customer-search-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.customer-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.customer-search-loading,
.customer-search-empty {
    padding: 10px;
    text-align: center;
    color: #888;
    font-size: 0.85em;
}

.customer-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.customer-search-item {
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.customer-search-item:last-child {
    border-bottom: none;
}

.customer-search-item:hover {
    background-color: #f0f7ff;
}

.customer-search-item strong {
    font-size: 0.9em;
    color: #333;
}

.customer-search-detail {
    font-size: 0.8em;
    color: #777;
}

.reset-customer-btn {
    width: 100%;
    padding: 6px;
    background-color: #777;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    font-size: 0.9em;
    font-family: "Arial Rounded MT Bold", "Helvetica Rounded", Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
    transform: scale(1);
    border-radius: 4px;
}

.reset-customer-btn:hover {
    background-color: #666;
}

/* --- Collapsible Today's Orders Section --- */
.todays-orders-section {
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    transition: width 0.3s, height 0.3s, padding 0.3s, min-height 0.3s;
    overflow: hidden;
    position: relative;
    align-self: flex-start;
    flex-shrink: 0;
}

.todays-orders-section.collapsed {
    top: 5px;
    margin: 0 10px;
    width: auto;
    min-width: 160px;
    padding: 0;
    cursor: pointer;
    border-radius: 10px;
}

.cart-items-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #e3e6e9;
    border-radius: 20px;
    padding: 45px 0 0 0;
    overflow: visible !important; /* Allow popups to escape cart container boundaries */
}

.todays-orders-section.expanded {
    width: 40%;
    min-height: 150px;
    max-height: 250px;
    padding: 10px;
    cursor: default;
    z-index: 1;
}

.todays-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.todays-orders-section.collapsed .todays-orders-header {
    padding: 8px 12px;
    border-bottom: none;
}

.todays-orders-section.expanded .todays-orders-header {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.todays-orders-header-title {
    font-weight: bold;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.todays-orders-header-arrow {
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 5px;
    /* NEW: Use hamburger menu SVG as background */
    background-image: url("/wp-content/plugins/duckpos/assets/images/hamburgerMenu.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    width: 28px;
    height: 28px;
    /* Hide any text/icon inside the element */
    color: transparent;
    border: none;
    outline: none;
    display: inline-block;
    vertical-align: middle;
    /* Optionally, remove border/background if present */
    background-color: transparent;
    transition: transform 0.2s ease;
}

/* Rotate the hamburger icon when the menu is open (expanded) */
.todays-orders-section.expanded .todays-orders-header-arrow {
    transform: rotate(90deg);
}

/* Hide internal buttons and lists when collapsed */
.todays-orders-section.collapsed .refresh-orders-btn,
.todays-orders-section.collapsed .toggle-orders-view-btn,
.todays-orders-section.collapsed .todays-orders-list,
.todays-orders-section.collapsed .todays-orders-loading,
.todays-orders-section.collapsed .todays-orders-empty {
    display: none;
}

.todays-orders-section.expanded .refresh-orders-btn,
.todays-orders-section.expanded .toggle-orders-view-btn {
    display: inline-flex;
}

.todays-orders-section.collapsed .todays-orders-header {
    padding: 8px 12px;
    border-bottom: none;
}

.todays-orders-section.expanded .todays-orders-header {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.todays-orders-header-title {
    font-weight: bold;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.todays-orders-header-arrow {
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 5px;
    /* NEW: Use hamburger menu SVG as background */
    background-image: url("/wp-content/plugins/duckpos/assets/images/hamburgerMenu.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    width: 28px;
    height: 28px;
    /* Hide any text/icon inside the element */
    color: transparent;
    border: none;
    outline: none;
    display: inline-block;
    vertical-align: middle;
    /* Optionally, remove border/background if present */
    background-color: transparent;
    transition: transform 0.2s ease;
}

/* Rotate the hamburger icon when the menu is open (expanded) */
.todays-orders-section.expanded .todays-orders-header-arrow {
    transform: rotate(90deg);
}

/* Hide internal buttons and lists when collapsed */
.todays-orders-section.collapsed .refresh-orders-btn,
.todays-orders-section.collapsed .toggle-orders-view-btn,
.todays-orders-section.collapsed .todays-orders-list,
.todays-orders-section.collapsed .todays-orders-loading,
.todays-orders-section.collapsed .todays-orders-empty {
    display: none;
}

.todays-orders-section.expanded .refresh-orders-btn,
.todays-orders-section.expanded .toggle-orders-view-btn {
    display: inline-flex;
}

.todays-orders-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 150px; /* ADJUST: Reduce max-height for header area */
    overflow-y: auto; /* Add vertical scrollbar when content exceeds max-height */
    /* border: 1px solid #eee; */ /* REMOVED */
    border-radius: 3px;
}

.todays-order-item {
    display: flex; /* Use flexbox */
    justify-content: space-between; /* Space out content and buttons */
    align-items: center; /* Vertically align items */
    padding: 8px 0;
    border-bottom: 1px solid #ddd; /* NEW: Add bottom border */
    font-size: 0.9em;
    gap: 10px; /* Add gap between text and button group */
}
.todays-order-item:last-child {
    border-bottom: none;
}
.todays-order-item span {
    flex-grow: 1; /* Allow text to take available space */
    word-break: break-word; /* Prevent long names from overflowing */
}

/* MODIFIED: Style for the button group */
.receipt-button-group {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    align-items: flex-end; /* Align buttons to the right */
    gap: 3px; /* Add small space between buttons */
    flex-shrink: 0; /* Prevent button group from shrinking */
}

/* Optional: Adjust individual button styles if needed */
.view-receipt-btn,
.print-receipt-btn {
    padding: 3px 8px; /* ADJUST padding */
    font-size: 0.8em; /* Adjust font size */
    min-width: 70px; /* ADJUST minimum width */
    text-align: center;
    border: 1px solid #ccc;
    /* background-color: #f9f9f9; */ /* REMOVE default background */
    border-radius: 3px;
    cursor: pointer;
    box-sizing: border-box; /* Ensure padding doesn't increase size */
    width: 100%; /* Make buttons take full width of the column */
    color: #333; /* Default text color */
    transition: background-color 0.2s ease, border-color 0.2s ease,
        color 0.2s ease; /* Add transitions */
}

/* Specific styles for View button */
.view-receipt-btn {
    background-color: #e0e0e0; /* Light grey background */
    border-color: #bdbdbd;
}

/* Specific styles for Print/Re-Print button */
.print-receipt-btn {
    background-color: #c8e6c9; /* Light green background */
    border-color: #a5d6a7;
    color: #1b5e20; /* Darker green text */
}

.view-receipt-btn:hover {
    background-color: #d1d1d1; /* Darker grey on hover */
    border-color: #adadad;
}

.print-receipt-btn:hover {
    background-color: #b2dfdb; /* Lighter teal/green on hover */
    border-color: #80cbc4;
    color: #004d40; /* Darker teal text */
}

/* NEW: Specific button colors */
.todays-orders-item .view-receipt-btn {
    background-color: #5bc0de; /* Light blue */
    border-color: #46b8da;
    color: white;
}
.todays-orders-item .view-receipt-btn:hover {
    background-color: #31b0d5;
    border-color: #269abc;
}

.todays-orders-item .print-receipt-btn {
    background-color: #5cb85c; /* Green */
    border-color: #4cae4c;
    color: white;
}
.todays-orders-item .print-receipt-btn:hover {
    background-color: #449d44;
    border-color: #398439;
}
/* END NEW */

.todays-orders-item button:hover {
    /* General hover effect (like slight brightness change) can be removed if specific hovers are defined */
    /* background-color: #e5e5e5; */
}

/* NEW: Receipt Modal Styles */
.receipt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100003; /* Ensure it's above other elements like sidebar and loading overlay */
}

.receipt-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    max-width: 450px; /* Adjusted max-width for receipt format */
    max-height: 85%; /* Adjusted max-height */
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.receipt-modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #aaa;
}
.receipt-modal-close-btn:hover {
    color: #333;
}

.receipt-modal-content h3 {
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* MODIFIED: Style the container div instead of pre */
.receipt-modal-data-container {
    /* Removed pre-specific styles like white-space: pre-wrap */
    background-color: #f9f9f9; /* Slightly off-white background */
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    /* font-family: monospace; /* Moved styles to inline <style> in JS */
    /* font-size: 0.9em; */
    max-height: 50vh; /* Limit height relative to viewport */
    overflow-y: auto; /* Add scroll if needed */
    line-height: 1.4; /* Improve readability */
}
/* END MODIFICATION */

.modal-print-btn {
    display: block; /* Make button block level */
    width: calc(100% - 20px); /* Adjust width */
    margin: 20px auto 0 auto; /* Center button */
    padding: 10px;
    font-size: 1em;
    /* Inherit .print-receipt-btn styles or add specific ones */
    /* Use the green color from the list buttons */
    background-color: #5cb85c;
    border-color: #4cae4c;
    color: white;
}
.modal-print-btn:hover {
    background-color: #449d44;
    border-color: #398439;
}

.cart-actions-collapsed {
    margin-top: 20px;
    width: 100%;
    display: block;
}

/* .wp-site-blocks {
    display: none !important;
} */

body > *:not(#pos-app) {
    display: none !important;
}

#pos-app {
    display: block !important; /* Or flex, grid, etc., depending on its intended layout */
}

/* NEW: Cart item container and sliding actions */
.cart-item-container {
    transition: background-color 0.2s ease;
    border-radius: 8px;
}

.cart-item-container:hover {
    background-color: #f8f9fa;
}

.cart-item-container.actions-visible {
    background-color: #e3f2fd;
}

.cart-item-actions {
    position: absolute;
    /* Default LTR positioning */
    right: -180px; /* Start hidden off-screen to the right */
    top: 0; /* Align to top of container */
    bottom: 0; /* Stretch to bottom of container */
    display: flex;
    align-items: center; /* Center buttons vertically */
    gap: 8px; /* Increased gap for larger buttons */
    background-color: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease-in-out, left 0.3s ease-in-out;
    z-index: 10;
    white-space: nowrap;
    flex-shrink: 0;
}

/* RTL positioning */
[dir="rtl"] .cart-item-actions {
    right: auto; /* Reset right positioning */
    left: -180px; /* Start hidden off-screen to the left for RTL */
}

.cart-item-actions.visible {
    right: 0; /* Slide in flush to the right edge for LTR */
}

/* RTL visible state */
[dir="rtl"] .cart-item-actions.visible {
    right: auto; /* Reset right positioning */
    left: 0; /* Slide in flush to the left edge for RTL */
}

/* Style the action buttons */
.cart-item-actions button {
    font-size: 1.2em !important; /* Larger font for bigger buttons */
    padding: 0 !important; /* Remove padding to control size precisely */
    margin: 0 !important;
    background-color: #555 !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    width: 50px !important; /* Fixed width */
    height: 50px !important; /* Fixed height to match width (square) */
    text-align: center !important;
    border-radius: 8px !important; /* Slightly larger border radius */
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4) !important;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cart-item-actions button:hover {
    background-color: #333 !important;
    transform: scale(1.05); /* Slight scale on hover */
}

.cart-item-actions button:active {
    transform: scale(0.95); /* Pressed effect */
}

/* Specific button colors */
.cart-item-actions button:first-child {
    background-color: #28a745 !important; /* Green for + */
}

.cart-item-actions button:first-child:hover {
    background-color: #218838 !important;
}

.cart-item-actions button:nth-child(2) {
    background-color: #ffc107 !important; /* Yellow for - */
    color: #212529 !important;
}

.cart-item-actions button:nth-child(2):hover {
    background-color: #e0a800 !important;
}

.cart-item-actions button:last-child {
    background-color: #dc3545 !important; /* Red for X */
}

.cart-item-actions button:last-child:hover {
    background-color: #c82333 !important;
}

/* CACHE BUST v2.3 - Mobile popup bubble for product info */
.cart-item-popup {
    position: absolute;
    top: -85px;
    right: 10px;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    max-width: 180px;
    white-space: nowrap;
    font-size: 0.85em;
    pointer-events: none;
}

.cart-item-popup.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* RTL positioning for popup */
[dir="rtl"] .cart-item-popup {
    right: auto;
    left: 10px;
}

/* Popup content styling */
.cart-item-popup .popup-content {
    text-align: left;
}

[dir="rtl"] .cart-item-popup .popup-content {
    text-align: right;
}

.cart-item-popup .popup-name {
    margin: 0 0 6px 0;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.2;
    word-wrap: break-word;
}

.cart-item-popup .popup-price {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.95;
    font-weight: 500;
}

/* Popup arrow */
.cart-item-popup .popup-arrow {
    position: absolute;
    bottom: -6px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333;
}

[dir="rtl"] .cart-item-popup .popup-arrow {
    right: auto;
    left: 30px;
}

/* Show popup when actions are visible */
.cart-item-popup.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Adjust popup position if it would go off-screen */
.cart-item-container:first-child .cart-item-popup {
    top: 70px; /* Move below if it's the first item */
}

.cart-item-container:first-child .cart-item-popup .popup-arrow {
    top: -6px;
    bottom: auto;
    border-top: none;
    border-bottom: 6px solid #333;
}

/* Show popup on mobile and tablet screens when actions are visible */
@media (max-width: 1024px) {
    .cart-item-popup.visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    /* Adjust popup position if it would go off-screen */
    .cart-item-container:first-child .cart-item-popup {
        top: 70px; /* Move below if it's the first item */
    }
    
    .cart-item-container:first-child .cart-item-popup .popup-arrow {
        top: -6px;
        bottom: auto;
        border-top: none;
        border-bottom: 6px solid #333;
    }
}

/* Fade original product info when actions are visible */
.cart-item-container.actions-visible > div:nth-child(2) {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

/* Media query version for smaller screens */
@media (max-width: 1024px) {
    .cart-item-container.actions-visible > div:nth-child(2) {
        opacity: 0.3;
        transition: opacity 0.3s ease;
    }
}

/* Ensure cart items have proper stacking context for popup */
.cart-item-container {
    position: relative !important;
    z-index: 1;
}

.cart-item-container.actions-visible {
    z-index: 15 !important;
    overflow: visible !important; /* Ensure cart item containers allow popup overflow */
}

.cart-side-bar {
    overflow-x: visible !important;
}

/* Category: All on top; wrapped pills with max 5 “rows” then vertical scroll + ▲/▼ */
.pos-category-bar {
    min-width: 0;
}

/* 5 lines of 30px chips + 4 row gaps of 5px = 30*5 + 5*4 = 170px max */
.pos-category-scroll--wrap {
    --pos-cat-pill-h: 30px;
    --pos-cat-gap: 5px;
    /* max visual rows: 5 */
    max-height: calc(5 * var(--pos-cat-pill-h) + 4 * var(--pos-cat-gap));
    min-height: 0;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    gap: var(--pos-cat-gap);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.pos-category-scroll--wrap::-webkit-scrollbar {
    width: 5px;
}

.pos-category-scroll--wrap::-webkit-scrollbar-thumb {
    background: #c4c4c4;
    border-radius: 3px;
}

.pos-category-pill-text {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
    display: inline-block;
    vertical-align: middle;
}

.pos-category-scroll-btns-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: stretch;
    width: 2.25rem;
    min-width: 2.25rem;
}

.pos-category-scroll-btns-col .pos-category-scroll-btn {
    flex: 0 0 auto;
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    font-size: 0.75rem;
    line-height: 1;
}

.pos-category-scroll-btn {
    min-width: 2rem;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    transition: background 0.15s ease;
}

.pos-category-scroll-btn:hover {
    background: #eaeaea;
}

/* Cart block while sales-rules totals API runs — full-area overlay */
.duckpos-cart-sales-wrap {
    position: relative;
}

.duckpos-cart-sales-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(2px);
}

.duckpos-cart-sales-loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 22px;
    margin: 12px;
    max-width: 90%;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #1d2327;
    background: #fff;
    border: 1px solid #cce0ff;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}

.duckpos-cart-sales-loading-text {
    line-height: 1.35;
}

.duckpos-spinner--cart-sales {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

/* Legacy compact strip (unused in template; kept for compatibility) */
.duckpos-sales-totals-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #444;
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: 6px;
}

.duckpos-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #cce0ff;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: duckpos-spin 0.65s linear infinite;
}

@keyframes duckpos-spin {
    to {
        transform: rotate(360deg);
    }
}

.duckpos-spinner--inline {
    flex-shrink: 0;
}

/* Full-screen processing overlay (checkout, gateway, cash, EMV) */
.duckpos-global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
}

.duckpos-global-loading-card {
    text-align: center;
    max-width: 22rem;
    padding: 1.5rem 1.75rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8e8e8;
}

.duckpos-global-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 4px solid #e0e8ef;
    border-top-color: #2271b1;
    animation: duckpos-spin 0.75s linear infinite;
    box-sizing: border-box;
}

.duckpos-global-loading-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1d2327;
}

.duckpos-global-loading-sub {
    margin: 0.65rem 0 0;
    font-size: 0.95rem;
    font-weight: normal;
    color: #50575e;
    line-height: 1.4;
}

/* PayPlus iframe: waiting for terminal / postMessage */
.duckpos-iframe-payment-wait {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #444;
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: 6px;
}

