::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body {
    font-family: "Inter", sans-serif;
    background-color: #f9fafb;
    /* bg-gray-50 */
}

.active-tab {
    border-bottom-width: 2px;
    border-color: #8b5cf6;
    /* resto-purple-light */
    color: #8b5cf6;
    font-weight: 600;
}

.inactive-tab {
    color: #6b7280;
    /* text-gray-500 */
}

.order-type-active {
    background-color: #8b5cf6;
    color: white;
}

.order-type-inactive {
    color: #8b5cf6;
    border: 1px solid #8b5cf6;
}

.table-button-active {
    background-color: #8b5cf6;
    color: white;
}

.table-button-inactive {
    color: #8b5cf6;
    border: 1px solid #8b5cf6;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    /* p-3 px-4 */
    border-radius: 0.5rem;
    /* rounded-lg */
    color: #4b5563;
    /* text-gray-600 */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.settings-nav-item:hover {
    background-color: #e5e7eb;
    /* hover:bg-gray-200 */
}

/* .settings-nav-item.active {
    background-color: #ede9fe; 
    color: #6d28d9;
    font-weight: 600;
    position: relative;
} */
/* .settings-nav-item.active::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: #6d28d9; 
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
} */

@keyframes shimmer {
    0% {
        background-position: -700px 0;
    }

    100% {
        background-position: 700px 0;
    }
}

.sk {
    background: linear-gradient(90deg, #e9ebee 25%, #f3f4f6 50%, #e9ebee 75%);
    background-size: 700px 100%;
    animation: shimmer 1.5s infinite linear;
    display: block;
    border-radius: 6px;
}

.sk-r {
    border-radius: 999px;
}

.sk-xl {
    border-radius: 14px;
}

#page-skeleton {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #f3f4f6;
    display: flex;
    transition: opacity 0.4s ease;
}

#page-skeleton.hidden-skeleton {
    opacity: 0;
    pointer-events: none;
}

@keyframes bar-morph {

    0%,
    45% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0;
        transform: scale(0.7);
    }

    55%,
    100% {
        opacity: 0;
        transform: scale(0.7);
    }
}

