/* Starter CSS for Market Window */
body {
    font-family: Arial, sans-serif;
    margin: 3px;
}

.text-mw {
    color: #5814a7;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-mw {
    background: linear-gradient(120deg, #5814a7, #1f34f3);
    /* Purplish blue mix background*/
}


:root {
    --primary-purple: #6B46C1;
    --secondary-mauve: #9333EA;
    --accent-blue: #3B82F6;
    --dark-purple: #4C1D95;
    --light-mauve: #E9D5FF;
    --gradient-primary: linear-gradient(135deg, #6B46C1 0%, #9333EA 50%, #3B82F6 100%);
    --border-light: #e5e7eb;
    --text-muted: #6b7280;
    --text-dark: #374151;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    padding: 0;
}

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

/* ===== TOP NAVBAR (Fixed) ===== */
.navbar-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1030;
    border-bottom: 1px solid var(--border-light);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.navbar-brand:hover {
    opacity: 0.9;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-purple) !important;
}

.nav-link.active {
    color: var(--primary-purple) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 50%, #2563EB 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(107, 70, 193, 0.3);
    color: white;
}

.btn-outline-primary {
    color: var(--primary-purple);
    border-color: var(--primary-purple);
    font-weight: 600;
}

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

/* User Avatar in Navbar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.dropdown-menu {
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--light-mauve);
    color: var(--primary-purple);
}

/* ===== SIDEBAR NAVIGATION (Desktop) ===== */
.sidebar-nav {
    position: fixed;
    top: 76px;
    left: 0;
    width: 250px;
    height: calc(100vh - 76px);
    background: white;
    border-right: 1px solid var(--border-light);
    padding: 1rem 0;
    overflow-y: auto;
    z-index: 1020;
    display: none;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #f3f4f6;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 3px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    background-color: var(--light-mauve);
    color: var(--primary-purple);
    border-left-color: var(--primary-purple);
}

.sidebar-nav-item.active {
    background-color: var(--light-mauve);
    color: var(--primary-purple);
    border-left-color: var(--primary-purple);
}

.sidebar-nav-item i {
    margin-right: 0.875rem;
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

/* ===== BOTTOM NAVIGATION (Mobile) ===== */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 0.9rem);
    width: min(93vw, 560px);
    padding: 0.45rem;
    z-index: 1040;
    display: none;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.3rem;
    border: 1px solid rgba(107, 70, 193, 0.16);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(107, 70, 193, 0.18), rgba(59, 130, 246, 0.12) 52%, rgba(147, 51, 234, 0.16)),
        rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    box-shadow:
        0 18px 40px rgba(27, 31, 55, 0.18),
        0 2px 6px rgba(59, 130, 246, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    overflow: visible;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bottom-nav.is-hidden {
    transform: translate(-50%, calc(100% + 2rem));
    opacity: 0;
    pointer-events: none;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 58px;
    padding: 0.55rem 0.35rem 0.5rem;
    color: rgba(55, 65, 81, 0.8);
    text-decoration: none;
    transition:
        transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
        color 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease;
    flex: 1;
    font-weight: 600;
    position: relative;
    border-radius: 999px;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overflow: visible;
}
.bottom-nav-item:hover {
    color: #7c50f4;
    border: 1px solid #7f4afa29;
}

.bottom-nav-item.active {
    color: #fdfee8;
    border: 1px solid #7f4afa29;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    inset: 0.05rem;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        #6b46c1ad,
        #0b34ffd2,
        #9233eace,
        #6b46c1ad,
        #0b34ffd2
    );
    background-size: 300% 300%;
    box-shadow:
        0 10px 24px rgba(59, 130, 246, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: -1;
    animation:
        mwBottomNavActivePop 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
        mwBottomNavGradientFlow 14s ease infinite;
}

.bottom-nav-item i {
    font-size: 1.18rem;
    line-height: 1;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bottom-nav-item span {
    font-size: 0.67rem;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease;
}

.bottom-nav-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.bottom-nav-item.active {
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(59, 130, 246, 0.16);
}

.bottom-nav-item.active i {
    transform: translateY(-1px) scale(1.03);
}

.bottom-nav-item.active span {
    opacity: 0.98;
}

.bottom-nav-item:active {
    transform: translateY(0) scale(0.98);
}

/* ===== BOTTOM NAV "ME" DROPUP ===== */
/* Wrapper takes same flex space as sibling nav items */
.bottom-nav-me {
    flex: 1;
    display: flex;
    position: relative;
    overflow: visible;
}

/* Reset <button> defaults so it looks identical to <a> nav items */
.bottom-nav-btn {
    background: none;
    border: none;
    padding: 0;
    flex: 1;
    cursor: pointer;
    width: 100%;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-btn:focus {
    outline: none;
}

.bottom-nav-btn:focus-visible {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== MAIN CONTENT AREA ===== */
.main-content {
    margin-top: 76px;
    min-height: calc(100vh - 76px);
    transition: margin-left 0.3s ease;
}

.main-content.with-sidebar {
    margin-left: 250px;
}

.main-content.with-bottom-nav {
    padding-bottom: 112px;
}

body.mw-page-transitioning {
    overflow-x: hidden;
}

body.mw-page-transitioning::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2000;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.16), transparent 42%),
        linear-gradient(135deg, rgba(107, 70, 193, 0.08), rgba(59, 130, 246, 0.06) 50%, rgba(147, 51, 234, 0.08));
    opacity: 1;
    transition: opacity 0.2s ease;
}

body.mw-page-transitioning .navbar-top,
body.mw-page-transitioning .sidebar-nav,
body.mw-page-transitioning .main-content,
body.mw-page-transitioning .bottom-nav {
    transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
    opacity: 0.96;
    transform: translateY(2px);
    filter: saturate(0.98);
}

@keyframes mwBottomNavActivePop {
    from {
        transform: scale(0.94);
        opacity: 0.78;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes mwBottomNavGradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-section {
    background: var(--gradient-primary);
    color: white;
    position: relative;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.95;
    line-height: 1.6;
}

/* ===== CATEGORY SCROLL ===== */
.category-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) #f3f4f6;
    padding-bottom: 0.5rem;
}

.category-scroll::-webkit-scrollbar {
    height: 6px;
}

.category-scroll::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.category-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 3px;
}

