/* ================================================
   Apple Navigation Dropdown - Apple.com Style
   ================================================ */

/* ---------- Navigation Bar ---------- */
.nav-apple {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 999;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-apple .nav-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    z-index: 1001;
}

.nav-brand i {
    font-size: 22px;
}

/* ---------- Navigation Links ---------- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-item-wrapper {
    position: static;
    height: 48px;
    display: flex;
    align-items: center;
}

.nav-link {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-primary);
    text-decoration: none;
    letter-spacing: 0.01em;
    padding: 0;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

/* 导航项下方 1px 细线指示器 */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-text-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    opacity: 1;
}

/* ---------- Actions ---------- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1001;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    font-size: 20px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-icon-btn:hover {
    background: rgba(120, 120, 128, 0.1);
    color: var(--color-accent);
}

.nav-icon-btn:active {
    transform: scale(0.92);
}

/* ---------- Dropdown Overlay (页面遮罩) ---------- */
.nav-dropdown-overlay {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-dropdown-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* 遮罩下方内容模糊 */
.nav-dropdown-overlay.active ~ .page-content-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.page-content-overlay {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 997;
    pointer-events: none;
    transition: backdrop-filter 0.3s ease;
}

/* ---------- Dropdown Panel ---------- */
.nav-dropdown-panel {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-dropdown-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-panel.closing {
    transition-duration: 0.25s;
}

.nav-dropdown-content {
    max-width: 1024px;
    margin: 0 auto;
    padding: 40px 0 60px;
}

/* ---------- Dropdown Grid Layout ---------- */
.dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 64px;
}

.dropdown-column {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-column.column-1 { transition-delay: 0s; }
.dropdown-column.column-2 { transition-delay: 0.05s; }
.dropdown-column.column-3 { transition-delay: 0.1s; }

.nav-dropdown-panel.visible .dropdown-column {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Column Headers ---------- */
.dropdown-header {
    font-size: 11px;
    font-weight: 400;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    padding-bottom: 8px;
}

/* ---------- Product List (Column 1) ---------- */
.dropdown-products {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-products li {
    margin-bottom: 0;
}

.dropdown-products a {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text-primary);
    text-decoration: none;
    line-height: 1.4;
    padding: 8px 0;
    transition: opacity 0.15s ease;
}

.dropdown-products a:hover {
    opacity: 0.6;
}

.dropdown-products a .badge {
    font-size: 12px;
    font-weight: 500;
    color: #86868b;
    background: #f5f5f7;
    padding: 2px 8px;
    border-radius: 980px;
    margin-left: 8px;
    vertical-align: middle;
}

/* 产品列表与次要链接的分隔 */
.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 16px 0;
}

/* ---------- Secondary Links (Columns 2, 3) ---------- */
.dropdown-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-links li {
    margin-bottom: 0;
}

.dropdown-links a {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--color-text-primary);
    text-decoration: none;
    line-height: 2.2;
    transition: opacity 0.15s ease;
}

.dropdown-links a:hover {
    opacity: 0.6;
}

/* ---------- 母亲节特别样式 ---------- */
.nav-mothers-day {
    background: linear-gradient(90deg, #FF6B6B 0%, #FF8E53 100%);
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-weight: 600 !important;
}

.nav-mothers-day:hover {
    opacity: 1 !important;
}

.nav-mothers-day::after {
    display: none;
}

/* Gift Icon Animation */
.gift-icon {
    transition: transform 0.3s ease;
}

.nav-icon-btn:hover .gift-icon {
    transform: scale(1.1);
}

/* ---------- Mobile Overlay ---------- */
.nav-mobile-overlay {
    display: none;
}

/* ---------- Responsive: Tablet & Mobile ---------- */
@media (max-width: 1024px) {
    .nav-dropdown-panel {
        position: fixed;
        top: 48px;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        transform: translateY(0);
        border-bottom: none;
    }

    .nav-dropdown-panel.visible {
        transform: translateY(0);
    }

    .nav-dropdown-panel.closing {
        transition-duration: 0.3s;
    }

    .nav-dropdown-content {
        padding: 24px 0 40px;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .dropdown-column {
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        padding-bottom: 24px;
    }

    .dropdown-column:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .dropdown-column.column-1,
    .dropdown-column.column-2,
    .dropdown-column.column-3 {
        transition-delay: 0s;
    }

    .nav-dropdown-panel.visible .dropdown-column {
        transform: translateY(0);
    }

    /* 移动端遮罩无 blur 效果 */
    .nav-dropdown-overlay {
        background: rgba(0, 0, 0, 0.25);
    }

    .nav-dropdown-overlay.active ~ .page-content-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* 移动端产品名可展开 */
    .dropdown-products a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        font-size: 20px;
        cursor: pointer;
    }

    .dropdown-products a::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #86868b;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .dropdown-products a.expanded::before {
        opacity: 1;
    }

    .dropdown-subitems {
        display: none;
        padding-left: 16px;
        margin-top: 8px;
    }

    .dropdown-subitems.visible {
        display: block;
    }

    .dropdown-subitems a {
        font-size: 14px;
        font-weight: 400;
        color: var(--color-text-secondary);
        padding: 6px 0;
    }

    .dropdown-subitems a:hover {
        color: var(--color-text-primary);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-mobile-toggle {
        display: flex;
    }
}

/* ---------- Main Content Offset ---------- */
main {
    padding-top: var(--nav-height);
}
