/* =====================================================
   SH Shop Menu — Styled to match "ALL DEPARTMENT" design
   Author: Sumith Harshan
   ===================================================== */

/* ── Reset ─────────────────────────────────────────── */
.sh-shop-menu-wrap,
.sh-shop-menu-wrap *,
.sh-shop-menu-wrap *::before,
.sh-shop-menu-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
.sh-shop-menu-wrap ul { list-style: none; }

/* ── Wrapper — keeps position context ─────────────── */
.sh-shop-menu-wrap {
    position: relative;
    display: inline-block;
    font-family: 'Segoe UI', Arial, sans-serif;
    z-index: 9990;
    -webkit-font-smoothing: antialiased;
}

/* =====================================================
   TRIGGER BUTTON  ≡  ALL DEPARTMENT  ⌄
   ===================================================== */
.sh-dept-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #f07c00;   /* orange from screenshot */
    color: #ffffff;
    border: none;
    cursor: pointer;
    padding: 0 20px;
    height: 46px;
    min-width: 210px;
    text-decoration: none;
    user-select: none;
    transition: background-color 0.18s ease;
    outline: none;
}

.sh-dept-btn:hover,
.sh-dept-btn:focus-visible,
.sh-shop-menu-wrap.sh-open .sh-dept-btn {
    background-color: #d96e00;
}

/* Hamburger bars icon */
.sh-dept-btn__bars {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    width: 18px;
}
.sh-dept-btn__bars span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #ffffff;
    border-radius: 1px;
}

/* "ALL DEPARTMENT" label */
.sh-dept-btn__label {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1;
}

/* Chevron ⌄ */
.sh-dept-btn__chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.sh-dept-btn__chevron svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sh-shop-menu-wrap.sh-open .sh-dept-btn__chevron {
    transform: rotate(180deg);
}

/* =====================================================
   DROPDOWN PANEL
   ===================================================== */
.sh-dept-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    border-top: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.13);
    z-index: 9991;

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

/* visible state */
.sh-shop-menu-wrap.sh-open .sh-dept-dropdown,
.sh-shop-menu-wrap:hover .sh-dept-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

/* ── Category list ───────────────────────────────── */
.sh-dept-dropdown > ul {
    padding: 6px 0;
}

/* ── Every category item ─────────────────────────── */
.sh-dept-item {
    position: relative;
}

.sh-dept-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    color: #333333;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    text-decoration: none;
    border-bottom: 1px solid #f2f2f2;
    transition: color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

.sh-dept-item:last-child > .sh-dept-link {
    border-bottom: none;
}

.sh-dept-link:hover {
    color: #f07c00;
    background-color: #fff8f2;
}

/* Sub-category arrow → */
.sh-dept-link__arrow {
    display: flex;
    align-items: center;
    margin-left: 12px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}
.sh-dept-link__arrow svg {
    width: 11px;
    height: 11px;
    fill: none;
    stroke: #333;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sh-dept-link:hover .sh-dept-link__arrow {
    opacity: 1;
}
.sh-dept-link:hover .sh-dept-link__arrow svg {
    stroke: #f07c00;
}

/* =====================================================
   NESTED SUBMENU  (fly-out to the right)
   ===================================================== */
.sh-dept-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    box-shadow: 4px 6px 20px rgba(0,0,0,0.10);
    z-index: 9992;
    padding: 6px 0;

    /* hidden */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
    pointer-events: none;
}

.sh-dept-item:hover > .sh-dept-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
    pointer-events: auto;
}

/* deep nesting: shift submenu to left when near right edge */
@media (max-width: 1100px) {
    .sh-dept-submenu {
        left: auto;
        right: 100%;
        transform: translateX(6px);
    }
    .sh-dept-item:hover > .sh-dept-submenu {
        transform: translateX(0);
    }
}

/* submenu links */
.sh-dept-submenu .sh-dept-link {
    font-size: 13.5px;
    padding: 9px 16px;
}

/* =====================================================
   MOBILE — collapse to accordion
   ===================================================== */
@media (max-width: 768px) {

    .sh-dept-btn { min-width: 180px; }

    .sh-dept-dropdown {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        width: 100vw;
        max-height: 70vh;
        overflow-y: auto;
        box-shadow: 0 8px 24px rgba(0,0,0,0.18);
        border-radius: 0 0 8px 8px;
    }

    /* sub-menus become accordion on mobile */
    .sh-dept-submenu {
        position: static;
        box-shadow: none;
        border: none;
        border-left: 3px solid #f07c00;
        padding-left: 10px;
        transform: none;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transition: max-height 0.3s ease;
        pointer-events: none;
    }

    .sh-dept-item.sh-open-sub > .sh-dept-submenu {
        max-height: 800px;
        pointer-events: auto;
    }

    .sh-dept-item.sh-open-sub > .sh-dept-link .sh-dept-link__arrow svg {
        transform: rotate(90deg);
        stroke: #f07c00;
    }
}

/* ── Accessibility ───────────────────────────────── */
.sh-dept-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -3px;
}
.sh-dept-link:focus-visible {
    outline: 2px solid #f07c00;
    outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
    .sh-dept-btn__chevron,
    .sh-dept-dropdown,
    .sh-dept-submenu {
        transition: none;
    }
}