.category-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-mauve);
}

/* ===== HOME CATEGORY PILLS ===== */
.category-pill-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    height: auto;
    overflow: visible;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) #f3f4f6;
}

.category-pill-scroll::-webkit-scrollbar {
    height: 6px;
}

.category-pill-scroll::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.category-pill-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 3px;
}

.category-pill {
    background-color: white;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-bottom: 0.5rem;
}

.category-pill:hover {
    border-color: var(--primary-purple);
    background-color: var(--light-mauve);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(107, 70, 193, 0.1) !important;
}

/* ===== SHOP DETAIL CATEGORY PILLS ===== */
.shop-category-scroll {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.45rem;
    height: 105px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.4rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) #f3f4f6;
}

.shop-category-scroll::-webkit-scrollbar {
    height: 4px;
}

.shop-category-scroll::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 2px;
}

.shop-category-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 2px;
}

.shop-category-pill {
    background-color: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.shop-category-pill:hover {
    background-color: var(--primary-purple);
    color: #fff;
    border-color: var(--primary-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(107, 70, 193, 0.25);
}

/* ===== PRODUCT CARDS ===== */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(107, 70, 193, 0.15);
    border-color: var(--primary-purple);
}

.product-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f3f4f6;
}

.product-card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-dark);
}

.product-card-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.product-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.product-card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.product-card-btn {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ===== CARD MASONRY LAYOUT ===== */
.card-masonry,
.market-grid {
    column-width: 150px;
    column-gap: 0.65rem;
    column-fill: balance;
    width: 100%;
}

.card-masonry-products,
.market-grid-products {
    column-width: 145px;
    column-gap: 0.65rem;
}

.card-masonry-shops,
.market-grid-shops {
    column-width: 165px;
    column-gap: 0.75rem;
}

/* Each infinite-scroll batch owns its masonry layout. The outer shops list
   stays a normal block so adding a section cannot rebalance earlier sections. */
.shops-list {
    width: 100%;
    max-width: 100%;
}

.shops-masonry-section {
    width: 100%;
    max-width: 100%;
}

.products-list {
    width: 100%;
    max-width: 100%;
}

.mw-masonry-section {
    width: 100%;
    max-width: 100%;
}

/* Mobile: ensure at least 2 columns across phones */
@media (max-width: 575.98px) {
    .card-masonry,
    .market-grid {
        column-count: 2;
        column-gap: 0.5rem;
    }

    .card-masonry-item,
    .market-grid-item {
        margin-bottom: 0.5rem;
    }
}

.card-masonry-item,
.market-grid-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 0.65rem;
    vertical-align: top;
    min-width: 0;
}

.card-masonry-item > a,
.market-grid-item > a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.card-masonry-full,
.market-grid-full,
.card-masonry > .text-center,
.market-grid > .text-center {
    column-span: all;
    width: 100%;
    display: block;
    margin-bottom: 1rem;
}

/* Ensure cards maintain their natural content height without artificial stretching */
.card-masonry .card,
.card-masonry .product-card,
.card-masonry .shop-card,
.card-masonry .wishlist-card,
.market-grid .card,
.market-grid .product-card,
.market-grid .shop-card,
.market-grid .wishlist-card {
    height: auto !important;
    min-height: 0 !important;
}

/* ===== COMPACT CARD LAYOUT ===== */
.market-card-image {
    width: 100%;
    height: 118px;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}

.market-card-media {
    position: relative;
}

.product-card-compact,
.shop-card-compact {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card-compact:hover,
.shop-card-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(107, 70, 193, 0.14);
    border-color: rgba(107, 70, 193, 0.45);
}

.product-card-body-compact,
.shop-card-body-compact {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
}

.product-card-title-compact {
    font-size: 0.82rem;
    line-height: 1.25;
}

.product-qty-badge {
    position: absolute;
    left: 0.45rem;
    bottom: 0.45rem;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.2rem 0.42rem;
    border-radius: 999px;
    white-space: nowrap;
}

