/* Mobile-specific CSS */
:root {
    --mobile-menu-text-size: 1.25rem;
    --mobile-menu-icon-size: 1.25rem;
    --mobile-cream-bg: #ffffff;
    --mobile-cream-bg-soft: #ffffff;
    --mobile-cream-hover: #f5f5f5;
    --mobile-cream-border: #dee2e6;
    --mobile-cream-divider: #efe7db;
}

/* The old custom breakpoint bridge that used to force mobile nav between
   992px and 1167.98px (working around Bootstrap's lg trigger being lower
   than this site's actual usable-desktop-width cutoff) has been removed:
   Bootstrap's own lg breakpoint is now 1280px (see bootswatch/
   bootstrap.min.css), which already covers that whole range and more. */

/* Mobile Navigation */
.d-lg-none .navbar-brand {
    font-size: 1.2rem;
    font-weight: 600;
}

.d-lg-none .navbar-brand .brand-logo {
    height: 26px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

.d-lg-none .navbar-brand .brand-logo.brand-logo-mobile {
    height: 28px;
}

/* Centre the logo in the phone header, like the desktop bar. The header icons
   on the side are absolutely positioned, so they don't shift it. */
.store-nav-primary .navbar-brand.brand-logo-link.me-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.d-lg-none .btn-sm,
.d-lg-none .dropdown-toggle {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-lg-none .badge {
    font-size: 0.75rem;
}

/* Mobile navbar container - Match seller dashboard styling */
/* First navbar (logo and user actions) */
@media (max-width: 1167.98px) {
    nav.navbar.navbar-expand-lg.d-lg-none:not(.border-top),
    .d-lg-none.navbar:not(.border-top),
    .navbar.d-lg-none:not(.border-top) {
        padding: 0.95rem 1rem 0.75rem 1rem !important;
        min-height: 48px !important;
        height: auto !important;
        position: relative !important;
        background: var(--mobile-cream-bg-soft) !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
        border-bottom: none !important;
    }

    /* Gradient bottom border for first navbar - Lighter version */
    nav.navbar.navbar-expand-lg.d-lg-none:not(.border-top)::after,
    .d-lg-none.navbar:not(.border-top)::after,
    .navbar.d-lg-none:not(.border-top)::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #2d3748 0%, #4a5568 50%, #2d3748 100%);
        opacity: 0.3;
    }

    /* Second navbar (with search) */
    nav.navbar.navbar-expand-lg.d-lg-none.border-top,
    .d-lg-none.navbar.border-top,
    .navbar.d-lg-none.border-top {
        padding: 0.6rem 1rem !important;
        border-top: 1px solid var(--mobile-cream-border) !important;
        min-height: auto !important;
        height: auto !important;
        border-bottom: none !important;
        background-color: var(--mobile-cream-bg-soft) !important;
    }

    /* Ensure container-fluid inside navbar has consistent padding */
    .d-lg-none .navbar .container-fluid,
    .navbar.d-lg-none .container-fluid,
    nav.navbar .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .site-body {
        background-color: var(--mobile-cream-bg-soft);
    }

    .category-page,
    .category-page .products-content-col {
        background-color: var(--mobile-cream-bg-soft);
    }

    .d-lg-none.navbar .btn-outline-secondary,
    .d-lg-none.navbar .mobile-menu-toggle {
        background-color: var(--mobile-cream-bg-soft) !important;
        border-color: var(--mobile-cream-border) !important;
        color: #495057 !important;
    }

    .d-lg-none.navbar .btn-outline-secondary:hover,
    .d-lg-none.navbar .mobile-menu-toggle:hover {
        background-color: #ffffff !important;
        border-color: var(--mobile-cream-border) !important;
        color: #495057 !important;
        box-shadow: none !important;
    }

    .store-nav-primary {
        position: relative;
        z-index: 1300;
    }

    .store-nav-secondary {
        position: relative;
        z-index: 1200;
    }

    .store-nav-primary .notification-dropdown-container {
        position: relative;
        z-index: 1350;
    }

    .store-nav-primary .dropdown-menu.notification-dropdown {
        z-index: 1400 !important;
    }

    .store-nav-primary,
    .store-nav-primary .container-fluid,
    .store-nav-secondary,
    .store-nav-secondary .container-fluid {
        overflow: visible !important;
    }
}

/* Mobile user actions */
.d-lg-none .d-flex.align-items-center {
    gap: 0.5rem;
}

/* Mobile profile dropdown styling */
.mobile-profile-dropdown {
    min-width: 200px;
    background-color: var(--mobile-cream-bg);
    border: 1px solid var(--mobile-cream-border);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
    padding: 0.35rem 0;
    margin-top: 0.5rem;
    font-size: 1rem;
}

.mobile-profile-dropdown .dropdown-item {
    padding: 0.9rem 1.1rem;
    color: #1f2933;
    transition: background-color 0.2s ease;
    font-size: 1rem;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.mobile-profile-dropdown .dropdown-item:hover {
    background-color: var(--mobile-cream-hover);
    color: #1f2933;
}

.mobile-profile-dropdown .dropdown-item.disabled {
    color: #6c757d;
    cursor: not-allowed;
}

.mobile-profile-dropdown .dropdown-item.disabled:hover {
    background-color: transparent;
    color: #6c757d;
}

.mobile-profile-dropdown .dropdown-divider {
    margin: 0.35rem 0;
    border-color: var(--mobile-cream-border);
}

.mobile-profile-dropdown .dropdown-item i {
    width: 22px;
    text-align: center;
}

/* Mobile profile toggle button */
.mobile-profile-toggle {
    background: none;
    border: none;
    color: #495057;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-lg-none .nav-icon-btn {
    border: 1px solid transparent;
    background-color: transparent;
    box-shadow: none;
}

.d-lg-none .nav-icon-btn:hover,
.d-lg-none .nav-icon-btn:focus,
.d-lg-none .nav-icon-btn:focus-visible {
    background-color: transparent;
    border-color: #dee2e6;
    box-shadow: 0 0 0 1px rgba(45, 55, 72, 0.08);
    text-decoration: none;
}

.mobile-profile-toggle:hover {
    background-color: var(--mobile-cream-hover);
    color: #007bff;
}

.d-lg-none.navbar #mobileAccountToggle:hover,
.d-lg-none.navbar #mobileAccountToggle:focus,
.d-lg-none.navbar #mobileAccountToggle:focus-visible,
.d-lg-none.navbar #mobileAccountToggle:active {
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

.d-lg-none.navbar #mobileAccountToggle,
.d-lg-none.navbar #mobileAccountToggle i {
    -webkit-tap-highlight-color: transparent;
}

.d-lg-none.navbar #mobileAccountToggle *,
.d-lg-none.navbar #mobileAccountToggle:hover *,
.d-lg-none.navbar #mobileAccountToggle:focus *,
.d-lg-none.navbar #mobileAccountToggle:focus-visible *,
.d-lg-none.navbar #mobileAccountToggle:active * {
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.mobile-profile-toggle:focus {
    box-shadow: none;
    outline: none;
}


.d-lg-none .navbar-brand {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.d-lg-none.navbar .navbar-brand.brand-logo-link,
.d-lg-none.navbar .navbar-brand.brand-logo-link:hover,
.d-lg-none.navbar .navbar-brand.brand-logo-link:focus,
.d-lg-none.navbar .navbar-brand.brand-logo-link:focus-visible,
.d-lg-none.navbar .navbar-brand.brand-logo-link:active {
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Hamburger Menu Button */
.mobile-categories-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0;
    color: #495057;
    font-size: 1.1rem;
    transition: none;
    min-width: 44px;
    min-height: 44px;
}

.mobile-categories-toggle:hover {
    background-color: transparent;
    color: #495057;
}

.d-lg-none.navbar #mobileCategoriesToggle:hover,
.d-lg-none.navbar #mobileCategoriesToggle:focus,
.d-lg-none.navbar #mobileCategoriesToggle:focus-visible,
.d-lg-none.navbar #mobileCategoriesToggle:active {
    background-color: transparent !important;
    background-image: none !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
    box-shadow: none !important;
    outline: none !important;
}

.d-lg-none.navbar #mobileCategoriesToggle,
.d-lg-none.navbar #mobileCategoriesToggle i {
    -webkit-tap-highlight-color: transparent;
}

