/**
 * Sarthi Fresh - Main Stylesheet
 */

:root {
    --primary-color: #059669;
    --secondary-color: #10b981;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --light-color: #f0fdf4;
    --dark-color: #1f2937;
    --gray-color: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #FFFFFF;
}

/* Auth Pages */
.auth-page {
    background: linear-gradient(135deg, var(--light-color) 0%, #FFFFFF 100%);
    min-height: 100vh;
}

.auth-card {
    background: #FFFFFF;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin: 1rem;
}

.auth-form-card {
    border: none;
    box-shadow: none;
}

.logo .brand-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.logo .brand-tagline {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 0;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #FFFFFF !important;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.navbar-brand img {
    border-radius: 50%;
    margin-right: 10px;
}

.navbar-brand .brand-name {
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    display: block;
    line-height: 1.2;
}

.navbar-brand .brand-tagline {
    color: white;
    font-size: 0.7rem;
    display: block;
    line-height: 1.2;
}

.navbar {
    background-color: var(--primary-color) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-light .navbar-nav .nav-link {
    color: #FFFFFF !important;
    font-weight: 500;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Form inputs and text areas */
.form-control {
    background-color: #FFFFFF;
    border-color: var(--border-color);
    color: var(--dark-color);
}

.form-control:focus {
    background-color: #FFFFFF;
    border-color: var(--primary-color);
    color: var(--dark-color);
}

.form-control::placeholder {
    color: var(--gray-color);
}

/* Cards with light text */
.card {
    background-color: #FFFFFF;
    color: var(--dark-color);
}

.card-title, .card-text {
    color: var(--dark-color);
}

/* Tables */
.table {
    color: var(--dark-color);
    background-color: #FFFFFF;
}

.table thead th {
    border-color: var(--border-color);
    color: var(--dark-color);
    background-color: var(--light-color);
    font-weight: 600;
}

.table tbody tr {
    border-color: var(--border-color);
    background-color: #FFFFFF;
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

.table td,
.table th {
    border-color: var(--border-color);
    vertical-align: middle;
}

/* Links */
a {
    color: var(--primary-color);
}

a:hover {
    color: var(--secondary-color);
}



/* Buttons with light text */
.btn {
    color: #FFFFFF;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-success {
    background-color: #25d366;
    border-color: #25d366;
}

.btn-success:hover {
    background-color: #128c7e;
    border-color: #128c7e;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #FFFFFF;
}

.btn-outline-success {
    color: #25d366;
    border-color: #25d366;
}

.btn-outline-success:hover {
    background-color: #25d366;
    color: #FFFFFF;
}

/* Modals */
.modal-content {
    background-color: #FFFFFF;
    color: var(--dark-color);
}

.modal-header {
    border-color: var(--border-color);
}

.modal-footer {
    border-color: var(--border-color);
}

/* Dropdowns */
.dropdown-menu {
    background-color: #FFFFFF;
    border-color: var(--border-color);
}

.dropdown-item {
    color: var(--dark-color);
}

.dropdown-item:hover {
    background-color: var(--primary-color);
    color: #FFFFFF;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-section h1,
.hero-section p {
    color: #FFFFFF;
}

.hero-section p span {
    color: #FFFFFF;
}

.hero-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    border-radius: 50px;
    padding: 1rem 1.5rem;
    border: none;
    box-shadow: var(--shadow-lg);
}

.search-btn {
    border-radius: 50px;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    font-weight: 600;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Product Cards */
.product-card {
    background: #FFFFFF;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--light-color);
    cursor: pointer;
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-15min {
    background-color: var(--secondary-color);
    color: white;
}

.badge-discount {
    background-color: var(--warning-color);
    color: white;
}

.badge-outofstock {
    background-color: var(--gray-color);
    color: white;
}

.product-info {
    padding: 1rem;
}

.product-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-name:hover {
    color: var(--primary-color);
}

.product-unit {
    font-size: 0.85rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: black;
}

.original-price {
    font-size: 0.9rem;
    color: var(--gray-color);
    text-decoration: line-through;
}

.discount-percent {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.add-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}

.add-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.add-btn:disabled {
    background-color: var(--gray-color);
    cursor: not-allowed;
    transform: none;
}

/* Categories */
.category-card {
    background: #FFFFFF;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
    padding: 1.5rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-name {
    font-weight: 600;
    color: black;
    font-size: 1.1rem;
}

/* Cart */
.cart-item {
    background: #FFFFFF;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background-color: var(--light-color);
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.25rem;
    background-color: #FFFFFF;
    color: var(--dark-color);
}

/* Checkout */
.order-summary {
    background: #FFFFFF;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.summary-label {
    color: var(--gray-color);
}

.summary-value {
    font-weight: 600;
}

.summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Order Status */
.order-timeline {
    position: relative;
    padding-left: 2rem;
}

.order-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: var(--border-color);
    border: 2px solid white;
}

.timeline-item.completed::before {
    background-color: var(--success-color);
}

.timeline-item.current::before {
    background-color: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
    }
}

/* Loading States */
.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Location Selector */
.location-selector {
    background: #FFFFFF;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.location-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.location-btn:hover {
    text-decoration: underline;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #FFFFFF;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-color);
    font-size: 0.75rem;
    padding: 0.5rem;
    transition: var(--transition);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* Responsive */
/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Mobile Navigation Improvements */
@media (max-width: 767px) {
    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        padding: 0.5rem;
    }

    .mobile-nav-icon {
        font-size: 1.25rem;
    }

    .mobile-nav-item span {
        font-size: 0.7rem;
    }
}

/* Safe Area Support for iPhone X+ */
@supports (padding: max(0px)) {
    .mobile-nav {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }
}

/* Large Devices (1200px to 1399px) */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
}

/* Medium Devices (992px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }

    .category-icon {
        font-size: 2.5rem;
    }

    .category-name {
        font-size: 1rem;
    }
}

/* Small Devices (768px to 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .search-container {
        max-width: 100%;
    }

    .search-input {
        padding: 0.75rem 1rem;
    }

    .search-btn {
        padding: 0.75rem 1.5rem;
    }

    .category-icon {
        font-size: 2rem;
    }

    .category-name {
        font-size: 0.9rem;
    }

    .product-image {
        height: 180px;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .current-price {
        font-size: 1.1rem;
    }

    .navbar-brand .brand-name {
        font-size: 1rem;
    }

    .navbar-brand .brand-tagline {
        font-size: 0.65rem;
    }

    .navbar-brand img {
        max-height: 35px;
    }
}

/* Extra Small Devices (576px to 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 1.8rem;
    }

    .hero-section p {
        font-size: 0.95rem;
    }

    .product-image {
        height: 150px;
    }

    .category-card {
        padding: 1rem;
    }

    .category-icon {
        font-size: 2rem;
    }

    .category-name {
        font-size: 0.9rem;
    }

    .auth-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }

    .logo .brand-name {
        font-size: 1.5rem;
    }

    .logo .brand-tagline {
        font-size: 0.8rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        font-size: 0.9rem;
    }

    .add-btn {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    /* Add padding to body to account for mobile nav */
    body {
        padding-bottom: 70px;
    }

    /* Improve touch targets */
    .mobile-nav-item {
        padding: 0.75rem 0.5rem;
    }

    .mobile-nav-icon {
        font-size: 1.25rem;
    }

    /* Better spacing for mobile */
    section {
        padding: 2rem 0;
    }

    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .mt-5 {
        margin-top: 2rem !important;
    }
}

/* Small Mobile Devices (480px and below) */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-section p {
        font-size: 0.9rem;
    }

    .product-image {
        height: 120px;
    }

    .category-icon {
        font-size: 1.5rem;
    }

    .category-name {
        font-size: 0.8rem;
    }

    .category-card {
        padding: 0.75rem;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-unit {
        font-size: 0.75rem;
    }

    .current-price {
        font-size: 1rem;
    }

    .original-price {
        font-size: 0.8rem;
    }

    .discount-percent {
        font-size: 0.75rem;
    }

    .add-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .auth-card {
        padding: 1rem;
        margin: 0.5rem;
    }

    .logo .brand-name {
        font-size: 1.3rem;
    }

    .logo .brand-tagline {
        font-size: 0.7rem;
    }

    .navbar-brand .brand-name {
        font-size: 0.9rem;
    }

    .navbar-brand .brand-tagline {
        font-size: 0.6rem;
    }

    .navbar-brand img {
        max-height: 30px;
    }

    /* Mobile navigation adjustments */
    .mobile-nav-icon {
        font-size: 1.1rem;
    }

    .mobile-nav-item {
        font-size: 0.7rem;
    }

    /* Card adjustments */
    .card {
        margin-bottom: 1rem;
    }

    /* Button adjustments */
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    /* Form adjustments */
    .form-control {
        font-size: 0.9rem;
    }

    /* Table responsive */
    .table-responsive {
        font-size: 0.85rem;
    }

    /* Container adjustments */
    .container-fluid {
        padding: 0 0.5rem;
    }

    /* Section spacing */
    section {
        padding: 1.5rem 0;
    }

    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    /* Touch-friendly improvements */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    a.btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Admin Panel Mobile Responsiveness */
@media (min-width: 992px) {
    /* Ensure sidebar is visible on desktop */
    .col-md-3.col-lg-2.admin-sidebar {
        display: block !important;
    }

    /* Hide mobile toggle on desktop */
    .navbar-toggler {
        display: none !important;
    }

    .admin-sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 991px) {
    /* Force hide the sidebar column on mobile regardless of Bootstrap classes */
    .col-md-3.col-lg-2.admin-sidebar {
        display: none !important;
        visibility: hidden !important;
    }

    /* Override display for mobile sidebar when it has the show class */
    .col-md-3.col-lg-2.admin-sidebar.show {
        display: block !important;
        visibility: visible !important;
    }

    /* Show mobile toggle button on mobile */
    .navbar-toggler {
        display: block !important;
        background: var(--primary-color) !important;
        border: 2px solid var(--primary-color) !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        transition: all 0.3s ease;
    }

    .navbar-toggler:hover {
        background: var(--secondary-color) !important;
        border-color: var(--secondary-color) !important;
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    }

    .navbar-toggler:active {
        transform: scale(0.95);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    }

    /* Mobile sidebar - completely outside document flow when mobile-sidebar class is present */
    #adminSidebar.mobile-sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        z-index: 1040 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        background: #F7FEE7;
        border-right: 1px solid var(--border-color);
        padding-top: 70px; /* Space for mobile menu toggle */
        padding-bottom: 20px; /* Extra padding at bottom */
        display: none; /* Hidden by default on mobile */
        margin: 0 !important; /* Remove any margin */
        max-width: none !important; /* Remove max-width */
        flex: none !important; /* Remove flex properties */
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    #adminSidebar.mobile-sidebar.show {
        left: 0 !important;
        display: block !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    /* Override inline styles */
    #adminSidebar.mobile-sidebar[style] {
        left: -280px !important;
        position: fixed !important;
        transition: left 0.3s ease !important;
    }

    #adminSidebar.mobile-sidebar.show[style] {
        left: 0 !important;
    }

    .admin-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .admin-sidebar-overlay.show {
        display: block !important;
    }

    .col-md-9.col-lg-10.admin-main-content {
        margin-left: 0 !important;
        padding: 1rem;
        padding-top: 80px; /* Increased space for mobile menu toggle */
    }

    .btn-close-mobile {
        background: rgba(0, 0, 0, 0.1) !important;
        border: none !important;
        color: var(--dark-color) !important;
        width: 32px !important;
        height: 32px !important;
        border-radius: 4px !important;
        display: none;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
    }

    .btn-close-mobile:hover {
        background: rgba(0, 0, 0, 0.2) !important;
        transform: rotate(90deg);
    }

    /* Show close button when sidebar is visible on mobile */
    #adminSidebar[style*="display: block"] .btn-close-mobile,
    #adminSidebar.show .btn-close-mobile {
        display: flex !important;
    }

    /* Ensure main content takes full width on mobile */
    .col-md-9.col-lg-10.admin-main-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Ensure container doesn't have unexpected spacing */
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Force mobile sidebar to be completely outside */
    body > .admin-sidebar.mobile-sidebar {
        position: fixed !important;
        left: -280px !important;
    }

    /* Ensure mobile sidebar nav links are visible */
    #adminSidebar.mobile-sidebar .nav {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        position: relative !important;
    }

    #adminSidebar.mobile-sidebar .nav-link {
        display: block !important;
        width: 100% !important;
        padding: 12px 20px !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        position: relative !important;
        z-index: 1 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure the header section doesn't interfere */
    #adminSidebar.mobile-sidebar > div:first-child {
        position: relative !important;
        z-index: 2 !important;
    }

    /* Ensure all direct children are visible */
    #adminSidebar.mobile-sidebar > * {
        visibility: visible !important;
        opacity: 1 !important;
    }
}



