/* ==========================================================================
   MEGA HEADER — Zalora-style sticky header + mega menu
   Mobile-first responsive design
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
:root {
    --mh-bg: #ffffff;
    --mh-text: #222222;
    --mh-text-light: #555555;
    --mh-text-muted: #999999;
    --mh-accent: #222222;
    --mh-accent-hover: #000000;
    --mh-red: #EC2028;
    --mh-red-hover: #c91c24;
    --mh-red-alt: #ee3124;
    --mh-green: #0a8a6b;
    --mh-green-hover: #077758;
    --mh-border: #e5e5e5;
    --mh-border-light: #f0f0f0;
    --mh-hover-bg: #f7f7f7;
    --mh-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --mh-shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
    --mh-transition: 0.2s ease;
    --mh-font: 'Figtree', sans-serif;
    --mh-nav-height: 44px;
    --mh-top-height: 90px;
    --mh-sidebar-w: 250px;
    --mh-mega-font-size: 14px;
    --mh-mega-panel-height: 580px; /* shared height for Store Categories body & Groceries panel */
}

/* --------------------------------------------------------------------------
   Fixed Header Container (uses fixed instead of sticky to avoid parent overflow issues)
   -------------------------------------------------------------------------- */
.mega-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--mh-bg);
    transition: box-shadow 0.3s ease;
}

.mega-header.is-scrolled {
    box-shadow: var(--mh-shadow);
}

/* Spacer pushes content below the fixed header */
.mega-header__spacer {
    display: block;
}

/* --------------------------------------------------------------------------
   Row 1: Logo + Search + Icons
   -------------------------------------------------------------------------- */
.mega-header__top {
    border-bottom: none;
    /* seamless with nav row */
}

.mega-header__top-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    min-height: var(--mh-top-height);
    justify-content: space-between;
}

/* Logo */
.mega-header__logo {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    text-decoration: none;
}

.mega-header__logo-icon {
    height: 70px;
    width: auto;
}

.mega-header__logo-text {
    height: 50px;
    width: auto;
}

/* Rounded Search Bar */
.mega-header__search {
    flex: 1 1 auto;
    max-width: 640px;
    min-width: 0;
    display: none;
    /* hidden on mobile, shown on md+ */
}

.mega-header__search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.mega-header__search-input {
    width: 100%;
    height: 44px;
    padding: 0 52px 0 20px;
    border: 1.5px solid #d0d0d0;
    border-radius: 50px;
    font-size: 14px;
    font-family: var(--mh-font);
    color: var(--mh-text);
    background: #f9f9f9;
    outline: none;
    transition: all var(--mh-transition);
}

.mega-header__search-input::placeholder {
    color: var(--mh-text-muted);
    font-style: italic;
    font-size: 13px;
}

.mega-header__search-input:focus {
    border-color: var(--mh-red);
    background: var(--mh-bg);
    box-shadow: 0 0 0 3px rgba(236, 32, 40, 0.1);
}

.mega-header__search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--mh-red);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--mh-transition);
}

.mega-header__search-btn:hover {
    background: var(--mh-red-hover);
}

/* Right Icons */
.mega-header__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mega-header__action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    font-size: 22px;
    color: var(--mh-text);
    text-decoration: none;
    transition: color var(--mh-transition);
    position: relative;
}

.mega-header__action:hover {
    color: var(--mh-accent-hover);
    text-decoration: none;
}

.mega-header__action-label {
    display: none;
    /* hidden on mobile */
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.mega-header__badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e53e3e;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mega-header__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--mh-text);
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Row 2: Navigation Bar (desktop only)
   -------------------------------------------------------------------------- */
.mega-header__nav {
    display: none;
    /* shown on lg+ */
    border-bottom: 1px solid #eee;
    background: #fff;
}

.mega-header__nav-list {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-header__nav-item {
    position: static;
    /* allow mega panel to use header as reference */
}

.mega-header__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--mh-font);
    color: #000;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.mega-header__nav-link:hover,