.mobile-categories-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* User Actions */
.d-lg-none .d-flex.align-items-center {
    gap: 0.5rem;
}

.d-lg-none .btn-sm {
    padding: 0.5rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.d-lg-none .btn-sm:hover {
    background-color: transparent;
    color: inherit;
    box-shadow: none;
}

.d-lg-none .mobile-icon-btn,
.d-lg-none .mobile-icon-btn:hover,
.d-lg-none .mobile-icon-btn:focus,
.d-lg-none .mobile-icon-btn:focus-visible,
.d-lg-none .mobile-icon-btn:active {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    border-color: transparent !important;
    color: inherit !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.d-lg-none .badge {
    font-size: 0.75rem;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Mobile Logout Section */
.mobile-logout-section {
    margin-top: 1rem;
    border-top: 1px solid var(--mobile-cream-divider);
    padding-top: 1rem;
}

.mobile-logout-item {
    background-color: transparent;
    border-radius: 0;
    margin: 0;
}

.mobile-logout-link {
    color: #1f2933 !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 0;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.mobile-logout-link:hover {
    background-color: transparent;
    color: #1f2933 !important;
    text-decoration: none;
}

.mobile-logout-link i {
    font-size: 1rem;
}

/* Sign In Button Styling */
.mobile-logout-link[href*="my-login"] {
    color: #1f2933 !important;
}

.mobile-logout-link[href*="my-login"]:hover {
    background-color: transparent;
    color: #1f2933 !important;
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1310;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.show {
    display: block;
    opacity: 1;
}

.mobile-wishlist-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1330;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-wishlist-overlay.show {
    display: block;
    opacity: 1;
}

/* Mobile Sidebar - modern side drawer */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: min(86vw, 360px);
    max-width: 360px;
    height: 100dvh;
    background-color: var(--mobile-cream-bg);
    border-right: 1px solid var(--mobile-cream-border);
    z-index: 1320;
    transition: transform 0.26s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
}

.mobile-sidebar.show {
    transform: translateX(0);
    overflow-y: auto;
    box-shadow: 6px 0 24px rgba(17, 24, 39, 0.16);
    visibility: visible;
    pointer-events: auto;
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
    background: var(--mobile-cream-bg);
    border-bottom: 1px solid var(--mobile-cream-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    flex: 1;
    text-align: center;
    letter-spacing: 0.02em;
}

.mobile-sidebar-header-spacer,
.mobile-sidebar-close-btn {
    flex: 0 0 44px;
}

.mobile-sidebar-header-title {
    min-width: 0;
}

.mobile-sidebar-close-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-close-btn:hover {
    background-color: transparent;
    color: #6c757d;
}

.mobile-sidebar-nav {
    flex: 1;
    padding: 0;
    overflow-y: auto;
}

.mobile-sidebar-nav .nav-link {
    color: #495057;
    padding: 1rem 1.1rem;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--mobile-cream-divider);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    font-weight: 500;
    font-size: var(--mobile-menu-text-size);
    text-decoration: none;
    min-height: 56px;
}

.mobile-sidebar-nav .nav-link:hover {
    background-color: transparent;
    color: #495057;
    text-decoration: none;
}

.mobile-sidebar-nav .nav-link:focus,
.mobile-sidebar-nav .nav-link:focus-visible,
.mobile-sidebar-nav .nav-link:active {
    background-color: transparent;
    color: #495057;
    box-shadow: none;
    outline: none;
    text-decoration: none;
}

.mobile-sidebar-nav .nav-link.active {
    background-color: transparent;
    color: #495057;
    font-weight: 500;
}

.mobile-sidebar-nav .nav-link.active::before {
    content: none;
}

#mobileAccountPanel,
#mobileAccountPanel * {
    -webkit-tap-highlight-color: transparent;
}

.mobile-sidebar-nav .nav-icon {
    width: 22px;
    text-align: center;
    font-size: var(--mobile-menu-icon-size);
    flex-shrink: 0;
    color: #6c757d;
}

.mobile-sidebar-nav .nav-text {
    font-size: var(--mobile-menu-text-size);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-sidebar-nav .nav-link .badge {
    flex-shrink: 0;
    padding: 0.3rem 0.5rem;
    line-height: 1 !important;
    font-size: 0.8rem;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-nav .nav-item {
    margin-bottom: 0;
}

.mobile-sidebar-nav hr {
    margin: 0;
    border-color: var(--mobile-cream-border);
    border-width: 1px;
}

.mobile-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--mobile-cream-border);
    background-color: var(--mobile-cream-bg);
    display: none; /* Hide footer - close button is in header */
}

/* Mobile Categories Page - modern side drawer */
.mobile-categories-page {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    /* Category browsing is a focused, hierarchical flow. On mobile it
       should read as a page, not a narrow drawer with the storefront still
       competing for attention beside it. */
    width: 100vw;
    max-width: none;
    height: 100dvh;
    background-color: var(--mobile-cream-bg);
    border-right: 1px solid var(--mobile-cream-border);
    z-index: 1320;
    display: flex;
    flex-direction: column;
    transition: transform 0.26s ease;
    overflow: hidden;
    box-shadow: none;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
}

.mobile-categories-page.show {
    transform: translateX(0);
    box-shadow: 6px 0 24px rgba(17, 24, 39, 0.16);
    visibility: visible;
    pointer-events: auto;
}

[dir="rtl"] .mobile-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
    border-right: none;
    border-left: 1px solid var(--mobile-cream-border);
}

[dir="rtl"] .mobile-sidebar.show {
    transform: translateX(0);
    box-shadow: -6px 0 24px rgba(17, 24, 39, 0.16);
}

[dir="rtl"] .mobile-categories-page {
    left: auto;
    right: 0;
    transform: translateX(100%);
    border-right: none;
    border-left: 1px solid var(--mobile-cream-border);
}

[dir="rtl"] .mobile-categories-page.show {
    transform: translateX(0);
    box-shadow: -6px 0 24px rgba(17, 24, 39, 0.16);
}

/* Mobile Categories Header */
.mobile-categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
    background-color: var(--mobile-cream-bg);
    border-bottom: 1px solid var(--mobile-cream-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-exit-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-exit-btn:hover {
    background-color: var(--mobile-cream-hover);
    color: #000;
}

.mobile-page-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    flex: 1;
    text-align: center;
}

.mobile-back-btn,
.mobile-exit-btn {
    flex: 0 0 44px;
}

.mobile-back-btn {
    background: none;
    border: none;
    color: #495057;
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-back-btn:hover {
    background-color: var(--mobile-cream-hover);
    color: #000;
}

.mobile-back-btn i {
    font-size: 1rem;
}

/* Mobile Categories Content */
.mobile-categories-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--mobile-cream-bg);
}