@keyframes bar-morph-alt {

    0%,
    45% {
        opacity: 0;
        transform: scale(0.7);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    55%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE POS STYLES 
   ═══════════════════════════════════════════════════════ */

/* ── Bottom Navigation Bar ──────────────────────────── */
.pos-bottom-nav {
    display: none;
}

/* ── FAB Cart Button ────────────────────────────────── */
.pos-fab-cart {
    display: none;
}

/* ── Mobile Cart Overlay ────────────────────────────── */
.mobile-cart-overlay {
    display: none;
}

/* ── Mobile Cart Sheet ──────────────────────────────── */
.mobile-cart-sheet {
    display: none;
}

@media (max-width: 768px) {

    /* ── Bottom Navigation Bar ─────────────────────── */
    .pos-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        justify-content: space-around;
        align-items: center;
    }

    .pos-bottom-nav a,
    .pos-bottom-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 12px;
        border-radius: 12px;
        font-size: 10px;
        font-weight: 500;
        color: #9ca3af;
        text-decoration: none;
        transition: all 0.2s ease;
        background: none;
        border: none;
        cursor: pointer;
        position: relative;
    }

    .pos-bottom-nav a i,
    .pos-bottom-nav button i {
        font-size: 18px;
        margin-bottom: 1px;
    }

    .pos-bottom-nav a.active,
    .pos-bottom-nav button.active {
        color: #C026D3;
        font-weight: 600;
    }

    .pos-bottom-nav a.active::after,
    .pos-bottom-nav button.active::after {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
        border-radius: 0 0 4px 4px;
        background: #C026D3;
    }

    /* ── Hide desktop sidebar hamburger on mobile ──── */
    .pos-desktop-hamburger {
        display: none !important;
    }

    /* ── Main Content adjustments ───────────────────── */
    #posMainContent {
        margin-right: 0 !important;
        padding: 12px 12px 80px 12px !important;
    }

    /* ── Header compact for mobile ──────────────────── */
    #posMainContent>header .mb-4.ml-20 {
        margin-left: 0 !important;
        margin-bottom: 8px !important;
        justify-content: center !important;
    }

    #posMainContent>header .mb-4.ml-20>div {
        text-align: center;
        width: 100%;
    }

    #posMainContent>header .mb-4.ml-20 h1 {
        font-size: 1.15rem !important;
    }

    #posMainContent>header .mb-4.ml-20 p {
        font-size: 0.7rem !important;
    }

    #posMainContent>header {
        margin-bottom: 12px !important;
    }

    /* ── Search bar compact ─────────────────────────── */
    #posMainContent .flex.flex-col.sm\:flex-row {
        gap: 8px !important;
        align-items: center;
    }

    #posMainContent .flex.flex-col.sm\:flex-row input[type="text"] {
        padding: 10px 10px 10px 38px !important;
        font-size: 13px !important;
    }

    #posMainContent .flex.flex-col.sm\:flex-row input[type="text"]+svg,
    #posMainContent .flex.flex-col.sm\:flex-row .relative svg {
        width: 16px !important;
        height: 16px !important;
        left: 12px !important;
    }

    /* ── Card/List toggle center ────────────────────── */
    #posMainContent .flex.flex-col.sm\:flex-row>.flex.bg-gray-100 {
        align-self: center;
    }

    /* ── Category tabs scroll horizontal ────────────── */
    #posMainContent nav.mb-6 {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 12px !important;
        padding-bottom: 4px;
        justify-content: center;
    }

    #posMainContent nav.mb-6::-webkit-scrollbar {
        display: none;
    }

    #posMainContent nav.mb-6 button {
        flex-shrink: 0;
        padding: 6px 14px !important;
        font-size: 12px !important;
    }

    /* ── Product Grid 2 columns ─────────────────────── */
    #posProductSection .grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    #posProductSection .grid .p-4 {
        padding: 8px !important;
    }

    #posProductSection .grid .p-4 h3 {
        font-size: 12px !important;
        margin-bottom: 2px !important;
    }

    #posProductSection .grid .p-4 p.text-xs {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }

    #posProductSection .grid .p-4 p.text-lg {
        font-size: 13px !important;
    }

    #posProductSection .grid .aspect-\[4\/3\] {
        aspect-ratio: 3 / 2 !important;
    }

    /* ── List view compact ──────────────────────────── */
    #posProductSection table th:nth-child(2),
    #posProductSection table td:nth-child(2),
    #posProductSection table th:nth-child(4),
    #posProductSection table td:nth-child(4) {
        display: none;
    }

    #posProductSection table .w-14 {
        width: 40px !important;
        height: 40px !important;
    }

    #posProductSection table .text-lg {
        font-size: 13px !important;
    }

    /* ── Hide desktop cart sidebar ──────────────────── */
    #posOrderSidebar {
        display: none !important;
    }

    /* ── FAB Cart Button ───────────────────────────── */
    .pos-fab-cart {
        display: flex !important;
        position: fixed;
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        z-index: 290;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #C026D3, #D946EF);
        color: #fff;
        border: none;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 24px rgba(192, 38, 211, 0.4);
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .pos-fab-cart:active {
        transform: scale(0.92);
    }

    .pos-fab-cart i {
        font-size: 22px;
    }

    .pos-fab-cart .fab-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 22px;
        height: 22px;
        border-radius: 999px;
        background: #ef4444;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        border: 2px solid #fff;
        box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    }

    /* ── Mobile Cart Overlay ────────────────────────── */
    .mobile-cart-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 400;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-cart-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* ── Mobile Cart Sheet ──────────────────────────── */
    .mobile-cart-sheet {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 410;
        background: #fff;
        border-radius: 20px 20px 0 0;
        max-height: 92vh;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    }

    .mobile-cart-sheet.open {
        transform: translateY(0);
    }

    .mobile-cart-sheet .sheet-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 0 4px;
        flex-shrink: 0;
    }

    .mobile-cart-sheet .sheet-handle span {
        width: 36px;
        height: 4px;
        border-radius: 999px;
        background: #d1d5db;
    }

    .mobile-cart-sheet .sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 16px 12px;
        border-bottom: 1px solid #f3f4f6;
        flex-shrink: 0;
    }

    .mobile-cart-sheet .sheet-header h2 {
        font-size: 18px;
        font-weight: 700;
        color: #1f2937;
    }

    .mobile-cart-sheet .sheet-header .close-btn {
        width: 32px;
        height: 32px;
        border-radius: 999px;
        background: #f3f4f6;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #6b7280;
        font-size: 14px;
        cursor: pointer;
    }

    .mobile-cart-sheet .sheet-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-cart-sheet .sheet-footer {
        flex-shrink: 0;
        border-top: 1px solid #e5e7eb;
        background: #fafafa;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* ── Pagination compact ─────────────────────────── */
    #posViewContainer .mt-8.flex.justify-center {
        margin-top: 12px !important;
    }

    #posViewContainer .mt-8.flex.justify-center button {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    /* ── Toast above bottom nav ─────────────────────── */
    body>.fixed.bottom-4.right-4 {
        bottom: 80px !important;
    }

    /* ── Payment modal mobile ───────────────────────── */
    .fixed.inset-0.bg-black\/50 > .bg-white {
        max-height: 95vh !important;
        border-radius: 20px 20px 0 0 !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .fixed.inset-0.bg-black\/50 > .bg-white > div {
        flex-shrink: 0;
    }

    /* ── Main content bottom padding for bottom nav ── */
    #main-content {
        padding-bottom: 0 !important;
    }

    /* ── View container  ────────────────────────────── */
    #posViewContainer {
        height: auto !important;
        min-height: calc(100vh - 60px) !important;
        overflow: visible !important;
    }

    #posProductSection {
        overflow: visible !important;
        max-height: none !important;
    }
}