/* 導航商品分類下拉選單-start */
.main-header.pc {
    .main-nav__dropdown {
        position: relative;

        .main-nav__trigger {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 16px;
            color: var(--black-color);
            font-weight: 500;
            padding: 8px 0;
            letter-spacing: 0.01em;
            opacity: 1;
            transition: color 0.3s ease;

            &::after {
                content: "";
                width: 0;
                height: 0;
                /* margin-top: 2px; */
                border-left: 4px solid transparent;
                border-right: 4px solid transparent;
                border-top: 5px solid currentColor;
                opacity: 0.55;
                transition: transform 0.3s ease;
            }

            &:hover {
                color: var(--main-color);
            }

            &.is-active {
                color: var(--main-color);
            }
        }

        &.is-open {
            .main-nav__trigger {
                color: var(--main-color);
            }

            .main-nav__trigger::after {
                transform: rotate(180deg);
            }
        }
    }

    &.is-mega-open {
        .main-nav__dropdown:not(.main-nav__guide-dropdown) .main-nav__trigger {
            color: var(--main-color);
        }
    }
}

/* 導航下拉遮罩-start */
.nav-guide-dropdown__overlay {
    position: fixed;
    top: 122px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: rgba(15, 23, 42, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;

    .main-header.pc.is-collapsed & {
        top: 82px;
    }

    .main-header.pc.is-mega-open &,
    .main-header.pc.is-guide-open & {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}
/* 導航下拉遮罩-end */

@keyframes mega-panel-expand {
    from {
        opacity: 0;
        transform: scaleY(0);
    }

    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes mega-menu-slide-in {
    from {
        opacity: 0;
        transform: translateX(28px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes mega-card-slide-up {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-category-mega__panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 101;
    width: 100%;
    /* padding: 0 max(20px, calc((100% - 1400px) / 2)) 20px; */
    background-color: #fff;
    visibility: hidden;
    pointer-events: none;
    padding-bottom: 50px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 18px 18px rgba(15, 23, 42, 0.12);

    &.is-visible {
        visibility: visible;
        pointer-events: auto;
    }

    &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 14px;
        transform: translateY(-100%);
    }

    .nav-category-mega__inner {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 0;
        min-height: 360px;
        padding: 0;
        /* border: 1px solid rgba(24, 24, 24, 0.08); */
        /* border-radius: 16px; */
        background: var(--white-color);
        /* box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12); */
        overflow: hidden;
        transform-origin: top center;
        opacity: 0;
        transform: scaleY(0);
    }

    &.is-visible .nav-category-mega__inner {
        animation: mega-panel-expand 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    }

    .nav-category-mega__sidebar {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        max-height: 360px;
        padding: 28px 0 20px;
        overflow: hidden;
        /* border-right: 1px solid rgba(24, 24, 24, 0.08); */
        /* background: #fafbfc; */
    }

    .nav-category-mega__sidebar-title {
        flex-shrink: 0;
        margin: 0 0 16px;
        padding: 0 24px;
        font-size: 18px;
        font-weight: 500;
        line-height: 1.4;
        color: var(--black-color);
    }

    .nav-category-mega__menu {
        flex: 1;
        min-height: 0;
        margin: 0;
        padding: 0 8px 0 0;
        list-style: none;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(30, 140, 230, 0.35) transparent;

        &::-webkit-scrollbar {
            width: 4px;
        }

        &::-webkit-scrollbar-track {
            background: transparent;
        }

        &::-webkit-scrollbar-thumb {
            border-radius: 999px;
            background: rgba(30, 140, 230, 0.28);
        }

        &::-webkit-scrollbar-thumb:hover {
            background: rgba(30, 140, 230, 0.45);
        }

        li {
            margin: 0;
        }
    }

    .nav-category-mega__menu-link {
        display: block;
        padding: 11px 24px;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.4;
        color: #6b7280;
        opacity: 0;
        transform: translateX(28px);
        transition: color 0.2s ease, background 0.2s ease;

        &:hover {
            color: var(--black-color);
            background: rgba(30, 140, 230, 0.06);
        }

        &.is-active {
            font-weight: 500;
            background: rgba(30, 140, 230, 0.06);
            color: var(--main-color);
        }
    }

    &.is-animated {
        .nav-category-mega__menu li:nth-child(1) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
        }

        .nav-category-mega__menu li:nth-child(2) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
        }

        .nav-category-mega__menu li:nth-child(3) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.32s forwards;
        }

        .nav-category-mega__menu li:nth-child(4) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.42s forwards;
        }

        .nav-category-mega__menu li:nth-child(5) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.52s forwards;
        }

        .nav-category-mega__menu li:nth-child(6) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.62s forwards;
        }

        .nav-category-mega__menu li:nth-child(7) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.72s forwards;
        }

        .nav-category-mega__menu li:nth-child(8) .nav-category-mega__menu-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.82s forwards;
        }

        .nav-category-mega__all-link {
            animation: mega-menu-slide-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.62s forwards;
        }
    }

    .nav-category-mega__all-link {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 16px 24px 0;
        padding-top: 16px;
        border-top: 1px solid rgba(24, 24, 24, 0.08);
        font-size: 14px;
        font-weight: 500;
        color: var(--main-color);
        opacity: 0;
        transform: translateX(28px);
        transition: color 0.2s ease;

        svg {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
        }

        &:hover {
            color: #1678d0;
        }
    }

    .nav-category-mega__content {
        position: relative;
        padding: 28px 0px 24px 28px;
        background: var(--white-color);
    }

    .nav-category-mega__group {
        display: none;

        &.is-active {
            display: block;
        }

        .product-card {
            opacity: 0;
            transform: translateY(28px);
            border: none;
        }

        &.is-group-animated {
            .product-card:nth-child(1) {
                animation: mega-card-slide-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
            }

            .product-card:nth-child(2) {
                animation: mega-card-slide-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
            }

            .product-card:nth-child(3) {
                animation: mega-card-slide-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.32s forwards;
            }

            .product-card:nth-child(4) {
                animation: mega-card-slide-up 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.42s forwards;
            }
        }
    }

    .nav-category-mega__group-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 20px;
    }

    .nav-category-mega__group-label {
        font-size: 15px;
        font-weight: 500;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #9aa3b2;
    }

    .nav-category-mega__group-more {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 14px;
        font-weight: 500;
        color: var(--black-color);
        transition: color 0.2s ease;

        svg {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
        }

        &:hover {
            color: var(--main-color);
        }
    }

    .nav-category-mega__products {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;

        .product-card {
            height: 100%;
        }

        .product-card__body {
            padding: 12px 2px 4px;
        }

        .product-card__name {
            font-size: 15px;
            margin-bottom: 8px;
        }

        .product-card__price-current {
            font-size: 16px;
        }
    }
}


.product-card__badges{
    top: 23px;
}

.product-card__badge{
    min-height: 25px;
}
