/* =============================================================
   Mega Menu — SiteHeaderMegaMenu & OffcanvasMegaMenu
   Used by the "megamenu" header layout option.
   ============================================================= */

/* ── Positioning context for the full-width dropdown ── */
.mega-nav-wrapper {
    position: relative;
    overflow: visible;
    border-top: 1px solid var(--bs-border-color);
}

/* ── Top-level nav bar ── */
.mega-menu-nav {
    gap: 0;
    flex-wrap: nowrap;
}

/* Individual nav-bar item wrapper (hover trigger) */
.mega-menu-item {
    /* position: static keeps the absolute dropdown relative to .mega-nav-wrapper */
    position: static;
    display: flex;
    align-items: stretch;
}

/* Top-level link / button in the nav bar */
.mega-menu-link {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .65rem 1rem;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    transition: opacity .15s ease;
}

.mega-menu-link:hover,
.mega-menu-link:focus-visible {
    opacity: .75;
    outline: none;
}

/* Chevron icon rotates when the dropdown is open */
.mega-menu-item:hover .mega-menu-chevron,
.mega-menu-item:focus-within .mega-menu-chevron {
    transform: rotate(180deg);
}

.mega-menu-chevron {
    transition: transform .2s ease;
}

/* ── Full-width dropdown panel ── */
.mega-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bs-body-bg);
    border-top: 2px solid var(--bs-primary, #0d6efd);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 1050;
}

/* Show on hover OR keyboard focus anywhere inside the item */
.mega-menu-item:hover .mega-dropdown,
.mega-menu-item:focus-within .mega-dropdown {
    display: block;
}

/* ── "See all" column (left edge of dropdown) ── */
.mega-see-all-col {
    min-width: 10rem;
    border-right: 1px solid var(--bs-border-color);
    padding-right: 1.5rem;
}

.mega-see-all-link {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    transition: opacity .15s ease;
}

.mega-see-all-link:hover {
    opacity: .7;
}

/* ── L2 category column ── */
.mega-category-col {
    min-width: 8rem;
    max-width: 16rem;
}

/* Category image card */
.mega-category-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: .375rem;
    display: block;
}

/* Category name below the image */
.mega-category-name {
    font-size: .9rem;
    color: inherit;
}

/* Full link wrapping image + name */
.mega-category-link {
    color: inherit;
}

.mega-category-link:hover .mega-category-name {
    text-decoration: underline;
}

/* ── L3 sub-links below the category image ── */
.mega-sub-list {
    padding-left: 0;
}

.mega-sub-link {
    display: block;
    padding: .2rem 0;
    font-size: .85rem;
    color: var(--bs-secondary-color, #6c757d);
    transition: color .15s ease;
}

.mega-sub-link:hover {
    color: var(--bs-body-color);
    text-decoration: underline !important;
}

/* ── Offcanvas drill-down ── */

/* Thumbnail in the mobile offcanvas list */
.mega-offcanvas-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Back-navigation header row */
.mega-offcanvas-header {
    padding: .5rem 0;
}

/* "See all" row in offcanvas sub-level */
.mega-see-all-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .25rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

.mega-see-all-link:hover {
    text-decoration: underline;
}

/* Remove the default list-group border radius on the offcanvas list */
.mega-offcanvas-items .list-group-item {
    border-left: 0;
    border-right: 0;
}

.mega-offcanvas-items .list-group-item:first-child {
    border-top: 0;
}
