/* Products Mega Menu — mature PC flyout */
.products-mega-menu {
    position: static;
}

.header-nav-item.products-mega-menu {
    position: relative;
}

.header-menu,
.header-nav-content,
.header-nav-left {
    overflow: visible;
}

.products-nav-trigger::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.products-mega-menu:hover .products-nav-trigger::after {
    transform: rotate(180deg);
    opacity: 0.85;
}

.products-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    transform: translateY(8px);
    background: #fff;
    border: 1px solid #e8e2d6;
    border-radius: 4px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    min-width: 280px;
    max-width: 420px;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 10000;
    overflow: hidden;
}

.products-mega-menu:hover .products-dropdown,
.products-mega-menu:focus-within .products-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* hover 桥接区，防止鼠标移入下拉时菜单消失 */
.products-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.products-dropdown-inner {
    padding: 0;
}

/* 双栏布局 */
.pm-menu-shell {
    display: flex;
    min-height: 240px;
    max-height: 380px;
}

/* 左侧一级分类 */
.pm-menu-nav {
    flex: 0 0 220px;
    background: #faf8f5;
    border-right: 1px solid #ede8df;
    overflow-y: auto;
}

.pm-nav-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.pm-nav-item {
    margin: 0;
}

.pm-nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 16px;
    border: none;
    background: transparent;
    color: #3d3428;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
}

.pm-nav-btn--link {
    cursor: pointer;
}

.pm-nav-label {
    flex: 1;
    padding-right: 8px;
}

.pm-nav-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #b8a88a;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.pm-nav-item.is-active .pm-nav-btn,
.pm-nav-item:hover .pm-nav-btn {
    background: #fff;
    color: #9A7B2F;
}

.pm-nav-item.is-active .pm-nav-btn {
    box-shadow: inset 3px 0 0 #C9A84C;
    font-weight: 600;
}

.pm-nav-item.is-active .pm-nav-arrow,
.pm-nav-item:hover .pm-nav-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #C9A84C;
}

.pm-nav-item--link:hover .pm-nav-btn {
    box-shadow: inset 3px 0 0 rgba(201, 168, 76, 0.5);
}

/* 右侧子分类面板 */
.pm-menu-panels {
    flex: 1;
    position: relative;
    background: #fff;
    overflow: hidden;
    min-width: 320px;
}

.pm-menu-panels--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8070;
    font-size: 13px;
    padding: 24px;
}

.pm-panel {
    position: absolute;
    inset: 0;
    padding: 20px 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(6px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    overflow-y: auto;
}

.pm-panel.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: relative;
}

.pm-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0ebe0;
}

.pm-panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2c2416;
    letter-spacing: 0.01em;
}

.pm-panel-all {
    font-size: 12px;
    font-weight: 500;
    color: #9A7B2F;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.pm-panel-all:hover {
    color: #C9A84C;
    text-decoration: underline;
}

.pm-sub-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 20px;
}

.pm-sub-link {
    display: block;
    padding: 8px 0;
    color: #5c5347;
    font-size: 13px;
    text-decoration: none;
    line-height: 1.35;
    transition: color 0.15s ease;
    border-bottom: 1px solid transparent;
}

.pm-sub-link:hover {
    color: #9A7B2F;
}

/* 底部栏 */
.pm-menu-footer {
    border-top: 1px solid #ede8df;
    background: #faf8f5;
    padding: 10px 16px;
}

.pm-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9A7B2F;
    text-decoration: none;
    transition: color 0.15s ease, gap 0.15s ease;
}

.pm-footer-link svg {
    width: 14px;
    height: 14px;
}

.pm-footer-link:hover {
    color: #C9A84C;
    gap: 10px;
}

/* Loading / Error */
.products-dropdown.loading .products-dropdown-inner {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-dropdown.loading .products-dropdown-inner::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #ede8df;
    border-top-color: #C9A84C;
    border-radius: 50%;
    animation: pmMenuSpin 0.7s linear infinite;
}

.pm-menu-error {
    padding: 32px 24px;
    text-align: center;
    font-size: 13px;
    color: #8a8070;
}

.pm-menu-error a {
    color: #9A7B2F;
}

@keyframes pmMenuSpin {
    to { transform: rotate(360deg); }
}

/* 扁平二级分类布局 */
.pm-menu-shell--flat {
    min-height: auto;
    max-height: 360px;
}

.pm-menu-panels--flat {
    position: relative;
    min-width: 280px;
    max-width: 420px;
    padding: 16px 20px;
    overflow-y: auto;
}

.pm-sub-grid--flat {
    grid-template-columns: 1fr;
    gap: 0;
}

.pm-sub-grid--flat .pm-sub-link {
    padding: 10px 0;
    border-bottom: 1px solid #f0ebe0;
}

.pm-sub-grid--flat li:last-child .pm-sub-link {
    border-bottom: none;
}

/* 滚动条 */
.pm-menu-nav::-webkit-scrollbar,
.pm-panel::-webkit-scrollbar {
    width: 4px;
}

.pm-menu-nav::-webkit-scrollbar-thumb,
.pm-panel::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 4px;
}

@media screen and (max-width: 768px) {
    .products-mega-menu .products-dropdown {
        display: none !important;
    }
}
