/* ============================================
   MurliGanj Local Store - UI Restoration Fix
   Fixes all CSS, icon, layout, and asset issues
   ============================================ */

/* === BUTTON PREFLIGHT RESET === */
/* Reset unstyled buttons so browser-default buttonface grey/white background never appears, while preserving styled buttons */
button:not([class*="bg-"]):not([class*="btn"]):not([class*="badge"]),
[type='button']:not([class*="bg-"]):not([class*="btn"]):not([class*="badge"]),
[type='reset'],
[type='submit']:not([class*="bg-"]):not([class*="btn"]):not([class*="badge"]) {
    background-color: transparent;
    border: none;
    cursor: pointer;
}

/* === PRIMARY & THEME PALETTE RESTORATION === */
:root {
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #22c55e;
    --primary-600: #16a34a;
    --primary-700: #15803d;
    --primary-800: #166534;
    --primary-900: #14532d;
}

.bg-primary-50 { background-color: #f0fdf4 !important; }
.bg-primary-100 { background-color: #dcfce7 !important; }
.bg-primary-200 { background-color: #bbf7d0 !important; }
.bg-primary-500 { background-color: #22c55e !important; }
.bg-primary-600 { background-color: #16a34a !important; }
.bg-primary-700 { background-color: #15803d !important; }

.hover\:bg-primary-50:hover { background-color: #f0fdf4 !important; }
.hover\:bg-primary-100:hover { background-color: #dcfce7 !important; }
.hover\:bg-primary-700:hover { background-color: #15803d !important; }

.text-primary-50 { color: #f0fdf4 !important; }
.text-primary-600 { color: #16a34a !important; }
.text-primary-700 { color: #15803d !important; }

.border-primary-100 { border-color: #dcfce7 !important; }
.border-primary-200 { border-color: #bbf7d0 !important; }
.border-primary-500 { border-color: #22c55e !important; }
.border-primary-600 { border-color: #16a34a !important; }

/* === ICON FIXES === */
/* CRITICAL: Ensure Font Awesome font-family is never overridden */
.fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-light, .fa-brands,
[class^="fa-"], [class*=" fa-"] {
    font-family: var(--fa-style-family, "Font Awesome 6 Free") !important;
}
.fas, .fa-solid, [class^="fas"], [class*=" fas"] {
    font-weight: 900 !important;
}
.far, .fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}
.fab, .fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Ensure FA pseudo-elements are never hidden */
.fa::before, .fas::before, .far::before, .fab::before,
.fa-solid::before, .fa-regular::before, .fa-brands::before {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

/* Ensure Font Awesome renders everywhere */
.fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-brands {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 1 !important;
}

/* Fallback for Font Awesome Pro icons to Free equivalents */
.fa-sparkles::before {
    content: "\f005" !important; /* fa-star */
}

/* Fix icon sizing in all contexts */
.sidebar-link i,
.sidebar-link .fa,
.sidebar-link .fas,
.sidebar-link .far {
    width: 20px !important;
    text-align: center !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.sidebar-section-label i,
.sidebar-section-label .fa {
    margin-right: 6px;
}

/* Fix category icons */
.category-icon i,
.category-icon .fa,
.category-icon .fas {
    font-size: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Fix all icon containers */
[class*="bg-"] i,
[class*="bg-"] .fa,
[class*="bg-"] .fas {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* === WHITE TEXT ON WHITE/LIGHT BACKGROUND FIX === */
/* Force dark text on text elements inside light containers unless the element itself has an explicit dark/colored background */
:is(.bg-white, .bg-gray-50, .bg-slate-50, .bg-gray-100, .bg-slate-100, .bg-zinc-50, .bg-neutral-50) 
:is(p, span, h1, h2, h3, h4, h5, h6, div, label, td, th, a, li, small, strong, b).text-white:not([class*="bg-primary"]):not([class*="bg-emerald"]):not([class*="bg-green"]):not([class*="bg-blue"]):not([class*="bg-red"]):not([class*="bg-rose"]):not([class*="bg-indigo"]):not([class*="bg-purple"]):not([class*="bg-teal"]):not([class*="bg-orange"]):not([class*="bg-amber"]):not([class*="bg-slate-800"]):not([class*="bg-slate-900"]):not([class*="bg-slate-950"]):not([class*="bg-gray-800"]):not([class*="bg-gray-900"]):not([class*="bg-gray-950"]):not([class*="bg-black"]):not([class*="from-"]):not([class*="to-"]):not([class*="btn"]):not([class*="badge"]):not(.badge) {
    color: #0f172a !important;
}

/* Also ensure dark mode text overrides don't render white text on light backgrounds */
:is(.bg-white, .bg-gray-50, .bg-slate-50, .bg-gray-100, .bg-slate-100) 
:is(p, span, h1, h2, h3, h4, h5, h6, div, label, td, th, a, li, small, strong, b)[class*="dark:text-white"]:not([class*="bg-primary"]):not([class*="bg-emerald"]):not([class*="bg-green"]):not([class*="bg-blue"]):not([class*="bg-red"]):not([class*="bg-rose"]):not([class*="bg-indigo"]):not([class*="bg-purple"]):not([class*="bg-teal"]):not([class*="bg-orange"]):not([class*="bg-slate-800"]):not([class*="bg-slate-900"]):not([class*="bg-slate-950"]):not([class*="bg-black"]):not([class*="from-"]):not([class*="to-"]):not([class*="btn"]):not([class*="badge"]) {
    color: #0f172a !important;
}

/* Ensure solid colored buttons, badges, and gradients keep crisp white text; NEVER pastel/tinted elements */
.btn-primary, .btn-success, .btn-danger, .badge-primary, .badge-success,
button.bg-primary-600, button.bg-primary-700, button.bg-green-600, button.bg-green-700,
button.bg-blue-600, button.bg-red-600, button.bg-rose-600,
a.bg-primary-600, a.bg-primary-700, a.bg-green-600, a.bg-green-700,
div[class*="from-"], div[class*="to-"], a[class*="from-"], a[class*="to-"] {
    color: #ffffff !important;
}
button[class*="bg-"]:not(.bg-white):not(.bg-gray-50):not(.bg-slate-50) .text-white,
a[class*="bg-"]:not(.bg-white):not(.bg-gray-50):not(.bg-slate-50) .text-white,
span[class*="bg-"]:not(.bg-white):not(.bg-gray-50):not(.bg-slate-50) .text-white {
    color: #ffffff !important;
}

/* Light text on dark backgrounds */
.bg-gray-800 .text-gray-900,
.bg-gray-900 .text-gray-900,
.bg-gray-950 .text-gray-900,
.bg-gray-800 .text-black,
.bg-gray-900 .text-black,
.bg-gray-950 .text-black,
.bg-dark .text-gray-900,
.bg-dark .text-black {
    color: #f3f4f6 !important;
}

/* Fix footer text visibility */
footer .text-gray-400,
footer .text-gray-500,
footer .text-gray-600 {
    color: #9ca3af !important;
}

footer a.text-gray-500:hover {
    color: #4ade80 !important;
}

footer .text-white {
    color: #fff !important;
}

/* Selection highlight fix: ensure text is always high contrast when selected */
::selection {
    background-color: #22c55e !important;
    color: #ffffff !important;
}
::-moz-selection {
    background-color: #22c55e !important;
    color: #ffffff !important;
}
/* === SPACING & PADDING FIXES === */
/* Ensure consistent card spacing */
.product-card {
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Fix card body overflow */
.product-card .p-3 {
    padding: 0.75rem;
}

/* Fix ADD button alignment */
.product-card button,
.product-card .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* === TEXT ALIGNMENT FIXES === */
/* Ensure consistent text alignment */
.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

/* Fix truncation */
.truncate,
.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* === ADMIN PANEL FIXES === */
/* Admin sidebar icons - ensure visibility */
.admin-sidebar .sidebar-link i {
    width: 20px !important;
    text-align: center !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #CBD5E1 !important;
}

/* Only override color for active/hover if no inline style is set */
.admin-sidebar .sidebar-link i[style*="color"] {
    /* Preserve inline colors set on specific icons */
}

.admin-sidebar .sidebar-link.active i:not([style*="color"]) {
    color: #34d399 !important;
}

.admin-sidebar .sidebar-link:hover i:not([style*="color"]) {
    color: #ffffff !important;
}

/* Admin stat cards */
.admin-content .rounded-xl.border.border-gray-100 {
    background: #fff !important;
}

/* Admin dashboard card text */
.admin-content .text-gray-900 {
    color: #111827 !important;
}

.admin-content .text-gray-500 {
    color: #6b7280 !important;
}

/* Admin tables */
.admin-content .table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.admin-content .table-wrap th,
.admin-content table th {
    background: #f1f5f9;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155 !important;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #cbd5e1;
}

.admin-content .table-wrap td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.875rem;
}

.admin-content .table-wrap tr:hover td {
    background: #f9fafb;
}

/* Admin form elements */
.admin-content .form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out;
}

.admin-content .form-control:focus {
    border-color: #22c55e;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.admin-content .form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.admin-content .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-content .btn-primary:hover {
    background: #15803d;
}

.admin-content .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #6b7280;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-content .btn-secondary:hover {
    background: #4b5563;
}

.admin-content .btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-content .btn-danger:hover {
    background: #dc2626;
}

/* Admin page titles */
.admin-content h1,
.admin-content h2,
.admin-content h3 {
    color: #111827 !important;
}

.admin-content .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
}

/* Admin card styling */
.admin-content .card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.admin-content .card-header {
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #111827;
}

.admin-content .card-body {
    padding: 1.25rem;
}

/* === IMAGE FIXES === */
/* Ensure images don't break layout */
img {
    max-width: 100%;
    height: auto;
}

img[src=""],
img:not([src]) {
    opacity: 0;
}

/* Category icon images */
.category-icon img,
.w-16 img,
.w-20 img,
.w-24 img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* === FOOTER FIXES === */
footer .gradient-primary {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
}

footer .social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

footer ul li a i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
}

/* === CATEGORY SECTION FIXES === */
.category-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.category-grid-item .icon-wrapper {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.category-grid-item:hover .icon-wrapper {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
    .category-grid-item .icon-wrapper {
        width: 5rem;
        height: 5rem;
    }
}

/* === PRODUCT CARD FIXES === */
.product-card .aspect-square {
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f9fafb;
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* === NAVIGATION FIXES === */
/* Desktop nav active states */
.nav-active {
    color: #16a34a !important;
    font-weight: 600 !important;
}

/* Mobile bottom nav */
.fixed.bottom-0.left-0.right-0.bg-white {
    z-index: 30 !important;
}

/* === RESPONSIVE FIXES === */
@media (max-width: 640px) {
    .product-card .text-sm {
        font-size: 0.8125rem;
    }
    
    .category-grid-item .icon-wrapper {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .category-grid-item .icon-wrapper i {
        font-size: 1.25rem !important;
    }
}

/* === MISSING UTILITY CLASSES === */
.object-cover { object-fit: cover !important; }
.object-contain { object-fit: contain !important; }
.object-fill { object-fit: fill !important; }
.aspect-square { aspect-ratio: 1/1 !important; }
.aspect-video { aspect-ratio: 16/9 !important; }

/* Gap utilities not in framework */
.gap-x-2 { column-gap: 0.5rem; }
.gap-y-2 { row-gap: 0.5rem; }
.gap-x-3 { column-gap: 0.75rem; }
.gap-y-3 { row-gap: 0.75rem; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }
.opacity-100 { opacity: 1; }

/* Additional responsive */
@media (min-width: 640px) {
    .sm\:gap-2 { gap: 0.5rem; }
    .sm\:gap-3 { gap: 0.75rem; }
    .sm\:gap-4 { gap: 1rem; }
    .sm\:gap-6 { gap: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:gap-3 { gap: 0.75rem; }
    .md\:gap-4 { gap: 1rem; }
    .md\:gap-6 { gap: 1.5rem; }
}

/* === CARD GLASS EFFECT === */
.glass-card {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* === GRADIENT FIX === */
.gradient-primary {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
}

.gradient-accent {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
}

/* === STORE CARD FIXES === */
.store-card {
    transition: all 0.3s ease;
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

/* === BANNER FIXES === */
.banner-container {
    width: 100%;
    overflow: hidden;
}

.banner-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* === CHAT BOT WIDGET FIX === */
#mls-chat-widget .chat-fab {
    z-index: 9990 !important;
    pointer-events: auto !important;
}

#mls-chat-widget .chat-panel {
    z-index: 9989 !important;
}

/* === WHATSAPP BUTTON FIX === */
#whatsapp-float-btn {
    z-index: 95 !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 1023px) {
    #whatsapp-float-btn {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (min-width: 1024px) {
    #whatsapp-float-btn {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* === FLOATING CART BAR FIX === */
#floating-cart-bar {
    transition: transform 0.3s ease-out;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

#floating-cart-bar.translate-y-0 {
    transform: translateY(0);
}

#floating-cart-bar.translate-y-full {
    transform: translateY(100%);
}

/* === MOBILE BOTTOM NAV SAFE AREA === */
@media (max-width: 1023px) {
    nav.lg\:hidden.fixed.bottom-0 {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* === CHATBOT SAFE AREA === */
@media (max-width: 1023px) {
    #mls-chat-widget .chat-fab {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* === RIDER LAYOUT FIX === */
body:has(.rider-layout) {
    background: #f9fafb;
}

/* === SUPPORT/HELPDESK FIXES === */
.support-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* === AUTH PAGES FIX === */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 28rem;
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* === SECTION HEADER FIXES === */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

/* === BADGE FIXES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-green {
    background: #dcfce7;
    color: #15803d;
}

.badge-red {
    background: #fee2e2;
    color: #dc2626;
}

.badge-yellow {
    background: #fef9c3;
    color: #a16207;
}

.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

/* === RESPONSIVE GRID FIXES === */
.grid-responsive {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)) !important;
    gap: 1rem !important;
}

/* === TOAST FIX === */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

/* === CART FLOATING BAR FIX === */
#floating-cart-bar {
    transition: transform 0.3s ease-out;
}

#floating-cart-bar.translate-y-0 {
    transform: translateY(0);
}

/* === CONTAINER FIX === */
.max-w-7xl {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
}

/* === FLEX HELPERS NOT IN FRAMEWORK === */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row !important; }
    .sm\:flex-col { flex-direction: column !important; }
}

@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row !important; }
    .md\:flex-col { flex-direction: column !important; }
}

/* === GAS BOOKING FIXES === */
.gas-booking-card {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fed7aa;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

/* === CUSTOMER SECTION FIX === */
/* Fix the "What's on your mind" horizontal scroll */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* === ANIMATION FIXES === */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
    animation: slideUp 0.3s ease-out forwards;
}

/* === IMPORTANT NOTICE POPUP FIX === */
.important-notice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* === SEARCH PAGE FIXES === */
.search-result-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #f3f4f6;
    transition: all 0.2s;
}

.search-result-card:hover {
    border-color: #bbf7d0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* === COMPLAINT PAGE FIXES === */
.complaint-card {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s;
}

.complaint-card:hover {
    border-color: #fde68a;
}

/* === ORDER STATUS COLORS === */
.text-pending { color: #f59e0b; }
.text-confirmed { color: #3b82f6; }
.text-preparing { color: #8b5cf6; }
.text-out-for-delivery { color: #f97316; }
.text-delivered { color: #22c55e; }
.text-cancelled { color: #ef4444; }

.bg-pending { background: #fef3c7; }
.bg-confirmed { background: #dbeafe; }
.bg-preparing { background: #ede9fe; }
.bg-out-for-delivery { background: #ffedd5; }
.bg-delivered { background: #dcfce7; }
.bg-cancelled { background: #fee2e2; }

/* === MOBILE SAFE AREA & FLOATING ELEMENT FIXES === */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .safe-area-pb {
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    }
}

/* Prevent floating elements from overlapping on mobile */
@media (max-width: 1023px) {
    /* Bottom nav spacing */
    nav.lg\:hidden.fixed.bottom-0 {
        padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
    }
    
    /* Floating cart bar above bottom nav */
    #floating-cart-bar {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    /* WhatsApp above bottom nav */
    #whatsapp-float-btn {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    /* Chatbot FAB above bottom nav */
    #mls-chat-widget .chat-fab {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Desktop spacing */
@media (min-width: 1024px) {
    #whatsapp-float-btn {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Touch-friendly tap targets on mobile */
@media (max-width: 768px) {
    button, a[role="button"], .cursor-pointer {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Location button touch target */
    #location-btn-mobile {
        min-height: 44px;
    }
    
    /* Bottom nav items */
    nav.lg\:hidden.fixed.bottom-0 a {
        min-height: 44px;
    }
}

/* Prevent horizontal scroll from floating elements */
body {
    overflow-x: hidden;
}

/* Ensure floating elements don't cause horizontal scroll */
#whatsapp-float-btn,
#floating-cart-bar,
#mls-chat-widget {
    max-width: calc(100vw - 16px);
}

/* Fix for iOS Safari bottom bar overlap */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 1023px) {
        #whatsapp-float-btn {
            bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
        }
        
        #floating-cart-bar {
            padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        }
    }
}



/* === HIGH CONTRAST UNIVERSAL ACCESSIBILITY ENHANCEMENTS (100% VISIBILITY) === */

/* 1. Muted Text Boost on Light Backgrounds (Eliminates Faint / Low-Contrast Text) */
body:not(.dark) .text-gray-400:not(footer *):not([class*="bg-gray-800"] *):not([class*="bg-gray-900"] *):not([class*="bg-slate-900"] *):not([class*="bg-dark"] *),
body:not(.dark) .text-slate-400:not(footer *):not([class*="bg-gray-800"] *):not([class*="bg-gray-900"] *):not([class*="bg-slate-900"] *):not([class*="bg-dark"] *),
body:not(.dark) .text-zinc-400:not(footer *):not([class*="bg-gray-800"] *):not([class*="bg-gray-900"] *):not([class*="bg-slate-900"] *):not([class*="bg-dark"] *) {
    color: #4b5563 !important; /* gray-600: 5.74:1 contrast on white */
    font-weight: 500;
}

body:not(.dark) .text-gray-500:not(footer *):not([class*="bg-gray-800"] *):not([class*="bg-gray-900"] *):not([class*="bg-slate-900"] *):not([class*="bg-dark"] *),
body:not(.dark) .text-slate-500:not(footer *):not([class*="bg-gray-800"] *):not([class*="bg-gray-900"] *):not([class*="bg-slate-900"] *):not([class*="bg-dark"] *) {
    color: #374151 !important; /* gray-700: 9.0:1 contrast on white */
    font-weight: 500;
}

/* 2. Stat Cards and Metric Labels Across All Portals (Vendor, Rider, Provider, Admin) */
.grid p.text-xs:not([class*="text-white"]):not([class*="rounded-full"]),
.grid span.text-xs:not([class*="text-white"]):not([class*="rounded-full"]),
.grid div.text-xs:not([class*="text-white"]):not([class*="rounded-full"]) {
    color: #374151 !important; /* gray-700 */
    font-weight: 600 !important;
}

.grid p.text-xl, .grid p.text-2xl, .grid p.text-3xl,
.grid span.text-xl, .grid span.text-2xl, .grid span.text-3xl {
    color: #111827 !important; /* gray-900 */
    font-weight: 800 !important;
}

/* 3. Pastel Badges & Status Pills (Always Saturated Bold Contrast) */
span[class*="bg-green-50"], span[class*="bg-green-100"],
div[class*="bg-green-50"] > span, div[class*="bg-green-100"] > span {
    color: #14532d !important; /* green-900 */
    font-weight: 700 !important;
}

span[class*="bg-blue-50"], span[class*="bg-blue-100"],
div[class*="bg-blue-50"] > span, div[class*="bg-blue-100"] > span {
    color: #1e40af !important; /* blue-800 */
    font-weight: 700 !important;
}

span[class*="bg-amber-50"], span[class*="bg-amber-100"],
span[class*="bg-yellow-50"], span[class*="bg-yellow-100"],
span[class*="bg-orange-50"], span[class*="bg-orange-100"],
div[class*="bg-amber-50"] > span, div[class*="bg-amber-100"] > span,
div[class*="bg-yellow-50"] > span, div[class*="bg-yellow-100"] > span,
div[class*="bg-orange-50"] > span, div[class*="bg-orange-100"] > span {
    color: #92400e !important; /* amber-800 */
    font-weight: 700 !important;
}

span[class*="bg-red-50"], span[class*="bg-red-100"],
span[class*="bg-rose-50"], span[class*="bg-rose-100"],
div[class*="bg-red-50"] > span, div[class*="bg-red-100"] > span {
    color: #991b1b !important; /* red-800 */
    font-weight: 700 !important;
}

span[class*="bg-purple-50"], span[class*="bg-purple-100"],
div[class*="bg-purple-50"] > span, div[class*="bg-purple-100"] > span {
    color: #6b21a8 !important; /* purple-800 */
    font-weight: 700 !important;
}

span[class*="bg-teal-50"], span[class*="bg-teal-100"],
div[class*="bg-teal-50"] > span, div[class*="bg-teal-100"] > span {
    color: #115e59 !important; /* teal-800 */
    font-weight: 700 !important;
}

span[class*="bg-indigo-50"], span[class*="bg-indigo-100"],
div[class*="bg-indigo-50"] > span, div[class*="bg-indigo-100"] > span {
    color: #3730a3 !important; /* indigo-800 */
    font-weight: 700 !important;
}

span[class*="bg-emerald-50"], span[class*="bg-emerald-100"],
div[class*="bg-emerald-50"] > span, div[class*="bg-emerald-100"] > span {
    color: #065f46 !important; /* emerald-800 */
    font-weight: 700 !important;
}

/* 4. Sidebar Navigation Links (Crisp and Legible at Rest) */
aside a:not([class*="bg-primary"]):not([class*="bg-green"]):not([class*="active"]) {
    color: #475569 !important; /* slate-600 */
    font-weight: 500;
}
aside a:not([class*="bg-primary"]):not([class*="bg-green"]):not([class*="active"]):hover {
    color: #0f172a !important; /* slate-900 */
    background-color: #f8fafc !important;
}
aside a:not([class*="bg-primary"]):not([class*="bg-green"]):not([class*="active"]) i {
    color: #64748b !important;
}
aside a:not([class*="bg-primary"]):not([class*="bg-green"]):not([class*="active"]):hover i {
    color: #16a34a !important;
}

/* 5. Table Headers and Cells Across All Portals */
table th, .table-wrap th {
    color: #1e293b !important; /* slate-800 */
    font-weight: 700 !important;
}
table td, .table-wrap td {
    color: #1f2937 !important; /* gray-800 */
}
table td .text-xs, table td .text-sm {
    color: #4b5563 !important; /* gray-600 */
    font-weight: 500;
}

/* 6. Form Labels and Helper Text */
label:not([class*="text-white"]), .form-label:not([class*="text-white"]) {
    color: #1f2937 !important; /* gray-800 */
    font-weight: 600 !important;
}
input::placeholder, textarea::placeholder {
    color: #6b7280 !important; /* gray-500 */
    opacity: 1 !important;
}

/* ==========================================================================
   7. RESTAURANT PAGES & DOORSTEP SERVICES HIGH-CONTRAST VISIBILITY RULES
   ========================================================================== */

/* Doorstep service cards and icons */
.doorstep-service-card {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    transition: all 0.2s ease-in-out;
}
.doorstep-service-card:hover {
    border-color: #14b8a6 !important;
    box-shadow: 0 4px 12px -2px rgba(20, 184, 166, 0.15) !important;
}

/* Restaurant and food card solid borders & resting contrast */
.restaurant-card,
.food-card {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Eliminate faint/washed-out text on restaurant pages */
.restaurant-card .text-gray-500,
.food-card .text-gray-500,
.restaurant-meta-text {
    color: #475569 !important; /* slate-600 */
    font-weight: 500 !important;
}

.restaurant-card .text-gray-400,
.food-card .text-gray-400 {
    color: #64748b !important; /* slate-500 */
    font-weight: 500 !important;
}

/* Food items veg/non-veg tags - always solid, never transparent */
.veg-tag,
.non-veg-tag {
    background-color: #ffffff !important;
    opacity: 1 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Restaurant hero banner - vivid and bright, no dark washing */
.restaurant-hero-banner img {
    opacity: 1 !important;
    filter: none !important;
}

/* Food category chips */
.food-category-chip {
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #1e293b !important;
    font-weight: 600 !important;
}
.food-category-chip:hover {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border-color: #6ee7b7 !important;
}