.mega-header__nav-item--mega:hover .mega-header__nav-link {
    color: var(--mh-red);
    text-decoration: none;
}

.mega-header__nav-caret {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.mega-header__nav-item--mega:hover .mega-header__nav-caret {
    transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Mega Dropdown Panel (Categories)
   -------------------------------------------------------------------------- */
.mega-header__mega-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* clip children to rounded corners so bottom-left/right radius is visible */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 999;
}

.mega-header__nav-item--mega:hover .mega-header__mega-panel,
.mega-header__nav-item--mega.is-open .mega-header__mega-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.mega-header__mega-inner {
    max-width: none;
    margin: 0;
    padding: 0;
}

.mega-header__mega-body {
    display: flex;
    min-height: 280px;
    height: var(--mh-mega-panel-height);
}

/* Stores panel overrides: body fills remaining space within 560px total */
.mega-header__mega-panel--stores .mega-header__mega-body {
    height: auto;
}

/* Category Sidebar */
.mega-header__mega-sidebar {
    width: var(--mh-sidebar-w);
    flex-shrink: 0;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    padding: 15px 5px 15px 0;
    overflow-y: auto;
    min-height: 0;
}

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

.mega-header__mega-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.mega-header__mega-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 25px;
    font-size: var(--mh-mega-font-size);
    font-weight: 500;
    color: #333;
    text-decoration: none;
    border-left: 4px solid transparent;
    margin: 7px 0;
    transition: all 0.2s ease;
}

.mega-header__mega-cat:hover,
.mega-header__mega-cat--active {
    background: #fff;
    color: var(--mh-red-alt);
    border-left-color: var(--mh-red-alt);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
    text-decoration: none;
}

.mega-header__mega-cat-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: var(--mh-text-light);
}

.mega-header__mega-cat-icon-img {
    width: 20px;
    height: 20px;
}
/* Font Awesome category icon (when stored as fa-solid fa-* in DB) */
.mega-header__mega-cat i.mega-header__mega-cat-icon-img {
    width: auto;
    height: auto;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-header__mega-cat-arrow {
    margin-left: auto;
    font-size: 11px;
    color: var(--mh-text-muted);
    flex-shrink: 0;
}

.mega-header__mega-cat--active .mega-header__mega-cat-arrow {
    color: var(--mh-accent);
}

/* Subcategories Content */
.mega-header__mega-content {
    flex: 1;
    padding: 14px 28px;
    min-width: 0;
    overflow-y: auto;
    min-height: 0;
}

.mega-header__mega-subcats {
    display: none;
}

.mega-header__mega-subcats--active {
    display: block;
}

.mega-header__mega-subcats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.mega-header__mega-subcats-title {
    font-size: var(--mh-mega-font-size);
    font-weight: 600;
    color: var(--mh-red);
    margin: 0;
}

.mega-header__mega-shopall {
    font-size: var(--mh-mega-font-size);
    font-weight: 500;
    color: var(--mh-red);
    text-decoration: none;
}

.mega-header__mega-shopall:hover {
    text-decoration: underline;
    color: var(--mh-red-hover);
}

.mega-header__mega-subcats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 16px;
}

.mega-header__mega-subcat-link {
    display: block;
    padding: 5px 0;
    font-size: var(--mh-mega-font-size);
    color: var(--mh-text-light);
    text-decoration: none;
    transition: color var(--mh-transition);
}

.mega-header__mega-subcat-link:hover {
    color: var(--mh-green);
    text-decoration: none;
}

.mega-header__mega-empty {
    font-size: var(--mh-mega-font-size);
    color: var(--mh-text-muted);
    font-style: italic;
    padding: 8px 0;
}

/* Promo Images */
.mega-header__mega-promos {
    width: 300px;
    flex-shrink: 0;
    border-left: 1px solid var(--mh-border-light);
    padding: 20px;
}