/* Store Panel Mobile Responsiveness - Same as Admin */
@media (max-width: 991px) {
    /* Force hide the sidebar column on mobile regardless of Bootstrap classes */
    .col-md-3.col-lg-2.admin-sidebar.store-sidebar {
        display: none !important;
        visibility: hidden !important;
    }

    /* Override display for mobile sidebar when it has the show class */
    .col-md-3.col-lg-2.admin-sidebar.store-sidebar.show {
        display: block !important;
        visibility: visible !important;
    }

    /* Store sidebar mobile styling */
    #storeSidebar.mobile-sidebar {
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        z-index: 1040 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        background: #F7FEE7;
        border-right: 1px solid var(--border-color);
        padding-top: 70px; /* Space for mobile menu toggle */
        padding-bottom: 20px; /* Extra padding at bottom */
        display: none; /* Hidden by default on mobile */
        margin: 0 !important; /* Remove any margin */
        max-width: none !important; /* Remove max-width */
        flex: none !important; /* Remove flex properties */
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

    #storeSidebar.mobile-sidebar.show {
        left: 0 !important;
        display: block !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    /* Override inline styles */
    #storeSidebar.mobile-sidebar[style] {
        left: -280px !important;
        position: fixed !important;
        transition: left 0.3s ease !important;
    }

    #storeSidebar.mobile-sidebar.show[style] {
        left: 0 !important;
    }

    .store-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .store-sidebar-overlay.show {
        display: block !important;
    }

    .store-main-content {
        margin-left: 0 !important;
        padding: 1rem;
        padding-top: 80px; /* Increased space for mobile menu toggle */
    }

    /* Ensure store sidebar nav links are visible */
    #storeSidebar.mobile-sidebar .nav {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        position: relative !important;
    }

    #storeSidebar.mobile-sidebar .nav-link {
        display: block !important;
        width: 100% !important;
        padding: 12px 20px !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        position: relative !important;
        z-index: 1 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure the header section doesn't interfere */
    #storeSidebar.mobile-sidebar > div:first-child {
        position: relative !important;
        z-index: 2 !important;
    }

    /* Ensure all direct children are visible */
    #storeSidebar.mobile-sidebar > * {
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (min-width: 992px) {
    .store-sidebar {
        position: relative;
        left: 0;
    }

    .store-sidebar-overlay {
        display: none !important;
    }
}

