/* ======== POS Order Specific Styles ======== */
:root {
    --pos-purple-light: #a855f7;
    --pos-purple-dark: #9333ea;
    --pos-purple-glow: rgba(147, 51, 234, 0.4);
    --pos-blue: #007bff;
    --pos-blue-dark: #0056b3;
}

/* Common Utilities */
.cursor-pointer {
    cursor: pointer;
}

.transition-all {
    transition: all 0.2s ease-in-out;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15) !important;
    transform: translateY(-2px);
}

/* POS Layout */
.pos-wrapper {
    align-items: flex-start;
}

.pos-left-inner {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.pos-view {
    display: block;
}

.pos-view-categories #categories-container,
.pos-view-products .pos-products-grid,
.pos-view-modifiers .modifier-body-scroll {
    overflow: visible;
}

.pos-right-panel {
    position: sticky;
    top: 80px;
    min-height: calc(100vh - 100px);
}

.pos-cart-card {
    height: auto !important;
}

#cart-items-container {
    min-height: 200px;
    padding-top: 5px;
}

/* POS Search Bar */
.pos-search-wrapper .input-group {
    background: #fff;
    border-color: #e2e8f0 !important;
    transition: all 0.3s ease;
}

.pos-search-wrapper .input-group:focus-within {
    border-color: var(--pos-purple-light) !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15) !important;
}

#pos-product-search {
    font-size: 0.9rem;
    font-weight: 500;
}

#pos-product-search:focus {
    box-shadow: none;
}

#btn-clear-search {
    transition: all 0.2s ease;
    opacity: 0.6;
}

#btn-clear-search:hover {
    opacity: 1;
    color: #ef4444 !important;
}

/* Search Type Toggle */
.search-type-toggle-wrapper .btn-group {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    padding: 3px !important;
    border-radius: 50px !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    display: flex !important;
    align-items: stretch !important;
    height: 100% !important;
    gap: 5px !important;
}

/* Hide the native radio button dots */
.search-type-toggle-wrapper .btn-check {
    display: none !important;
}

.search-type-toggle-wrapper .btn-outline-secondary {
    color: #64748b !important;
    font-size: 0.65rem !important;
    padding: 6px 16px !important;
    border: none !important;
    margin: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: transparent !important;
    letter-spacing: 0.8px !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
    text-transform: uppercase;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.search-type-toggle-wrapper .btn-check:checked+.btn-outline-secondary {
    background: var(--pos-blue) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.25) !important;
}

.search-type-toggle-wrapper .btn-outline-secondary:hover:not(.active) {
    color: var(--pos-blue) !important;
}

/* Category Cards */
#categories-container .cat-btn {
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    height: 100px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: filter 0.15s, transform 0.15s;
    background: linear-gradient(135deg, var(--pos-purple-light) 0%, var(--pos-purple-dark) 100%);
    color: #fff;
    word-break: break-word;
    line-height: 1.3;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#categories-container .cat-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--pos-purple-glow);
}

#categories-container .cat-btn:active {
    transform: translateY(0);
}

#categories-container .cat-btn.active-category {
    background: linear-gradient(135deg, var(--pos-purple-dark) 0%, #4c1d95 100%);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 0 6px var(--pos-purple-light);
}

#categories-container .cat-btn .cat-name {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

/* Product Grid */
.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-auto-rows: minmax(110px, auto);
    gap: 0.85rem;
    align-content: start;
    padding-bottom: 1.5rem;
}

.pos-products-grid>.col-12 {
    grid-column: 1 / -1;
    height: auto !important;
    padding-bottom: 1.5rem;
}

.pos-products-grid .product-btn {
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    text-align: left;
    height: 110px;
    width: 100%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    transition: filter 0.15s, transform 0.15s;
    background: linear-gradient(135deg, var(--pos-purple-light) 0%, var(--pos-purple-dark) 100%);
    color: #fff;
    word-break: break-word;
    line-height: 1.3;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pos-products-grid .product-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px var(--pos-purple-glow);
}

.pos-products-grid .product-btn:active {
    transform: translateY(0);
}