.mega-header__mega-promo-set {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.mega-header__mega-promo-set--active {
    display: flex;
}

.mega-header__mega-promo-card {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    transition: transform var(--mh-transition);
}

.mega-header__mega-promo-card:hover {
    transform: translateY(-2px);
}

.mega-header__mega-promo-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Promotions Mega Dropdown
   -------------------------------------------------------------------------- */
.mega-header__promo-detail {
    display: none;
    height: 100%;
}

.mega-header__promo-detail--active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.mega-header__promo-detail-grid {
    display: flex;
    gap: 30px;
    height: 100%;
    align-items: flex-start;
}

.mega-header__promo-detail-img {
    flex: 0 0 500px;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    display: block;
}

.mega-header__promo-detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.mega-header__promo-detail-img:hover img {
    transform: scale(1.05);
}

.mega-header__promo-detail-info {
    flex: 1;
    padding-top: 10px;
}

.mega-header__promo-detail-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--mh-accent);
    margin: 0 0 12px;
    line-height: 1.2;
}

.mega-header__promo-detail-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--mh-text-light);
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.mega-header__promo-detail-desc {
    font-size: 16px;
    line-height: 1.6;
    color: var(--mh-text-light);
    margin-bottom: 28px;
    max-width: 90%;
}

.mega-header__promo-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background: var(--mh-accent);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mega-header__promo-detail-btn:hover {
    background: var(--mh-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.mega-header__promo-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--mh-text-muted);
    font-size: 18px;
    padding: 40px;
}

.mega-header__promo-tnc-sidebar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mh-green);
    text-decoration: none;
    border-top: 1px solid var(--mh-border-light);
    margin-top: auto;
    /* Push to bottom of sidebar */
}

.mega-header__promo-tnc-sidebar:hover {
    background: var(--mh-hover-bg);
    color: var(--mh-green-hover);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Stores Mega Panel: Search + Sidebar + Stores Grid (matches HTML stores-mega-wrapper)
   -------------------------------------------------------------------------- */
.mega-header__mega-panel--stores {
    max-height: var(--mh-mega-panel-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mega-header__mega-panel--stores .mega-header__mega-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.mega-header__mega-panel--stores .mega-header__mega-stores-search {
    flex-shrink: 0;
}

.mega-header__mega-panel--stores .mega-header__mega-body {
    flex: 1;
    min-height: 0;
    height: auto;
}

.mega-header__mega-stores-search {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
}

.mega-header__mega-stores-search-form {
    margin: 0;
}

.mega-header__mega-stores-search-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mega-header__stores-search-input-wrap {
    flex: 1;
    position: relative;
}

.mega-header__stores-search-input-wrap .mega-header__stores-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    pointer-events: none;
}

.mega-header__mega-stores-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.mega-header__mega-stores-search-input:focus {
    outline: none;
    border-color: var(--mh-red);
    box-shadow: 0 0 0 3px rgba(236, 32, 40, 0.1);
}

.mega-header__mega-stores-search-btn {
    padding: 10px 20px;
    background: var(--mh-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.mega-header__mega-stores-search-btn:hover {
    background: var(--mh-red-hover);
}

.mega-header__mega-stores-grid-wrap {
    display: none;
}

.mega-header__mega-stores-grid-wrap--active {
    display: block;
}

.mega-header__mega-content--stores {
    padding: 16px 28px 20px;
    background: #fff;
    min-height: 0;
    overflow-y: auto;
}

.mega-header__mega-stores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.mega-header__mega-store-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: var(--mh-mega-font-size);
    color: var(--mh-text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.mega-header__mega-store-link::before {
    content: "→";
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--mh-red);
    font-weight: bold;
}

.mega-header__mega-store-link:hover {
    color: var(--mh-red);
    background: #fff5f7;
    padding-left: 15px;
    text-decoration: none;
}

.mega-header__mega-store-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.mega-header__mega-store-link:hover .mega-header__mega-store-name {
    font-weight: 600;
}

.mega-header__mega-store-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    object-position: center;
    border: 1px solid #eee;
    background: #f8f9fa;
    flex-shrink: 0;
}

.mega-header__mega-store-logo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f8f9fa;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--mh-text-muted);
    flex-shrink: 0;
}

.mega-header__mega-store-name {
    font-weight: 500;
    font-size: var(--mh-mega-font-size);
}

/* --------------------------------------------------------------------------
   Groceries Mega Panel: Grocery Sub-categories Grid (scrollable, same height as stores)
   -------------------------------------------------------------------------- */
.mega-header__mega-panel--groceries {
    max-height: var(--mh-mega-panel-height);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mega-header__mega-panel--groceries .mega-header__mega-inner {
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 0; /* allow flex child to shrink and show scrollbar */
}

/* Scrollbar styling for groceries panel so users see it's scrollable */
.mega-header__mega-panel--groceries .mega-header__mega-inner::-webkit-scrollbar {
    width: 8px;
}

.mega-header__mega-panel--groceries .mega-header__mega-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.mega-header__mega-panel--groceries .mega-header__mega-inner::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.mega-header__mega-panel--groceries .mega-header__mega-inner::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.mega-header__grocery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.mega-header__grocery-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 10px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mega-header__grocery-grid-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(236, 32, 40, 0.08), transparent);
    transition: left 0.5s;
}