/* Mobile Category Pages */
.mobile-category-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.mobile-category-page.active {
    display: block;
}

/* Mobile Categories Lists */
.mobile-category-list {
    padding: 0;
}

.mobile-current-path {
    align-items: center;
    background: #f7f8fa;
    border: 0;
    border-bottom: 1px solid var(--mobile-cream-divider);
    color: #1f2933;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    text-align: left;
    width: 100%;
}

.mobile-current-path-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.mobile-current-path-eyebrow {
    color: #7b8490;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mobile-current-path strong {
    font-size: 0.95rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-current-path > .fa-chevron-right {
    color: #6c757d;
    font-size: 0.85rem;
}

.mobile-current-path:focus-visible {
    outline: 2px solid #1f2933;
    outline-offset: -3px;
}



.mobile-category-link {
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    flex: 1;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    font-size: var(--mobile-menu-text-size);
}

.mobile-category-link i {
    margin: 0 !important;
}

.mobile-category-link:hover {
    color: #1f2933;
}

/* Ensure account menu items work correctly */
#mobileAccountPage .mobile-category-item {
    justify-content: flex-start;
    cursor: default;
}

#mobileAccountPage .mobile-category-item:hover {
    background-color: var(--mobile-cream-hover);
}

#mobileAccountPage .mobile-category-item a {
    width: 100%;
    cursor: pointer;
    pointer-events: auto;
}

#mobileAccountPage .mobile-category-item a:hover {
    color: #000;
}

.mobile-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--mobile-cream-divider);
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 56px;
}

.mobile-category-item:hover {
    background-color: transparent;
}

/* Keep the current browsing path visible when the category drawer opens. */
.mobile-categories-page .mobile-category-item.is-current {
    background: #f1f3f5;
    box-shadow: inset 3px 0 0 #1f2933;
}

.mobile-categories-page .mobile-category-item.is-current .mobile-category-link {
    color: #1f2933;
    font-weight: 700;
}

.mobile-category-link {
    color: #1f2933;
    font-weight: 500;
}

.mobile-category-link:hover {
    color: #1f2933;
}

/* Per-category icon image (Category.icon_image) rendered before the label —
   see base_mobile.js populateSubcategories and this template's top-level
   loop. Fixed size so labels stay aligned whether or not a given row has
   one; object-fit guards against a non-square upload distorting the row. */
.mobile-category-icon-image {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-inline-end: 0.65rem;
    object-fit: contain;
    vertical-align: -0.2rem;
}

.mobile-category-expand {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-category-expand:hover {
    background-color: transparent;
    color: #6c757d;
}

@media (prefers-reduced-motion: reduce) {
    .mobile-sidebar-overlay,
    .mobile-sidebar,
    .mobile-categories-page {
        transition: none !important;
    }
}

.mobile-categories-page .mobile-category-item:focus,
.mobile-categories-page .mobile-category-item:focus-visible,
.mobile-categories-page .mobile-category-item:active,
.mobile-categories-page .mobile-category-link:focus,
.mobile-categories-page .mobile-category-link:focus-visible,
.mobile-categories-page .mobile-category-link:active,
.mobile-categories-page .mobile-category-expand:focus,
.mobile-categories-page .mobile-category-expand:focus-visible,
.mobile-categories-page .mobile-category-expand:active,
.mobile-exit-btn:hover,
.mobile-exit-btn:focus,
.mobile-exit-btn:focus-visible,
.mobile-exit-btn:active,
.mobile-back-btn:hover,
.mobile-back-btn:focus,
.mobile-back-btn:focus-visible,
.mobile-back-btn:active {
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

/* Final hard overrides: remove even subtle hover/tap tint in hamburger + profile popups */
#mobileCategoriesPage,
#mobileCategoriesPage *,
#mobileAccountPanel,
#mobileAccountPanel * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}

#mobileCategoriesPage .mobile-category-item,
#mobileCategoriesPage .mobile-category-item:hover,
#mobileCategoriesPage .mobile-category-item:focus,
#mobileCategoriesPage .mobile-category-item:focus-visible,
#mobileCategoriesPage .mobile-category-item:active,
#mobileCategoriesPage .mobile-category-link,
#mobileCategoriesPage .mobile-category-link:hover,
#mobileCategoriesPage .mobile-category-link:focus,
#mobileCategoriesPage .mobile-category-link:focus-visible,
#mobileCategoriesPage .mobile-category-link:active,
#mobileCategoriesPage .mobile-category-expand,
#mobileCategoriesPage .mobile-category-expand:hover,
#mobileCategoriesPage .mobile-category-expand:focus,
#mobileCategoriesPage .mobile-category-expand:focus-visible,
#mobileCategoriesPage .mobile-category-expand:active,
#mobileAccountPanel .mobile-sidebar-nav .nav-link,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:hover,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:focus,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:focus-visible,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:active,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.active {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

/* Reapply the deliberate current-category state after the neutral interaction reset. */
#mobileCategoriesPage .mobile-category-item.is-current {
    background-color: #f1f3f5 !important;
    box-shadow: inset 3px 0 0 #1f2933 !important;
}

#mobileCategoriesPage .mobile-category-item.is-current .mobile-category-link {
    color: #1f2933 !important;
    font-weight: 700;
}

