/* assets/css/navbar.css — gsmartapp shared chrome (v20260826) */
.navbar-custom {
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    position: relative;
}

.dark .navbar-custom {
    border-bottom-color: rgba(71, 85, 105, 0.55);
}

.nav-link-custom {
    position: relative;
    padding-bottom: 4px;
}

.nav-link-custom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--theme-primary, #6366f1);
    transition: width 0.3s ease;
}

.nav-link-custom:hover::after,
.nav-link-custom.active::after {
    width: 100%;
}

/* Mobile drawer backdrop */
#mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 40;
    backdrop-filter: blur(2px);
}
#mobile-menu-backdrop.is-open {
    display: block;
}
#mobile-menu.is-open {
    display: block !important;
}

/* Safer tap targets + notch padding */
.navbar-custom .max-w-\[1920px\] {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

@media (max-width: 1279px) {
    .navbar-custom .h-20 {
        height: 3.75rem;
    }
    #mobile-menu {
        top: 3.75rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Focus ring for keyboard users */
.navbar-custom a:focus-visible,
.navbar-custom button:focus-visible {
    outline: 2px solid var(--theme-primary, #6366f1);
    outline-offset: 2px;
}

/* User chip */
.gs-user-chip {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.65rem 0.35rem 0.35rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    max-width: 11rem;
}
.dark .gs-user-chip {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(129, 140, 248, 0.25);
}
@media (min-width: 1280px) {
    .gs-user-chip { display: inline-flex; }
}
.gs-user-chip .gs-avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: var(--theme-primary, #4f46e5);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gs-user-chip .gs-meta {
    min-width: 0;
    line-height: 1.15;
}
.gs-user-chip .gs-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .gs-user-chip .gs-name { color: #f8fafc; }
.gs-user-chip .gs-role {
    font-size: 0.625rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 1024px) {
    .pos-layout {
        flex-direction: column !important;
        height: calc(100dvh - 3.75rem) !important;
        max-height: calc(100dvh - 3.75rem) !important;
        overflow: hidden !important;
    }

    .pos-cart-section {
        height: calc(100dvh - 3.75rem) !important;
        max-height: calc(100dvh - 3.75rem) !important;
        min-height: 0 !important;
    }
    #cart-container {
        flex: 1 1 0% !important;
        min-height: 0 !important;
        overflow-y: auto !important;
    }

    .pos-product-section {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        order: 1;
    }

    .pos-product-section .p-8 {
        padding: 1rem !important;
    }

    #product-grid.layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    #product-grid.layout-grid .product-row,
    #product-grid.layout-grid .pos-product-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* List thumbs: sizes owned by pos.php inline styles — avoid override here */

    #product-grid.layout-grid .product-image,
    #product-grid.layout-grid .product-image-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        /* height comes from pos.php grid rules — do not re-cap here */
    }

    .product-card {
        padding: 0.75rem !important;
    }

    .product-card .text-6xl {
        font-size: 2rem !important;
    }
}

/* Fix for cart scroll "middle" issue */
#cart-container {
    -webkit-overflow-scrolling: touch;
    z-index: 10;
}

#cart-table {
    min-width: 100%;
}

/* Hide support floats on POS (screen real estate) */
body.gs-pos-mode #gsd-float-widget {
    display: none !important;
}