.mega-header__grocery-grid-item:hover::before {
    left: 100%;
}

.mega-header__grocery-grid-item:hover {
    background: #FDF2F4;
    border-color: var(--mh-red);
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(236, 32, 40, 0.15);
    text-decoration: none;
    color: #333;
}

.mega-header__grocery-grid-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.mega-header__grocery-grid-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--mh-text-muted);
}

.mega-header__grocery-grid-name {
    font-size: var(--mh-mega-font-size);
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Campaigns Mega Panel: 6-Block Grid (matches HTML campaign-card)
   -------------------------------------------------------------------------- */
.mega-header__mega-panel--campaigns .mega-header__mega-inner {
    padding: 30px;
}

.mega-header__campaigns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.mega-header__campaign-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e5e5e5;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.mega-header__campaign-card:hover {
    border-color: var(--mh-red);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #333;
}

.mega-header__campaign-card-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    margin: 10px 0;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.mega-header__campaign-card:hover .mega-header__campaign-card-img {
    transform: scale(1.05) rotate(-2deg);
}

.mega-header__campaign-card-body {
    padding: 20px 25px;
}

.mega-header__campaign-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
    color: #333;
}

.mega-header__campaign-card-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    opacity: 0.9;
}

.mega-header__campaign-card-cta {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--mh-red);
    border: 2px solid var(--mh-red);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.mega-header__campaign-card:hover .mega-header__campaign-card-cta {
    background: var(--mh-red-hover);
    border-color: var(--mh-red-hover);
}

.mega-header__campaigns-viewall {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.mega-header__campaigns-viewall-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--mh-red);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.mega-header__campaigns-viewall-link:hover {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: var(--mh-red);
}

.mega-header__campaigns-viewall-link i {
    transition: transform 0.2s;
}

.mega-header__campaigns-viewall-link:hover i {
    transform: translateX(3px);
}


/* --------------------------------------------------------------------------
   Mobile Overlay Menu
   -------------------------------------------------------------------------- */
.mega-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 380px;
    height: 100%;
    background: var(--mh-bg);
    z-index: 10001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--mh-shadow-lg);
}

.mega-mobile.is-open {
    transform: translateX(0);
}

.mega-mobile__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mega-mobile__overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

body.mega-mobile-open {
    overflow: hidden;
}

/* Mobile Header */
.mega-mobile__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--mh-border);
    flex-shrink: 0;
}