/* Reads as promotional like the desktop subcategory bar's sale accent
   (static/css/base_desktop.css .category-sale-link) rather than a plain
   row like every other category — see base_mobile.js populateSubcategories
   for the slug-based check that adds this class. */
#mobileCategoriesPage .mobile-category-link.mobile-category-link-sale,
#mobileCategoriesPage .mobile-category-link.mobile-category-link-sale:hover,
#mobileCategoriesPage .mobile-category-link.mobile-category-link-sale:focus {
    color: #b42318;
    font-weight: 600;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:hover,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:focus,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:focus-visible,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:active {
    color: #9aa3af !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled .nav-icon,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled .nav-text,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:hover .nav-icon,
#mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:hover .nav-text,
.dashboard-mobile-nav #mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled,
.dashboard-mobile-nav #mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:hover,
.dashboard-mobile-nav #mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:focus,
.dashboard-mobile-nav #mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:focus-visible,
.dashboard-mobile-nav #mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled:active,
.dashboard-mobile-nav #mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled .nav-icon,
.dashboard-mobile-nav #mobileAccountPanel .mobile-sidebar-nav .nav-link.disabled .nav-text {
    color: #9aa3af !important;
}

#mobileExitBtn,
#mobileExitBtn:hover,
#mobileExitBtn:focus,
#mobileExitBtn:focus-visible,
#mobileExitBtn:active,
#mobileAccountPanelClose,
#mobileAccountPanelClose:hover,
#mobileAccountPanelClose:focus,
#mobileAccountPanelClose:focus-visible,
#mobileAccountPanelClose:active {
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    border-color: transparent !important;
    color: #6c757d !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}

.mobile-category-expand i {
    font-size: 0.8rem;
}

[dir="rtl"] #mobileAccountPanel .fa-sign-out-alt,
[dir="rtl"] #mobileCategoriesPage .fa-sign-out-alt {
    transform: scaleX(-1) !important;
}

[dir="rtl"] #mobileCategoriesPage .mobile-category-expand .fa-chevron-right,
[dir="rtl"] #mobileCategoriesPage #mobileBackBtn .fa-arrow-left {
    transform: scaleX(-1);
}

/* Compact card treatment for the category drawer. These declarations come
   after the neutral interaction reset above so the visual hierarchy is not
   erased by its broad selectors. */
#mobileCategoriesPage .mobile-categories-header {
    padding: max(0.85rem, env(safe-area-inset-top)) 1rem 0.8rem;
}

#mobileCategoriesPage .mobile-page-title-group {
    flex: 1;
    min-width: 0;
    text-align: center;
}

#mobileCategoriesPage .mobile-page-title {
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#mobileCategoriesPage .mobile-page-subtitle {
    margin: 0.2rem 0 0;
    color: #7b8490;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

#mobileCategoriesPage .mobile-category-list {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0.8rem;
}

#mobileCategoriesPage .mobile-category-item {
    min-height: 80px;
    margin-bottom: 0.55rem;
    padding: 0.35rem 0.6rem 0.35rem 1rem;
    border: 1px solid #e7e9ed;
    border-radius: 16px;
    background-color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
}

#mobileCategoriesPage .mobile-category-link {
    font-size: 1rem;
    font-weight: 600;
}

#mobileCategoriesPage .mobile-category-image {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    margin: -0.15rem 0.15rem -0.15rem -0.55rem;
    border-radius: 12px;
    object-fit: cover;
    background: #edf0f2;
}

/* Root departments are the visual entry points, so give their editorial
   imagery more presence than the compact subcategory tiles below. */
#mobileCategoriesPage .mobile-category-page[data-level="0"] .mobile-category-item {
    min-height: 104px;
}

#mobileCategoriesPage .mobile-category-page[data-level="0"] .mobile-category-image {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
}

[dir="rtl"] #mobileCategoriesPage .mobile-category-image {
    margin: -0.15rem -0.55rem -0.15rem 0.15rem;
}

#mobileCategoriesPage .mobile-category-expand {
    min-width: 38px;
    min-height: 38px;
    border-radius: 999px;
    background-color: #f4f5f7 !important;
}

#mobileCategoriesPage .mobile-category-item.is-current {
    border-color: #cfd5dc;
    background-color: #f4f5f7 !important;
    box-shadow: inset 3px 0 0 #1f2933, 0 3px 12px rgba(15, 23, 42, 0.04) !important;
}

#mobileCategoriesPage .mobile-category-page.active[data-level="0"] {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

#mobileCategoriesPage .mobile-logout-section {
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid #e7e9ed;
}

#mobileCategoriesPage .mobile-logout-section .mobile-category-item {
    margin-bottom: 0;
    border-color: transparent;
    background-color: #f7f8fa !important;
    box-shadow: none;
}

/* The account panel is a focused mobile destination too, not a partial
   sidebar. Match the category panel's spacing and card rhythm while keeping
   every existing account action and permission path unchanged. */
#mobileAccountPanel {
    width: 100vw;
    max-width: none;
}

#mobileAccountPanel .mobile-sidebar-header {
    padding: max(0.85rem, env(safe-area-inset-top)) 1rem 0.8rem;
}

#mobileAccountPanel .mobile-account-greeting {
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#mobileAccountPanel .mobile-account-role {
    margin-top: 0.2rem;
    color: #7b8490 !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

#mobileAccountPanel .mobile-sidebar-nav {
    display: flex;
    min-height: 0;
    padding: 0.8rem;
}

#mobileAccountPanel .mobile-sidebar-nav .nav.flex-column {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 100%;
}

