/* Mobile-specific CSS */
:root {
    --mobile-menu-text-size: 1.25rem;
    --mobile-menu-icon-size: 1.25rem;
}

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

.d-lg-none .btn-sm,
.d-lg-none .dropdown-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-width: 44px;
    min-height: 44px;
    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: 991.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: 1.25rem 1rem 1rem 1rem !important;
        min-height: 50px !important;
        height: auto !important;
        position: relative !important;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !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.75rem 1rem !important;
        border-top: 1px solid #dee2e6 !important;
        min-height: auto !important;
        height: auto !important;
        border-bottom: none !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;
    }
}

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

/* Mobile profile dropdown styling */
.mobile-profile-dropdown {
    min-width: 180px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    font-size: 1.3rem;
}

.mobile-profile-dropdown .dropdown-item {
    padding: 1.4rem 1.7rem;
    color: #333;
    transition: all 0.2s ease;
    font-size: 1.3rem;
    min-height: 68px;
    display: flex;
    align-items: center;
}

.mobile-profile-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.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.5rem 0;
    border-color: #e9ecef;
}

.mobile-profile-dropdown .dropdown-item i {
    width: 26px;
    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;
}

.mobile-profile-toggle:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

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


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

/* 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;
}

.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: #e9ecef;
    color: #000;
}

.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 #e9ecef;
    padding-top: 1rem;
}

.mobile-logout-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.mobile-logout-link {
    color: #dc3545 !important;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.mobile-logout-link:hover {
    background-color: #dc3545;
    color: white !important;
    text-decoration: none;
}

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

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

.mobile-logout-link[href*="my-login"]:hover {
    background-color: #28a745;
    color: white !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: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Mobile Sidebar - Slide up from bottom */
.mobile-sidebar {
    position: fixed;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    z-index: 1050;
    transition: top 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
}

.mobile-sidebar.show {
    top: 0;
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #dee2e6;
    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-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: #e9ecef;
    color: #000;
}

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

.mobile-sidebar-nav .nav-link {
    color: #495057;
    padding: 1.2rem 1.4rem;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    font-weight: 400;
    font-size: var(--mobile-menu-text-size);
    text-decoration: none;
    min-height: 64px;
}

.mobile-sidebar-nav .nav-link:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(17, 24, 39, 0.08);
    color: #000;
    text-decoration: none;
}

.mobile-sidebar-nav .nav-link.active {
    background-color: #f8f9fa;
    color: #0d6efd;
    font-weight: 600;
}

.mobile-sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background-color: #0d6efd;
    border-radius: 3px;
}

.mobile-sidebar-nav .nav-icon {
    width: 26px;
    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.35;
    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: #dee2e6;
    border-width: 1px;
}

.mobile-sidebar-footer {
    padding: 12px;
    border-top: 1px solid #e9ecef;
    background-color: #ffffff;
    display: none; /* Hide footer - close button is in header */
}

/* Mobile Categories Page */
.mobile-categories-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: white;
    z-index: 1050;
    display: none;
    animation: slideInUp 0.3s ease;
}

.mobile-categories-page.show {
    display: block;
}

/* Mobile Categories Header */
.mobile-categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    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: #e9ecef;
    color: #000;
}

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

.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: #e9ecef;
    color: #000;
}

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

/* Mobile Categories Content */
.mobile-categories-content {
    height: calc(100vh - 70px); /* Subtract header height */
    overflow-y: auto;
}

/* 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-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;
    width: 100%;
    font-size: var(--mobile-menu-text-size);
}

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

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

#mobileAccountPage .mobile-category-item:hover {
    background-color: #f8f9fa;
}

#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 #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 44px;
}

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

.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: #e9ecef;
    color: #000;
}

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

/* 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: #f8f9fa;
    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: white;
    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: white;
    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: white;
    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 .flex-grow-1 .btn {
    padding: 0.625rem 0.75rem;
    min-height: 44px;
    font-size: 0.875rem;
}

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

/* Mobile filter sections */
.mobile-filter-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: white;
    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: white;
    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;
}
