/* =============================================
   CATEGORIES MEGA PANEL
   ============================================= */

/* header_wrap needs position:relative so the panel anchors below it */
.header_wrap {
    position: relative;
    z-index: 1001;
}

/* ---------- panel shell ---------- */
.cat-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1;
}

.cat-panel.is-open {
    display: block;
}

/* ---------- inner container (matches header-container width) ---------- */
.cat-panel__columns {
    display: flex;
    margin: 0 auto;
    padding: 0 5px;
    width: 100%;
    max-width: 1200px;
    min-height: 340px;
    max-height: 520px;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.14);
}

/* ---------- LEFT column: parent category list ---------- */
.cat-panel__left {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid #eee;
    overflow-y: auto;
    padding: 8px 0;
}

.cat-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-panel__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--ho-ho_darkgrey);
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.cat-panel__item:hover,
.cat-panel__item.is-active {
    background-color: rgba(73, 193, 186, 0.08);
    color: var(--ho-ho_lightgreen);
    border-left-color: var(--ho-ho_lightgreen);
}

.cat-panel__item-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-panel__item-arrow {
    font-size: 10px;
    flex-shrink: 0;
    margin-left: 6px;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.cat-panel__item.is-active .cat-panel__item-arrow,
.cat-panel__item:hover .cat-panel__item-arrow {
    opacity: 1;
}

/* ---------- RIGHT column ---------- */
.cat-panel__right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 26px 30px;
    overflow-y: auto;
}

.cat-panel__right-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    flex-shrink: 0;
}

.cat-panel__right-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ho-ho_black);
    margin: 0;
    flex-shrink: 0;
}

.cat-panel__see-all {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--ho-ho_red);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.cat-panel__see-all:hover,
.cat-panel__see-all:focus {
    color: var(--ho-ho_darkred);
    text-decoration: none;
}

.cat-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e0e0e0;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ho-ho_darkgrey);
    flex-shrink: 0;
    font-size: 13px;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cat-panel__close:hover {
    background-color: #f5f5f5;
    color: var(--ho-ho_black);
    border-color: #ccc;
}

/* Mobile-only "see all" CTA below children (hidden on desktop) */
.cat-panel__see-all-mobile {
    display: none;
}

/* ---------- Children grid ---------- */
.cat-panel__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-content: start;
}

.cat-child-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.cat-child-item:hover,
.cat-child-item:focus {
    text-decoration: none;
    color: inherit;
}

/* Placeholder image -- striped pattern until real images are added */
.cat-child-img {
    width: 100%;
    height: 130px;
    border-radius: 8px;
    margin-bottom: 8px;
    background-color: #e2e2e2;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 9px,
        rgba(255, 255, 255, 0.55) 9px,
        rgba(255, 255, 255, 0.55) 18px
    );
    transition: opacity 0.2s ease;
}

.cat-child-img--photo {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cat-child-item:hover .cat-child-img {
    opacity: 0.82;
}

.cat-child-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ho-ho_black);
    margin-bottom: 3px;
    line-height: 1.3;
}

.cat-child-link {
    display: block;
    font-size: 12px;
    color: var(--ho-ho_darkgrey);
    line-height: 1.3;
}

.cat-panel__empty {
    font-size: 14px;
    color: var(--ho-ho_darkgrey);
    padding: 20px 0;
    margin: 0;
    grid-column: 1 / -1;
}

/* ---------- Mobile-only top bar ---------- */
.cat-panel__mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.cat-panel__mobile-bar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ho-ho_lightgreen);
}

.cat-panel__close-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e0e0e0;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--ho-ho_darkgrey);
    font-size: 13px;
    line-height: 1;
    transition: background-color 0.15s ease;
}

.cat-panel__close-mobile:hover {
    background-color: #f5f5f5;
}

/* ---------- Back button (mobile only by default) ---------- */
.cat-panel__back {
    display: none;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--ho-ho_lightgreen);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cat-panel__back:hover {
    color: var(--ho-ho_darkgreen);
}

/* ---------- Backdrop overlay (desktop only) ---------- */
.cat-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 1000;
}

.cat-overlay.is-open {
    display: block;
}

/* =============================================
   MEGA PANEL -- MOBILE (< 992px)
   ============================================= */
@media (max-width: 991px) {
    .cat-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        display: none;
        flex-direction: column;
        overflow: hidden;
    }

    .cat-panel.is-open {
        display: flex;
    }

    .cat-panel__mobile-bar {
        display: flex;
    }

    .cat-panel__columns {
        flex-direction: column;
        max-height: none;
        min-height: 0;
        flex: 1;
        overflow: hidden;
        padding: 0;
        position: relative;
    }

    .cat-panel__left {
        width: 100%;
        border-right: none;
        flex: 1;
        overflow-y: auto;
        padding: 8px 0;
    }

    .cat-panel__right {
        position: absolute;
        inset: 0;
        background: #fff;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }

    .cat-panel.show-children .cat-panel__right {
        transform: translateX(0);
    }

    .cat-panel__back {
        display: inline-flex;
    }

    /* Clean right header: only back + title on mobile */
    .cat-panel__right-header {
        flex-wrap: wrap;
        gap: 8px 12px;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    .cat-panel__right-title {
        flex: 1 1 100%;
        font-size: 18px;
        line-height: 1.25;
    }

    .cat-panel__see-all,
    .cat-panel__close {
        display: none;
    }

    .cat-panel__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .cat-panel__see-all-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: fit-content;
        max-width: 100%;
        margin: 20px auto 0;
        padding: 12px 16px;
        border: 1px solid var(--ho-ho_red);
        border-radius: 6px;
        background: transparent;
        color: var(--ho-ho_red);
        font-size: 14px;
        font-weight: 600;
        text-align: center;
        text-decoration: none;
        line-height: 1.3;
        flex-shrink: 0;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .cat-panel__see-all-mobile:hover,
    .cat-panel__see-all-mobile:focus {
        background-color: var(--ho-ho_red);
        color: #fff;
        text-decoration: none;
    }

    .cat-panel__see-all-mobile strong {
        font-weight: 700;
    }

    /* overlay not needed on mobile (panel covers full screen) */
    .cat-overlay {
        display: none !important;
    }
}

@media (max-width: 575px) {
    .cat-panel__right {
        padding: 12px 14px;
    }

    .cat-panel__grid {
        gap: 10px;
        grid-template-columns: repeat(2, 1fr);
    }

    .cat-child-name {
        font-size: 12px;
    }

    .cat-panel__see-all-mobile {
        font-size: 13px;
        padding: 11px 14px;
    }
}