#mobileAccountPanel .mobile-sidebar-nav hr {
    display: none;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-item {
    margin-bottom: 0.55rem;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-link,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:hover,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:focus,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:focus-visible,
#mobileAccountPanel .mobile-sidebar-nav .nav-link:active {
    min-height: 72px;
    padding: 0.45rem 0.75rem;
    border: 1px solid #e7e9ed;
    border-radius: 16px;
    background-color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04) !important;
    color: #1f2933 !important;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #f4f5f7;
    color: #66717c;
    font-size: 1rem;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-text {
    font-size: 1rem;
    font-weight: 600;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-item:last-child {
    margin-top: auto;
    padding-top: 0.8rem;
}

#mobileAccountPanel .mobile-sidebar-nav .nav-item:last-child .nav-link {
    border-color: transparent;
    background-color: #f7f8fa !important;
    box-shadow: none !important;
}

/* Wishlist keeps its quick list-picker, presented as a focused full-screen
   mobile destination instead of a cramped Bootstrap dropdown. */
#mobileWishlistPanel {
    width: 100vw;
    max-width: none;
    z-index: 1340;
}

#mobileWishlistPanel .mobile-sidebar-header {
    padding: max(0.85rem, env(safe-area-inset-top)) 1rem 0.8rem;
}

#mobileWishlistPanel .mobile-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#mobileWishlistPanel .mobile-wishlist-subtitle {
    display: block;
    margin-top: 0.2rem;
    color: #7b8490;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

#mobileWishlistPanel .mobile-wishlist-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
    padding: 0.8rem;
    overflow-y: auto;
}

#mobileWishlistPanel .mobile-wishlist-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

#mobileWishlistPanel .mobile-wishlist-item,
#mobileWishlistPanel .mobile-wishlist-manage-link {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 0.45rem 0.75rem;
    border: 1px solid #e7e9ed;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
    color: #1f2933;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

#mobileWishlistPanel .mobile-wishlist-manage-link {
    margin-top: auto;
    border-color: transparent;
    background: #f7f8fa;
    box-shadow: none;
}

#mobileWishlistPanel .mobile-wishlist-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-right: 0.75rem;
    border-radius: 999px;
    background: #f4f5f7;
    color: #66717c;
}

#mobileWishlistPanel .mobile-wishlist-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#mobileWishlistPanel .mobile-wishlist-count {
    min-width: 1.8rem;
    margin-left: auto;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    background: #f0f2f5;
    color: #66717c;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

#mobileWishlistPanel .mobile-wishlist-chevron {
    margin-left: 0.75rem;
    color: #74808b;
    font-size: 0.82rem;
}

#mobileWishlistPanel .mobile-wishlist-loading,
#mobileWishlistPanel .mobile-wishlist-empty {
    margin: 0;
    padding: 1.25rem 0.75rem;
    color: #7b8490;
    font-size: 0.92rem;
    text-align: center;
}

[dir="rtl"] #mobileWishlistPanel .mobile-wishlist-icon {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] #mobileWishlistPanel .mobile-wishlist-count,
[dir="rtl"] #mobileWishlistPanel .mobile-wishlist-chevron {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] #mobileWishlistPanel .mobile-wishlist-chevron {
    margin-right: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideOutDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Mobile product grid */
.mobile-product-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
}

/* Mobile filter container */
.mobile-filter-container {
    background-color: var(--mobile-cream-hover);
    border-radius: 8px;
    padding: 15px;
    margin: 15px;
}

/* Mobile filter button */
.mobile-filter-toggle {
    width: 100%;
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
}

.mobile-filter-toggle:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* Mobile price slider */
.mobile-price-slider {
    width: 100%;
    margin: 15px 0;
}

.mobile-price-slider .noUi-connect {
    background: #6c757d;
}

.mobile-price-slider .noUi-handle {
    background: #6c757d;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    width: 20px;
    height: 20px;
    right: -10px;
    top: -10px;
}

/* Mobile sorting buttons */
.mobile-sorting-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.mobile-sorting-buttons .btn {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.mobile-sorting-buttons .btn:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

.mobile-sorting-buttons .btn.active {
    background-color: #495057;
    border-color: #495057;
}

/* Mobile filter buttons */
.mobile-filter-buttons {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.mobile-filter-buttons .btn {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    flex: 1;
}

.mobile-filter-buttons .btn:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

.mobile-filter-buttons .btn.reset {
    background-color: transparent;
    border-color: #6c757d;
    color: #6c757d;
}

.mobile-filter-buttons .btn.reset:hover {
    background-color: #6c757d;
    color: white;
}

/* Mobile brand search */
.mobile-brand-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 1rem;
}

/* Mobile first navigation bar - Compact layout like seller dashboard */
.d-lg-none .navbar:not(.border-top) .container-fluid {
    position: relative;
}

.d-lg-none .navbar:not(.border-top) .navbar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
}


/* Mobile search form in second bar */
.d-lg-none .flex-grow-1 .input-group {
    min-height: 44px;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    border: 1px solid #dee2e6;
    border-left: none;
    border-radius: 0;
    overflow: visible !important;
    box-shadow: none;
    transition: none;
    position: relative;
}

.d-lg-none .flex-grow-1 .input-group:focus-within {
    box-shadow: none;
}