/* Enhanced Table Responsiveness */
@media (max-width: 767px) {
    .table-responsive {
        border: none;
    }

    .table-responsive table {
        font-size: 0.85rem;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.75rem;
        background: #FFFFFF;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        text-align: left;
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        margin-right: 1rem;
    }

    .table tbody td:last-child {
        border-bottom: none;
    }

    /* Admin table mobile improvements */
    .admin-main-content .table tbody tr {
        background: #FFFFFF;
        border: 1px solid var(--border-color);
    }

    .admin-main-content .table tbody td::before {
        color: var(--primary-color);
    }
}

/* Form Improvements for Mobile */
@media (max-width: 767px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 1rem;
    }

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .form-check-input {
        width: 1.2rem;
        height: 1.2rem;
    }

    .form-check-label {
        font-size: 0.9rem;
    }

    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header,
    .modal-footer {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }
}

/* Improved Touch Targets */
@media (max-width: 767px) {
    .btn,
    .nav-link,
    .dropdown-item,
    .mobile-nav-item {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn {
        padding: 0.75rem 1.5rem;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
    }

    .quantity-input {
        width: 60px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Card Improvements for Mobile */
@media (max-width: 767px) {
    .card {
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-text {
        font-size: 0.9rem;
    }
}

/* Search Bar Mobile Improvements */
@media (max-width: 767px) {
    .search-container {
        width: 100%;
        margin: 0.5rem 0;
    }

    .search-input {
        font-size: 16px;
        padding: 0.75rem 1rem;
    }

    .search-btn {
        padding: 0.75rem 1.25rem;
    }
}

/* Pagination Mobile */
@media (max-width: 767px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Status Badges Mobile */
@media (max-width: 767px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }
}

/* Cart Item Mobile */
@media (max-width: 767px) {
    .cart-item {
        padding: 0.75rem;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-info {
        flex: 1;
        margin-left: 0.75rem;
    }
}

/* Order Timeline Mobile */
@media (max-width: 767px) {
    .order-timeline {
        padding-left: 1.5rem;
    }

    .timeline-item {
        margin-bottom: 1rem;
    }

    .timeline-item::before {
        left: -1.25rem;
        width: 0.8rem;
        height: 0.8rem;
    }
}

/* Alert Mobile */
@media (max-width: 767px) {
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
}

/* Dropdown Mobile */
@media (max-width: 767px) {
    .dropdown-menu {
        width: 100%;
        border-radius: 0;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
}

/* Input Group Mobile */
@media (max-width: 767px) {
    .input-group {
        flex-wrap: nowrap;
    }

    .input-group-text {
        font-size: 0.9rem;
    }
}

/* Breadcrumb Mobile */
@media (max-width: 767px) {
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }

    .breadcrumb-item {
        padding: 0.25rem;
    }
}

/* List Group Mobile */
@media (max-width: 767px) {
    .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Progress Bar Mobile */
@media (max-width: 767px) {
    .progress {
        height: 0.5rem;
    }
}

/* Toast Mobile */
@media (max-width: 767px) {
    .toast {
        width: 100%;
        max-width: none;
        border-radius: 0;
    }
}

/* Accordion Mobile */
@media (max-width: 767px) {
    .accordion-button {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .accordion-body {
        padding: 1rem;
    }
}

/* Tabs Mobile */
@media (max-width: 767px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }

    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Tooltip Mobile - Disable on touch devices */
@media (hover: none) and (pointer: coarse) {
    [data-bs-toggle="tooltip"] {
        pointer-events: none;
    }
}

/* Loading Spinner Mobile */
@media (max-width: 767px) {
    .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Close Button Mobile */
@media (max-width: 767px) {
    .btn-close {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .mobile-nav,
    .footer,
    .btn,
    .add-btn {
        display: none !important;
    }

    body {
        background-color: #FFFFFF;
        color: var(--dark-color);
    }

    .card {
        border: 1px solid var(--border-color);
        box-shadow: none;
    }
}

/* Utility Classes */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #FFFFFF;
}

.btn-primary-custom:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #FFFFFF;
}

.card-custom {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.shadow-custom {
    box-shadow: var(--shadow);
}

.rounded-custom {
    border-radius: var(--border-radius);
}

/* Admin Sidebar */
.admin-sidebar {
    background: #F7FEE7;
    min-height: 100vh;
    color: var(--dark-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.admin-sidebar .nav-link {
    color: var(--dark-color);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: visible;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(22, 163, 74, 0.15);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.admin-sidebar .nav-link i {
    margin-right: 8px;
}

/* Admin Main Content */
.admin-main-content {
    min-height: 100vh;
    background-color: var(--light-color);
}

/* Admin Mobile Responsiveness Improvements */
@media (max-width: 991px) {
    .admin-main-content {
        padding-top: 70px; /* Space for mobile menu toggle */
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Store Sidebar */
.store-sidebar {
    background: #FFFFFF;
    min-height: 100vh;
    color: var(--dark-color);
}

.store-sidebar .nav-link {
    color: var(--dark-color);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.store-sidebar .nav-link:hover,
.store-sidebar .nav-link.active {
    background: rgba(22, 163, 74, 0.1);
    color: var(--primary-color);
}

/* Text colors for dark theme */
.text-muted {
    color: var(--gray-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

/* Stat icons */
.stat-icon {
    background-color: var(--primary-color);
    color: #FFFFFF;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.bg-success {
    background-color: var(--success-color);
}

.stat-icon.bg-warning {
    background-color: var(--warning-color);
}

.stat-icon.bg-danger {
    background-color: var(--danger-color);
}

/* List groups */
.list-group-item {
    background-color: #FFFFFF;
    color: var(--dark-color);
    border-color: var(--border-color);
}

/* Mobile Header and Footer Colors */
@media (max-width: 768px) {
    .navbar {
        background-color: #1a5c3a !important;
    }

    .navbar-light .navbar-brand {
        color: white !important;
    }

    .navbar-light .nav-link {
        color: white !important;
    }

    .navbar-light .nav-link:hover {
        color: #4ade80 !important;
    }
}

.list-group-item:hover {
    background-color: var(--light-color);
}

/* Badges */
.badge {
    color: #FFFFFF;
}

/* Alerts */
.alert {
    background-color: #FFFFFF;
    color: var(--dark-color);
    border-color: var(--border-color);
}

.alert-primary {
    background-color: rgba(22, 163, 74, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Pagination */
.page-link {
    background-color: #FFFFFF;
    color: var(--dark-color);
    border-color: var(--border-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #FFFFFF;
}

/* Progress bars */
.progress {
    background-color: var(--border-color);
}

/* Breadcrumbs */
.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--gray-color);
}

/* Section backgrounds */
section {
    background-color: #FFFFFF;
}

/* Text colors for headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--dark-color);
}

/* Container text */
.container {
    color: var(--dark-color);
}

/* Navbar brand image */
.navbar-brand img {
    max-height: 40px;
}

/* Small text */
small {
    color: var(--gray-color);
}

/* Paragraph text */
p {
    color: var(--dark-color);
}

/* Force green color override */
.text-success,
.text-success * {
    color: var(--success-color) !important;
}

.bg-success,
.bg-success * {
    background-color: var(--success-color) !important;
}

/* Check icons */
.bi-check-circle-fill.text-success {
    color: var(--success-color) !important;
}

/* Timeline success */
.timeline-item.completed::before {
    background-color: var(--success-color) !important;
}

/* Custom Toast Notification */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #FFFFFF;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    min-width: 300px;
    max-width: 400px;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.custom-toast.show {
    transform: translateX(0);
}

.custom-toast.slide-out {
    transform: translateX(120%);
}

.toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-color);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-right: 30px;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.toast-message {
    margin: 0;
    font-size: 0.95rem;
    color: var(--dark-color);
    line-height: 1.5;
}

/* Mobile responsive for toast */
@media (max-width: 767px) {
    .custom-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}