.pos-products-grid .product-btn .prod-name {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pos-products-grid .product-btn .prod-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.pos-products-grid .product-btn .prod-customize-badge {
    color: #fff;
    opacity: 0.85;
    font-size: 1rem;
    padding-bottom: 2px;
}

.pos-products-grid .product-btn .prod-price {
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 14px;
    border-radius: 50px;
    display: inline-block;
    color: #fff;
    backdrop-filter: blur(4px);
}

.modifier-minus-btn {
    visibility: hidden;
    pointer-events: none;
    cursor: pointer;
    font-size: 1.6rem;
    color: var(--pos-purple-dark);
    transition: all 0.2s;
    opacity: 0;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modifier-minus-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modifier-selection.selected .modifier-minus-btn,
.edit-modifier-selection.selected .modifier-minus-btn {
    visibility: visible;
    pointer-events: auto;
    opacity: 0.85;
}

.modifier-selection.selected .text-primary,
.edit-modifier-selection.selected .text-primary {
    color: var(--pos-purple-dark) !important;
    opacity: 1;
}

.group-remaining-label-header {
    color: #64748b !important;
    font-weight: 500;
    font-size: 0.75rem !important;
}

.requirement-met {
    color: #059669 !important;
    font-weight: 600;
}

/* Primary Button Override */
.btn-primary,
#btn-add-modified-item,
.btn-checkout {
    background: linear-gradient(135deg, var(--pos-blue) 0%, var(--pos-blue-dark) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

.btn-primary:hover,
#btn-add-modified-item:hover,
.btn-checkout:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.4);
}

.btn-primary:active,
#btn-add-modified-item:active {
    transform: translateY(0);
}

.btn-primary:disabled,
#btn-add-modified-item:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Modifier Styles */
.modifier-footer {
    flex-shrink: 0;
}

.modifier-group-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #edf2f7;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    /* Slightly lighter 3D shadow */
    transition: all 0.3s ease;
}

.modifier-group-card.is-fulfilled {
    background-color: rgba(16, 185, 129, 0.02);
    /* Very light green tint */
    border-color: #d1fae5;
}

.requirement-met {
    color: #10b981 !important;
    /* Green */
    font-weight: 600;
}

.modifier-selection,
.edit-modifier-selection {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 0px;
    /* Using gap in grid instead */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 55px;
    /* Fixed height for stability */
    width: 100%;
}

.modifier-selection:hover,
.edit-modifier-selection:hover {
    border-color: var(--pos-purple-light);
    background: rgba(168, 85, 247, 0.02);
    transform: translateY(-1px);
}

.modifier-selection.selected,
.edit-modifier-selection.selected {
    background: rgba(168, 85, 247, 0.05);
    /* Very light purple */
    border-color: var(--pos-purple-light);
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.modifier-selection.selected .text-primary,
.edit-modifier-selection.selected .text-primary {
    color: var(--pos-purple-dark) !important;
}

/* Modifier Badges */
.modifier-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--pos-purple-dark);
    color: #fff;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.modifier-selection.selected .modifier-badge,
.edit-modifier-selection.selected .modifier-badge {
    display: flex;
}

/* Cart Items */
.cart-item {
    border-bottom: 1px solid #f3f4f6;
    padding: 12px 16px;
    transition: background-color 0.15s;
}

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

.cart-item-remove {
    cursor: pointer;
    color: #ef4444;
    opacity: 0.55;
}

.cart-item-remove:hover {
    opacity: 1;
}

.cart-qty-outer {
    background: #f8f9fa !important;
    border-color: #e9ecef !important;
    padding: 2px 4px !important;
}

.cart-qty-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    line-height: 1;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    color: #4b5563;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.cart-qty-btn:hover {
    background-color: var(--pos-blue);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.cart-qty-btn:active {
    transform: scale(0.9);
}

.cart-qty-minus:hover {
    background-color: #ef4444;
}

.cart-qty-plus:hover {
    background-color: #10b981;
}

.address-card.active {
    border-color: #0d6efd !important;
    background-color: rgba(13, 110, 253, .05);
}

/* Modifier Badges */
.modifier-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #1a56db;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.modifier-selection.selected .modifier-badge {
    display: flex;
}

/* Modal Enhancements */
#maxSelectionModal .modal-content {
    border-radius: 20px;
    overflow: hidden;
}

#maxSelectionModal .bi-info-circle {
    font-size: 3rem;
}

#maxSelectionModal .btn-primary {
    min-width: 120px;
}

#btn-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
    border: none;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    transform: translateY(20px);
}

#btn-scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#btn-scroll-top:hover {
    filter: brightness(1.1);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.5);
    color: #fff;
}

#editItemModal .modal-header {
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 1.5rem 1.5rem 1rem;
}

#editItemModal .modal-title {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.modifier-body-scroll::-webkit-scrollbar {
    width: 6px;
}

.modifier-body-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.modifier-body-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modifier-body-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#modifier-qty-input,
#edit-modifier-qty-input {
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 1rem;
    color: var(--pos-purple-dark);
    height: 36px !important;
    padding: 0 !important;
    line-height: normal !important;
    text-align: center;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hide number input spinners */
#modifier-qty-input::-webkit-outer-spin-button,
#modifier-qty-input::-webkit-inner-spin-button,
#edit-modifier-qty-input::-webkit-outer-spin-button,
#edit-modifier-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#modifier-qty-input,
#edit-modifier-qty-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.modifier-qty-btn {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    border: 1px solid #e2e8f0 !important;
    background: #fff !important;
    color: #4b5563 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    line-height: 1;
}