.d-lg-none .flex-grow-1 .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.d-lg-none .flex-grow-1 .input-group .form-control:focus {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

.d-lg-none .flex-grow-1 .form-control {
    font-size: 14px !important;
    padding: 0.625rem 1rem;
    min-height: 44px;
}

.d-lg-none .flex-grow-1 .input-group button[type="submit"] {
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    min-width: 48px;
    max-width: 54px;
    width: 48px;
    padding: 0.625rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none !important;
    border-left: 1px solid #dee2e6 !important;
    border-radius: 0;
    transition: none;
}

.d-lg-none .flex-grow-1 .input-group button[type="submit"]:focus,
.d-lg-none .flex-grow-1 .input-group button[type="submit"]:active {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}


.d-lg-none .flex-grow-1 .input-group button[type="submit"] i {
    font-size: 0.95rem;
    margin: 0;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile category dropdown button styling */
.d-lg-none .category-search-dropdown .btn {
    flex-shrink: 0;
    flex-grow: 0;
    white-space: nowrap;
    min-width: 48px;
    max-width: 54px;
    width: 48px;
    padding: 0.625rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: none !important;
    border-right: 1px solid #dee2e6 !important;
    border-radius: 0;
    transition: none;
}

.d-lg-none .category-search-dropdown .btn:focus,
.d-lg-none .category-search-dropdown .btn:active,
.d-lg-none .category-search-dropdown .btn.active,
.d-lg-none .category-search-dropdown .btn.show {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}


.d-lg-none .category-search-dropdown .btn i {
    font-size: 0.95rem;
    margin: 0;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.d-lg-none .category-search-dropdown .dropdown-menu {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

.d-lg-none .category-search-dropdown .mobile-category-search-menu {
    left: 0;
    right: auto;
    max-width: min(88vw, 320px);
    overflow-x: hidden;
}

.d-lg-none .category-search-dropdown .dropdown-item:hover,
.d-lg-none .category-search-dropdown .dropdown-item:focus,
.d-lg-none .category-search-dropdown .dropdown-item.active {
    background-color: #f5f5f5;
    color: #1f2933;
}

.d-lg-none .flex-grow-1 .btn {
    padding: 0.625rem 0.75rem;
    min-height: 44px;
    font-size: 0.875rem;
}

.d-lg-none .mobile-sell-with-us-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.d-lg-none .mobile-sell-with-us-btn:hover,
.d-lg-none .mobile-sell-with-us-btn:focus,
.d-lg-none .mobile-sell-with-us-btn:focus-visible,
.d-lg-none .mobile-sell-with-us-btn:active {
    background-color: transparent !important;
    color: inherit !important;
    border-color: #2d3748 !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
}

.d-lg-none .mobile-sell-with-us-btn i {
    margin: 0 !important;
}

/* Hard override for cart/wishlist icon links in mobile top navbar */
nav.navbar.d-lg-none a.btn[href*="cart-summary"],
nav.navbar.d-lg-none a.btn[href*="wishlist"],
nav.navbar.d-lg-none a.btn[href*="cart-summary"]:hover,
nav.navbar.d-lg-none a.btn[href*="wishlist"]:hover,
nav.navbar.d-lg-none a.btn[href*="cart-summary"]:focus,
nav.navbar.d-lg-none a.btn[href*="wishlist"]:focus,
nav.navbar.d-lg-none a.btn[href*="cart-summary"]:focus-visible,
nav.navbar.d-lg-none a.btn[href*="wishlist"]:focus-visible,
nav.navbar.d-lg-none a.btn[href*="cart-summary"]:active,
nav.navbar.d-lg-none a.btn[href*="wishlist"]:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

.d-lg-none .mobile-cart-btn,
.d-lg-none .mobile-cart-btn *,
.d-lg-none .mobile-cart-btn:hover,
.d-lg-none .mobile-cart-btn:focus,
.d-lg-none .mobile-cart-btn:focus-visible,
.d-lg-none .mobile-cart-btn:active,
.d-lg-none .mobile-cart-btn:hover *,
.d-lg-none .mobile-cart-btn:focus *,
.d-lg-none .mobile-cart-btn:focus-visible *,
.d-lg-none .mobile-cart-btn:active * {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Keep cart badge visible after hard no-highlight overrides */
.d-lg-none .mobile-cart-btn .badge,
.d-lg-none .mobile-cart-btn .badge:hover,
.d-lg-none .mobile-cart-btn .badge:focus,
.d-lg-none .mobile-cart-btn .badge:focus-visible,
.d-lg-none .mobile-cart-btn .badge:active,
.d-lg-none .mobile-cart-btn .badge.rounded-pill.bg-danger {
    background: #dc3545 !important;
    background-color: #dc3545 !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    border: 2px solid #ffffff !important;
}

/* Mobile price display */
.mobile-price-display {
    color: #6c757d;
    font-weight: 500;
    margin: 15px 0;
    padding: 10px;
    background-color: var(--mobile-cream-hover);
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}

/* Mobile filter sections */
.mobile-filter-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--mobile-cream-bg);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.mobile-filter-section h6 {
    margin-bottom: 10px;
    color: #495057;
    font-weight: 600;
}

/* Mobile checkbox styling */
.mobile-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-checkbox-group .form-check {
    padding: 8px 0;
}

.mobile-checkbox-group .form-check-input {
    margin-right: 8px;
}

.mobile-checkbox-group .form-check-label {
    font-size: 0.9rem;
    color: #495057;
}

/* Mobile dropdown styling */
.mobile-dropdown {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: var(--mobile-cream-bg);
    font-size: 0.9rem;
}

/* Mobile card styling */
.mobile-card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow: hidden;
}

.mobile-card .card-body {
    padding: 15px;
}

.mobile-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.mobile-card .card-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Mobile button sizing */
.mobile-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 6px;
    font-weight: 500;
}

.mobile-btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* Mobile spacing */
.mobile-mt-15 {
    margin-top: 15px;
}

.mobile-mb-15 {
    margin-bottom: 15px;
}

.mobile-p-15 {
    padding: 15px;
}

/* Mobile text sizing */
.mobile-text-sm {
    font-size: 0.875rem;
}

.mobile-text-xs {
    font-size: 0.8rem;
}

/* Mobile touch targets */
.mobile-touch-target {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lift the other fixed bottom widgets above the tab bar (bar styles: base_common.css). */
@media (max-width: 991.98px) {
    body:has(.mobile-tabbar) #stylist-chat-button {
        bottom: calc(1.5rem + 56px + env(safe-area-inset-bottom, 0px) + var(--sticky-bottom-offset, 0px));
    }

    /* The Bag tab (with its count) replaces the floating bag shortcut on phones. */
    body:has(.mobile-tabbar) .external-shopping-bag-bar {
        display: none !important;
    }

    /* Product page Add to cart bar and cart checkout bar sit just above the tab bar. */
    body:has(.mobile-tabbar) .sticky-cart-bar,
    body:has(.mobile-tabbar) .cart-sticky-cta {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    }

    /* Phones: tapping the top edge of the screen already scrolls to the top, so the
       back-to-top button only covered products. */
    .back-to-top-fab {
        display: none !important;
    }

    /* A smaller Nour button, so it covers less of the grid (body prefix: stylist_chat.css loads later). */
    body #stylist-chat-button {
        right: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.15rem;
    }

    /* The tab bar already offers Account, Wishlist and Bag, and the Search tab
       replaces the category picker: the phone header keeps logo, menu and search.
       Sellers keep their notifications bell. The has-tabbar / is-search-home
       classes are set by base_mobile.html at render time (not with :has() on the
       tab bar, which is parsed last and made the icons flash in, then out). */
    .mobile-header-actions.has-tabbar > :not(.notification-dropdown-container) {
        display: none !important;
    }

    .store-nav-secondary.has-tabbar .category-search-dropdown {
        display: none;
    }

    /* The Search tab screen carries its own search field. */
    .store-nav-secondary.is-search-home {
        display: none !important;
    }
}

/* ─────────────────────────────────────────────────────────────
   Mobile Home / Search, aligned with the app (partials/_mobile_gender_switch.html,
   partials/_mobile_search_home.html).
   ───────────────────────────────────────────────────────────── */
.mobile-gender-switch {
    display: flex;
    gap: 2px;
    margin: 0.7rem 0.75rem 0.4rem;
    padding: 3px;
    background: #f1f1f1;
    border-radius: 999px;
}

.mobile-gender-switch .mobile-gender-link {
    flex: 1 1 0;
    padding: 0.5rem 0.25rem;
    border-radius: 999px;
    color: #555;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.mobile-gender-switch .mobile-gender-link.is-active {
    background: #111;
    color: #fff;
}

.mobile-search-home {
    padding: 1rem 0.25rem 1.5rem;
}

.mobile-search-home-title {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.mobile-search-home-form {
    position: relative;
    margin: 0 0 1.1rem;
}

.mobile-search-home-form .mobile-search-home-input {
    width: 100%;
    min-height: 48px;
    padding: 0.6rem 1rem 0.6rem 2.6rem;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    background: #f5f5f5;
    font-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-search-home-form .mobile-search-home-input:focus {
    outline: none;
    border-color: #111;
    background: #fff;
}

.mobile-search-home-form .mobile-search-home-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 1rem;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1.1rem;
    pointer-events: none;
}

[dir="rtl"] .mobile-search-home-form .mobile-search-home-input {
    padding: 0.6rem 2.6rem 0.6rem 1rem;
}

.mobile-search-group {
    border-top: 1px solid #ececec;
}

.mobile-search-group:last-of-type {
    border-bottom: 1px solid #ececec;
}

.mobile-search-group > summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 80px;
    padding: 0.6rem 0.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.mobile-search-group > summary::-webkit-details-marker {
    display: none;
}

.mobile-search-group > summary::after {
    content: "\f054";
    margin-inline-start: auto;
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    color: #9ca3af;
    transition: transform 0.15s ease;
}

.mobile-search-group[open] > summary::after {
    transform: rotate(90deg);
}

.mobile-search-group > summary img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-search-group ul {
    margin: 0;
    padding: 0 0.25rem 0.75rem;
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
}

.mobile-search-group li a {
    display: block;
    padding: 0.55rem 0;
    color: #1f2937;
    font-size: 0.92rem;
    text-decoration: none;
}

.mobile-search-group li a.mobile-search-all {
    font-weight: 600;
    text-decoration: underline;
}

/* Subcategory chips under the category title (partials/_subcategory_chip_row.html).
   Phones and tablets only: desktop has the category sidebar. */
.subcategory-chips {
    display: flex;
    gap: 0.45rem;
    padding: 0.15rem 1rem 0.65rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.subcategory-chips::-webkit-scrollbar {
    display: none;
}

.subcategory-chips .subcategory-chip {
    flex: 0 0 auto;
    padding: 0.42rem 0.9rem;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    color: #222;
    font-size: 0.8rem;
    white-space: nowrap;
    text-decoration: none;
}

.subcategory-chips .subcategory-chip.is-active {
    border-color: #111;
    background: #111;
    color: #fff;
}

@media (min-width: 1168px) {
    .subcategory-chips {
        display: none;
    }
}

/* ── Mobile bottom sheets (Sort and Filter): category, search and brands pages ── */
@media (max-width: 991.98px) {
    body.sheet-open {
        overflow: hidden;
    }

    .mobile-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1590;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.sheet-open .mobile-sheet-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-sheet,
    #mobileFilterCollapse.mobile-filter-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1600;
        display: block !important;
        /* vh counts the area behind the phone browser's address bar, so 88vh
           pushed the sheet's top (and its close button) under the bar. dvh is
           the visible height; always leave a strip of backdrop above the
           sheet to tap to close. */
        max-height: calc(100vh - 72px);
        max-height: calc(100dvh - 72px);
        margin: 0 !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
        visibility: hidden;
        transform: translateY(100%);
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
    }

    .mobile-sheet.show,
    #mobileFilterCollapse.mobile-filter-sheet.show {
        visibility: visible;
        transform: translateY(0);
        transition: transform 0.25s ease, visibility 0s;
    }

    .mobile-sheet {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    #mobileFilterCollapse.mobile-filter-sheet > .card {
        border: 0;
        border-radius: 0;
        padding: 0 1rem calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Sorting has its own sheet now; the hidden select still carries the current
       sort into Apply. */
    #mobileFilterCollapse .mb-4:has(> #sort-mobile) {
        display: none;
    }

    .mobile-sheet-header {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 -1rem 0.5rem;
        padding: 1.1rem 1rem 0.75rem;
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-sheet > .mobile-sheet-header {
        margin: 0;
    }

    /* Grab handle */
    .mobile-sheet-header::before {
        content: "";
        position: absolute;
        top: 0.45rem;
        left: 50%;
        width: 38px;
        height: 4px;
        border-radius: 2px;
        background: #d6d6d6;
        transform: translateX(-50%);
    }

    .mobile-sheet-title {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .mobile-sheet-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #f2f2f2;
        color: #333;
    }

    .mobile-sort-options {
        margin: 0;
        padding: 0.25rem 0 0.75rem;
        list-style: none;
    }

    .mobile-sort-option {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 52px;
        padding: 0 1.25rem;
        border: 0;
        background: none;
        color: #222;
        font-size: 0.95rem;
        text-align: start;
    }

    .mobile-sort-option.is-active {
        font-weight: 700;
        color: #111;
    }

    .mobile-sort-option + .mobile-sort-option,
    .mobile-sort-options li + li .mobile-sort-option {
        border-top: 1px solid #f3f3f3;
    }
}

/* ── Phones: saved items (wishlist, lists, shopping bag) ── */
.saved-items-pill {
    display: none;
}

@media (max-width: 767.98px) {
    .saved-items-bar {
        display: flex;
        gap: 0.5rem;
        margin: 0 0 0.75rem;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .saved-items-pill {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 0.45rem;
        min-height: 38px;
        padding: 0.35rem 0.9rem;
        border: 1px solid #d9d9d9;
        border-radius: 999px;
        background: #fff;
        color: #111;
        font-size: 0.8rem;
        font-weight: 600;
    }

    .saved-items-pill .saved-items-pill-caret {
        font-size: 0.6rem;
        color: #888;
    }

    .saved-items-selects {
        display: none !important;
    }

    /* Destructive actions as quiet text links rather than red buttons. */
    .category-hero .wishlist-shortcut.text-danger,
    .shopping-bag-detail .wl-ctrl-btn-danger {
        padding: 0.25rem 0;
        border: 0 !important;
        background: none !important;
        color: #9b2c2c !important;
        font-size: 0.75rem;
        letter-spacing: 0.02em;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .category-hero .wishlist-toolbar #clear-default-wishlist-form {
        order: 3;
    }

    .category-hero .wishlist-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.75rem;
    }

    /* Saved-item cards: the site's 3:4 product image instead of a cropped strip. */
    [data-wishlist-item] .product-card .image-container {
        height: auto !important;
        aspect-ratio: 3 / 4;
    }

    /* Saved items are often wide packshots on white (shoes, bags): show the whole
       product instead of cropping it to fill the frame. */
    [data-wishlist-item] .product-card .image-container {
        background: #fff !important;
    }

    [data-wishlist-item] .product-card .image-container img.card-img-primary {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

/* My Credits: keep "0 / 100" on one line. */
.credits-allowance-table td:not(:first-child),
.credits-allowance-table th:not(:first-child) {
    white-space: nowrap;
}

/* Support: the signed-in greeting as a quiet line, not a teal alert. */
.support-welcome a {
    color: inherit;
    text-decoration: underline;
}

/* My Credits, Purchases: each row becomes a small card on phones
   (pack + amount, then reference + status, then View). */
@media (max-width: 576px) {
    .credit-purchases-table thead {
        display: none;
    }

    .credit-purchases-table,
    .credit-purchases-table tbody {
        display: block;
        width: 100%;
    }

    .credit-purchases-table tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "pack amount"
            "ref status"
            "view view";
        gap: 0.2rem 0.75rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .credit-purchases-table tr:last-child {
        border-bottom: 0;
    }

    .credit-purchases-table td {
        padding: 0 !important;
        border: 0 !important;
    }

    .credit-purchases-table .cp-pack {
        grid-area: pack;
        font-weight: 600;
        color: #111;
    }

    .credit-purchases-table .cp-amount {
        grid-area: amount;
        font-weight: 600;
        white-space: nowrap;
    }

    .credit-purchases-table .cp-ref {
        grid-area: ref;
        color: #6b7280;
        font-size: 0.75rem;
        overflow-wrap: anywhere;
    }

    .credit-purchases-table .cp-status {
        grid-area: status;
        text-align: end;
    }

    .credit-purchases-table .cp-view {
        grid-area: view;
        text-align: start !important;
    }

    .credit-purchases-table .cp-view a {
        color: #111;
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    /* The card layout needs no sideways scrolling. */
    .table-responsive:has(> .credit-purchases-table) {
        overflow: visible;
    }
}

/* ── Wishlist saved bar and lists sheet (phones; built by wishlist.js) ── */
.wl-saved-bar,
.wl-sheet {
    display: none;
}

@media (max-width: 767.98px) {
    .wl-saved-bar {
        display: flex;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(56px + 12px + env(safe-area-inset-bottom, 0px));
        z-index: 1700;
        align-items: center;
        gap: 0.6rem;
        padding: 0.7rem 0.6rem 0.7rem 1rem;
        border-radius: 12px;
        background: #111;
        color: #fff;
        font-size: 0.9rem;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
        transform: translateY(16px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .wl-saved-bar.is-visible {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }

    .wl-saved-bar > i {
        color: #ff5a6e;
    }

    .wl-saved-bar-text {
        flex: 1;
        min-width: 0;
    }

    .wl-saved-bar-change {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 0 0.85rem;
        border: 0;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
        font-weight: 700;
    }

    .wl-sheet:not([hidden]) {
        display: block;
    }

    body.wl-sheet-lock {
        overflow: hidden;
    }

    .wl-sheet-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1800;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .wl-sheet-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1801;
        max-height: 75vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 1.3rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
        border-radius: 16px 16px 0 0;
        background: #fff;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
        transform: translateY(100%);
        transition: transform 0.22s ease-out;
    }

    .wl-sheet.is-open .wl-sheet-backdrop {
        opacity: 1;
    }

    .wl-sheet.is-open .wl-sheet-panel {
        transform: none;
    }

    .wl-sheet-handle {
        position: absolute;
        top: 0.5rem;
        left: 50%;
        width: 38px;
        height: 4px;
        margin-left: -19px;
        border-radius: 2px;
        background: #d9d9d9;
    }

    .wl-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }

    .wl-sheet-title {
        font-size: 1.05rem;
        font-weight: 700;
    }

    .wl-sheet-close {
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 50%;
        background: #f1f1f1;
        color: #333;
    }

    .wl-sheet-row {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
        min-height: 54px;
        padding: 0 0.25rem;
        border: 0;
        border-bottom: 1px solid #f0f0f0;
        background: transparent;
        color: #111;
        font-size: 0.98rem;
        text-align: start;
    }

    .wl-sheet-row:disabled {
        opacity: 0.6;
    }

    .wl-sheet-check {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 24px;
        height: 24px;
        border: 1.5px solid #c9c9c9;
        border-radius: 50%;
        color: transparent;
        font-size: 0.7rem;
    }

    .wl-sheet-row.is-saved .wl-sheet-check {
        border-color: #111;
        background: #111;
        color: #fff;
    }

    .wl-sheet-name {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wl-sheet-count {
        color: #9ca3af;
        font-size: 0.85rem;
    }

    .wl-sheet-empty {
        margin: 0.75rem 0;
        color: #6b7280;
    }

    .wl-sheet-new {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.9rem;
    }

    .wl-sheet-new-input {
        flex: 1;
        min-width: 0;
        min-height: 46px;
        padding: 0 0.9rem;
        border: 1px solid #ddd;
        border-radius: 10px;
        font-size: 16px;
    }

    .wl-sheet-new-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-height: 46px;
        padding: 0 1rem;
        border: 0;
        border-radius: 10px;
        background: #111;
        color: #fff;
        font-weight: 600;
    }

    .wl-sheet-manage {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 0.75rem;
        min-height: 44px;
        color: #374151;
        font-size: 0.9rem;
        text-decoration: none;
    }

    /* The heart's list chevron opens the Save to list sheet (wishlist.js):
       a slightly bigger badge with a finger-sized invisible tap area. */
    .product-card .wishlist-save-wrap .wishlist-save-btn {
        position: relative;
        width: 22px !important;
        height: 22px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
    }

    .product-card .wishlist-save-wrap .wishlist-save-btn::before {
        content: "";
        position: absolute;
        inset: -11px;
    }

    .product-card .wishlist-save-wrap .wishlist-save-btn i {
        font-size: 10px !important;
    }

    /* Keep the plain toast clear of the tab bar. */
    #wishlist-toast {
        bottom: calc(56px + 16px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wl-saved-bar,
    .wl-sheet-backdrop,
    .wl-sheet-panel {
        transition: none;
    }
}
