/**
 * BeautiMass Mega Menu
 * Shared across homepage, category pages, guides, and blog.
 * Poppins font, dark teal header, white/light-gray dropdown,
 * pink (#ff1493) hover accents, 5px radius, box-shadow on panel.
 */

/* ── Header overrides for dropdown support ───────────────────────── */
.header {
    overflow: visible !important;
    z-index: 200 !important;
}

/* ── Hamburger button (mobile only) ─────────────────────────────── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
}

.ham-bar {
    display: block;
    width: 23px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease;
    transform-origin: center;
}

.hamburger-btn.open .ham-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open .ham-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.open .ham-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Desktop mega nav ─────────────────────────────────────────────── */
.mega-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mega-item {
    position: static;
}

.mega-top-link {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    transition: color 0.2s;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1;
    position: relative;
}

/*
 * Hover bridge: transparent pseudo-element that spans the gap between
 * the nav text and the dropdown panel. Without this, the cursor loses
 * .mega-item:hover while crossing the gap, pointer-events:none kicks
 * in on the panel immediately, and links become unclickable.
 */
.mega-item > .mega-top-link::after {
    content: '';
    position: absolute;
    left: -1.5rem;
    right: -1.5rem;
    top: 100%;
    height: 2.5rem;
}

.mega-top-link:hover,
.mega-item:hover > .mega-top-link {
    color: #ff1493;
}

.mega-chevron {
    font-size: 0.52rem;
    transition: transform 0.22s ease;
    display: inline-block;
    margin-top: 1px;
}

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

.mega-digital {
    color: #ff9900 !important;
    font-weight: 700;
}
.mega-digital:hover {
    color: #ffbb44 !important;
}

.mega-blog {
    color: #ff1493 !important;
    font-weight: 700;
}
.mega-blog:hover {
    opacity: 0.8;
}

/* ── Dropdown panel ──────────────────────────────────────────────── */
.mega-panel {
    position: absolute;
    top: 100%;
    left: -2rem;
    right: -2rem;
    z-index: 201;
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    border-radius: 0 0 5px 5px;
    border-top: 3px solid #ff1493;

    /* Hidden state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0s linear 0.2s;
}

/* Show on hover — also keep open when hovering the panel itself */
.mega-item:hover .mega-panel,
.mega-panel:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s;
}

.mega-panel-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.mega-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.mega-cat-label {
    font-size: 0.68rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    color: #00201d;
    font-family: 'Poppins', sans-serif;
}

.mega-view-all {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ff1493;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    transition: opacity 0.15s;
}
.mega-view-all:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* 4-column card grid */
.mega-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.mega-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    background: #f7f8f8;
    border: 1.5px solid #eeeeee;
    transition: background 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.mega-card:hover {
    background: #fff0f7;
    border-color: #ff1493;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 20, 147, 0.12);
}

.mega-card-icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.mega-card-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #00201d;
    font-family: 'Poppins', sans-serif;
    line-height: 1.2;
}

.mega-card-desc {
    font-size: 0.72rem;
    color: #888;
    font-family: 'Poppins', sans-serif;
    line-height: 1.4;
}

/* ── Mobile menu (absolute-positioned below sticky header) ──────── */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: -2rem;
    right: -2rem;
    z-index: 200;
    background: #011f1c;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mobile-menu.open {
    max-height: 580px;
    overflow-y: auto;
}

.mob-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.mob-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
}

.mob-trigger:hover {
    color: #ff1493;
}

.mob-trigger.active {
    color: #ff1493;
}

.mob-arrow {
    font-size: 0.55rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.mob-trigger.active .mob-arrow {
    transform: rotate(180deg);
}

.mob-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
    background: rgba(0, 0, 0, 0.18);
}

.mob-panel.open {
    max-height: 220px;
}

.mob-panel a {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.875rem;
    font-family: 'Poppins', sans-serif;
    padding: 0.6rem 1.5rem 0.6rem 2.5rem;
    transition: color 0.15s, padding-left 0.15s;
}

.mob-panel a:first-child {
    color: #ff1493;
    font-weight: 600;
    padding-top: 0.75rem;
}

.mob-panel a:last-child {
    padding-bottom: 0.75rem;
}

.mob-panel a:hover {
    color: #ff1493;
    padding-left: 2.8rem;
}

.mob-direct-link {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    padding: 1rem 1.5rem;
    transition: color 0.2s;
}

.mob-digital {
    color: #ff9900 !important;
    font-weight: 700;
}

.mob-blog-link {
    color: #ff1493 !important;
    font-weight: 700;
}

/* ── Responsive breakpoints ──────────────────────────────────────── */
@media (max-width: 768px) {
    .mega-nav {
        display: none !important;
    }

    .hamburger-btn {
        display: flex !important;
    }
}

@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }

    .hamburger-btn {
        display: none !important;
    }
}

/* ── Guide pages: header is direct flex container ────────────────── */
/* Ensure header-nav (old flat nav) is hidden when mega-nav is present */
.header-nav {
    display: none !important;
}