.product-category-badge {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.18rem 0.42rem;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.product-category-badge:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 1px;
}

.product-card-description {
    font-size: 0.74rem;
    line-height: 1.25;
}

/* ===== NEAR YOU BADGE ===== */
.near-you-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    border: none;
    line-height: 1.3;
}

.shop-card-title {
    font-size: 0.9rem;
    line-height: 1.2;
}

.shop-card-location,
.shop-card-stock {
    font-size: 0.72rem;
}

.shop-card-description {
    font-size: 0.74rem;
    line-height: 1.3;
}

.shop-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    align-items: center;
}

.shop-favorite-slot,
.shop-favorite-slot .favorite-shop-wrapper {
    width: 100%;
}

.shop-card-actions .favorite-toggle-btn,
.shop-card-actions .btn {
    width: 100%;
    font-size: 0.72rem;
    padding: 0.32rem 0.35rem;
    white-space: nowrap;
}

.shop-card-actions > .btn:last-child:nth-child(1) {
    grid-column: 1 / -1;
}

/* ===== FEATURE CARDS ===== */
.feature-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
    background: white;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(107, 70, 193, 0.2);
}

/* ===== STAT NUMBERS ===== */
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===== MODAL OVERLAY ===== */
.category-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1050;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.category-modal-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1051;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-modal-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
}

.category-modal-body {
    flex: 1;
    padding: 2rem 1.5rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sidebar-nav {
        display: none !important;
    }

    .bottom-nav {
        display: flex !important;
    }

    .main-content {
        margin-left: 0 !important;
        margin-top: 76px;
    }

    .main-content.with-bottom-nav {
        padding-bottom: calc(116px + env(safe-area-inset-bottom, 0px));
    }

    .hero-section {
        min-height: auto;
    }

    .hero-section .row {
        min-height: auto !important;
    }

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

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

    .navbar-collapse {
        padding-top: 1rem;
    }

    .market-card-image {
        height: 104px;
    }

    .shop-card-actions .favorite-btn-label {
        display: none;
    }

}

@media (min-width: 769px) {
    .sidebar-nav {
        display: block !important;
    }

    .bottom-nav {
        display: none !important;
    }

    .main-content {
        margin-left: 250px;
        margin-top: 76px;
    }

    .main-content.with-bottom-nav {
        padding-bottom: 0;
    }
}

/* ===== UTILITIES ===== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm-hover {
    transition: box-shadow 0.2s ease;
}

.shadow-sm-hover:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.mw-toast-container {
    position: fixed;
    top: 92px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(92vw, 380px);
}

.mw-toast {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
    animation: toastIn 0.35s ease-out;
}

.mw-toast-icon {
    font-size: 1.1rem;
    line-height: 1;
    margin-top: 2px;
}

.mw-toast-message {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

.mw-toast-close {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1;
    padding: 4px;
}

.mw-toast-close:hover {
    color: var(--text-dark);
}

.mw-toast-success .mw-toast-icon {
    color: #16a34a;
}

.mw-toast-error .mw-toast-icon {
    color: #dc2626;
}

.mw-toast-warning .mw-toast-icon {
    color: #d97706;
}

.mw-toast-info .mw-toast-icon {
    color: #2563eb;
}

.district-search-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: max-content;
    padding: 0.4rem 0.8rem 0.4rem 0.55rem;
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 6px 18px rgba(30, 41, 59, 0.08);
    backdrop-filter: blur(8px);
}

.district-search-switch .form-check-input {
    width: 2.2em;
    margin: 0;
    cursor: pointer;
}

.district-search-switch .form-check-input:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

.mw-toast.is-leaving {
    animation: toastOut 0.35s ease-in forwards;
}

.global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.global-loading-overlay.is-visible {
    display: flex;
}

.global-loading-card {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    min-width: 220px;
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.24);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
}

/* ===== SHOP DIRECTIONS BUTTON ===== */
.shop-directions-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #6B46C1 0%, #9333EA 50%, #3B82F6 100%) !important;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.shop-directions-button:hover {
    background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 50%, #2563EB 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 70, 193, 0.25);
    color: white;
    text-decoration: none;
}

.shop-directions-button__icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.shop-directions-button__eyebrow {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.shop-directions-button__label {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.shop-directions-button__arrow {
    margin-left: auto;
    font-size: 0.875rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.shop-directions-button:hover .shop-directions-button__arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* ===== NOTIFICATION DROPDOWN ===== */
.notification-dropdown {
    padding: 0;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: #f8f9fa;
}

.notification-header h6 {
    color: var(--text-dark);
    font-weight: 600;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--light-mauve);
}

.notification-item.unread {
    background-color: rgba(13, 110, 253, 0.06) !important;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Notification icon colors */
.notification-icon.order {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: white;
}

.notification-icon.shop {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.notification-icon.product {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.notification-icon.user {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.notification-icon.system {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.notification-icon.support {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: white;
}

.notification-icon.location {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification-icon.unread {
    position: relative;
}

.notification-icon.unread::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

/* Product Detail Utilities */
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.animate__heartBeat {
    animation: heartBeat 0.8s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}