.modifier-qty-btn:hover {
    border-color: var(--pos-purple-light) !important;
    color: var(--pos-purple-dark) !important;
    background: rgba(168, 85, 247, 0.05) !important;
    transform: scale(1.1);
}

.modifier-qty-btn:active {
    transform: scale(0.9);
}




/* Shared Highlight Layout for Cart Items */
.cart-item-out-of-stock,
.cart-item-missing-menu {
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    margin: 5px 10px 15px 10px !important;
    padding: 15px !important;
    box-shadow: none !important;
    /* Flattened, no 3D effects */
    position: relative;
}

/* Red / Out of Stock Styling */
.cart-item-out-of-stock {
    background-color: rgba(220, 53, 69, 0.05) !important;
    border-color: #dc3545 !important;
}

.cart-item-out-of-stock .text-uppercase {
    color: #dc3545 !important;
}

/* Orange / Missing from Menu Styling */
.cart-item-missing-menu {
    background-color: rgba(249, 115, 22, 0.05) !important;
    border-color: #f97316 !important;
}

.cart-item-missing-menu .text-uppercase {
    color: #f97316 !important;
}

.stock-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
}

.item-code-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 700;
    margin-left: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-badge-ok {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.stock-badge-low {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
    cursor: pointer;
}

.stock-badge-low:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

.stock-badge-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.outlet-card.stock-checking {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.stock-check-spinner {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
    margin-right: 5px;
}

.oos-badge {
    color: #fff !important;
    padding: 2px 8px !important;
    font-weight: 700 !important;
}

.stock-detail-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.stock-detail-table td {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Enhanced OOS List Styles */
.oos-item-card {
    border-left: 4px solid #dee2e6;
    transition: all 0.2s ease;
}

.oos-item-active {
    border-left-color: #dc3545 !important;
}

.oos-item-inactive {
    border-left-color: #28a745 !important;
}

.oos-item-active .item-name {
    color: #dc3545;
}

.oos-item-inactive .item-name {
    color: #28a745;
}

.oos-details-toggle {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.oos-details-toggle:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.oos-toggle-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.oos-details-toggle[aria-expanded="true"] .oos-toggle-icon {
    transform: rotate(180deg);
}

.oos-schedule-details {
    font-size: 0.75rem;
    background-color: #fcfcfc;
    border-top: 1px dashed #eee;
    color: #64748b;
}

.oos-schedule-row {
    display: flex;
    margin-bottom: 3px;
}

.oos-schedule-label {
    width: 90px;
    font-weight: 700;
    color: #475569;
}

/* Product Card Stock Badges */
.prod-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-bottom: 2px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.prod-stock-badge i {
    font-size: 0.6rem;
}

.prod-stock-low {
    background: #f59e0b;
    color: #1a1a1a;
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.prod-stock-oos {
    background: #dc2626;
    color: #fff;
    border: none;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.5);
}

/* Sync Icon Specifics */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
    opacity: 0.7;
    pointer-events: none;
    display: inline-block;
}

#btn-sync-menu:active {
    transform: scale(0.85);
}

#btn-sync-menu i {
    transition: all 0.2s ease;
}

#btn-sync-menu:hover i {
    color: #ffd700 !important;
}

/* Progress Bar for Menu/Stock Loading */
.zetpy-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zetpy-loading-overlay .spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 0.25rem;
    margin-bottom: 1.5rem;
    color: var(--pos-blue);
}

.zetpy-loading-overlay .progress {
    width: 250px;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    margin-top: 1.5rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.zetpy-loading-overlay .progress-bar {
    background: linear-gradient(90deg, var(--pos-blue) 0%, #00d2ff 100%);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.zetpy-loading-overlay .loading-details {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.75rem;
    font-weight: 500;
}

.badge-not-in-menu {
    background-color: #f97316 !important;
    /* Vibrant Orange */
    color: #fff !important;
    font-weight: 700;
    letter-spacing: 0.2px;
}


/* Insufficient Stock Highlighting */
.insufficient-stock-highlight {
    border: 2px solid #dc3545 !important;
    background-color: rgba(220, 53, 69, 0.05) !important;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.2) !important;
    padding: 11px 15px !important;
    /* Adjust since border increased */
    animation: flash-red 2s infinite ease-in-out;
    z-index: 5;
}

@keyframes flash-red {
    0% {
        border-color: #dc3545;
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.2);
    }

    50% {
        border-color: #ff4d4d;
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
    }

    100% {
        border-color: #dc3545;
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.2);
    }
}

/* End of POS Order Specific Styles */