.mega-mobile__logo {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mega-mobile__logo img {
    height: 28px;
    width: auto;
}

.mega-mobile__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--mh-border);
    border-radius: 50%;
    font-size: 18px;
    color: var(--mh-text);
    cursor: pointer;
}

/* Mobile Search */
.mega-mobile__search {
    padding: 12px 20px;
    border-bottom: 1px solid var(--mh-border);
}

.mega-mobile__search-wrap {
    position: relative;
}

.mega-mobile__search-input {
    width: 100%;
    height: 42px;
    padding: 0 46px 0 16px;
    border: 1.5px solid var(--mh-border);
    border-radius: 50px;
    font-size: 14px;
    background: #f9f9f9;
    outline: none;
}

.mega-mobile__search-input:focus {
    border-color: var(--mh-accent);
    background: white;
}

.mega-mobile__search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--mh-accent);
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Mobile Body */
.mega-mobile__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mega-mobile__section {
    border-bottom: 1px solid var(--mh-border);
    padding: 12px 0;
}

.mega-mobile__section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mh-text-muted);
    padding: 8px 20px 4px;
    margin: 0;
}

/* Accordion */
.mega-mobile__accordion-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--mh-text);
    text-align: left;
}

.mega-mobile__accordion-btn:hover {
    background: var(--mh-hover-bg);
}

.mega-mobile__accordion-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    color: var(--mh-text-light);
}

.mega-mobile__accordion-caret {
    margin-left: auto;
    font-size: 12px;
    color: var(--mh-text-muted);
    transition: transform 0.25s ease;
}

.mega-mobile__accordion.is-expanded .mega-mobile__accordion-caret {
    transform: rotate(180deg);
}

.mega-mobile__accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafafa;
}

.mega-mobile__accordion.is-expanded .mega-mobile__accordion-content {
    max-height: 1000px;
}

.mega-mobile__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px 11px 52px;
    font-size: 14px;
    color: var(--mh-text-light);
    text-decoration: none;
}

.mega-mobile__link:hover {
    background: #f0f0f0;
    color: var(--mh-accent);
    text-decoration: none;
}

.mega-mobile__link--all {
    font-weight: 600;
    color: var(--mh-green);
    border-bottom: 1px solid var(--mh-border-light);
}

.mega-mobile__link--tnc {
    font-weight: 500;
    color: var(--mh-green);
    padding-left: 20px;
    border-top: 1px solid var(--mh-border-light);
    margin-top: 4px;
}

.mega-mobile__quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--mh-text);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.mega-mobile__quick-link:hover {
    background: var(--mh-hover-bg);
    text-decoration: none;
    color: var(--mh-text);
}

.mega-mobile__quick-link--logout {
    color: #e53e3e;
}

.mega-mobile__empty {
    font-size: 14px;
    color: var(--mh-text-muted);
    padding: 8px 20px;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive: Tablet / Desktop
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
    .mega-header__search {
        display: block;
    }

    .mega-header__action-label {
        display: inline;
    }
}

@media (min-width: 992px) {
    .mega-header__nav {
        display: block;
    }

    .mega-header__hamburger {
        display: none !important;
    }

    .mega-header__nav-item {
        position: static;
    }
}

@media (min-width: 1200px) {
    :root {
        --mh-sidebar-w: 260px;
    }

    .mega-header__search {
        max-width: 740px;
    }

    .mega-header__grocery-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .mega-header__campaigns-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1199px) {
    .mega-header__grocery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .mega-header__campaigns-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .mega-header__mega-stores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.mega-header__nav-link:focus-visible,
.mega-header__action:focus-visible,
.mega-header__mega-cat:focus-visible,
.mega-header__mega-subcat-link:focus-visible {
    outline: 2px solid var(--mh-accent);
    outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   Animation
   -------------------------------------------------------------------------- */
@keyframes mhSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.mega-header__nav-item--mega:hover .mega-header__mega-inner {
    animation: mhSlideIn 0.25s ease forwards;
}