/* ============================================================
 * ZOQUI Shared Styles — 跨页面公共组件
 * 包含：CSS变量 / 全局重置 / navbar / cart drawer / language switcher / mobile nav
 * 加载顺序：必须在各页面主样式之前
 * ============================================================ */

/* ═══════ CSS 自定义属性（品牌色板）═══════ */
:root {
    --purple: #7B3FA0;
    --purple-light: #A569BD;
    --purple-dark: #5B2C6F;
    --pink: #E91E8C;
    --pink-light: #F06292;
    --pink-soft: #FCE4EC;
    --cream: #FDF8F5;
    --lavender: #F3E5F5;
    --white: #FFFFFF;
    --dark: #1A1A2E;
    --medium: #4A4A5A;
    --light: #8A8A9A;
    --border: #EDE0F0;
}

/* ═══════ 全局重置 ═══════ */
/* 始终预留滚动条空间，避免页面内容撑高后滚动条出现/消失导致的水平抖动 */
html { scrollbar-gutter: stable; }
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream);
    color: var(--dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border, #EDE0F0);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}
.navbar-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 32px;
    display: flex; align-items: center; justify-content: space-between; height: 96px;
}
.logo { display: flex; align-items: center; text-decoration: none; cursor: pointer; border-radius: 0; padding: 0; }
.logos { display: flex; align-items: center; gap: 6px; }
.logo img { height: 104px; width: auto; transition: transform 0.3s, opacity 0.3s; display: block; }
.logo:hover img { transform: scale(1.05); }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin-right: auto; }
.nav-links a {
    text-decoration: none; color: #1A1A2E;
    font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
    cursor: pointer; transition: color 0.2s; position: relative;
    padding: 8px 4px;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 4px; width: 0; height: 2px;
    background: linear-gradient(90deg, #7B3FA0, #E91E8C);
    transition: width 0.3s; border-radius: 1px;
}
.nav-links a:hover, .nav-links a.active {
    color: #7B3FA0;
}
.nav-links a:hover::after, .nav-links a.active::after { width: calc(100% - 8px); }

/* ===== 未登录 My Account 按钮（与登录后用户头像同位置）===== */
#navAccountItem {
    flex-shrink: 0;
    width: 168px;          /* 固定宽度，匹配登录后头像菜单最大尺寸，确保 US EN + 购物车位置不漂移 */
    display: flex; align-items: center; justify-content: center;
}
.nav-account-link {
    display: inline-flex; align-items: center; gap: 6px;
    background: none; border: 1.5px solid var(--purple); border-radius: 24px;
    padding: 6px 14px; cursor: pointer;
    text-decoration: none; color: var(--purple); font-size: 14px; font-weight: 600;
    transition: border-color .2s, box-shadow .2s;
    white-space: nowrap; font-family: inherit;
}
.nav-account-link:hover {
    box-shadow: 0 0 0 3px rgba(123, 63, 160, .1);
}

/* ===== 导航用户菜单（登录后）===== */
.nav-user-menu {
    position: relative;
    width: 168px;          /* 固定宽度，与未登录 #navAccountItem 一致，确保右侧 US EN + 购物车位置稳定 */
    display: flex; align-items: center; justify-content: center;
}
.nav-user-btn {
    display: flex; align-items: center; gap: 8px;
    background: none; border: 1.5px solid #e5e7eb; border-radius: 24px;
    padding: 6px 14px 6px 6px; cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.nav-user-btn:hover {
    border-color: #7B3FA0;
    box-shadow: 0 0 0 3px rgba(123, 63, 160, .1);
}
.nav-user-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #7B3FA0, #E91E8C);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.nav-user-name {
    font-size: 14px; font-weight: 600; color: #1A1A2E; max-width: 100px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-user-arrow {
    font-size: 10px; color: #8A8A9A; transition: transform .2s;
}
.nav-user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
    min-width: 180px; padding: 6px; opacity: 0; pointer-events: none;
    transform: translateY(-6px); transition: all .2s; z-index: 1100;
}
.nav-user-dropdown.open {
    opacity: 1; pointer-events: all; transform: translateY(0);
}
.nav-user-link {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px; border: none; background: none;
    color: #1A1A2E; font-size: 14px; font-weight: 500; text-decoration: none;
    border-radius: 8px; cursor: pointer; font-family: inherit;
    text-align: left; transition: background .15s;
}
.nav-user-link:hover { background: #f5f3ff; }
.nav-user-logout {
    color: #dc2626; border-top: 1px solid #f0f0f0; margin-top: 2px; padding-top: 10px;
}
.nav-user-logout:hover { background: #fef2f2; }
/* 移动端隐藏用户菜单名 */
@media (max-width: 768px) {
    .nav-user-name { display: none; }
    .nav-user-btn { padding: 4px; border: none; }
}

/* ===== 购物车按钮 ===== */
.cart-btn {
    position: relative; background: none; border: none; cursor: pointer;
    color: var(--medium, #4A4A5A); padding: 6px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.cart-btn:hover { color: var(--purple, #7B3FA0); background: rgba(124, 58, 237, .08); }
.cart-count {
    position: absolute; top: -2px; right: -4px;
    background: var(--purple, #7B3FA0); color: #fff;
    font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
}

/* ===== 购物车侧边栏 ===== */
.cart-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .4);
    z-index: 1200; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-drawer {
    position: fixed; top: 0; right: -420px; width: 380px; max-width: 96vw; height: 100vh;
    background: #fff; z-index: 1201; display: flex; flex-direction: column;
    box-shadow: -8px 0 40px rgba(0, 0, 0, .12);
    transition: right .35s cubic-bezier(.4, 0, .2, 1);
}
.cart-drawer.open { right: 0; }
.cart-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 20px 16px; border-bottom: 1px solid #f0f0f0;
}
.cart-drawer-title { font-size: 16px; font-weight: 700; color: #111; }
.cart-drawer-close {
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: #f3f4f6; color: #6b7280; cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.cart-drawer-close:hover { background: #e5e7eb; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; color: #9ca3af; font-size: 14px; text-align: center; padding: 40px 20px;
}
.cart-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid #f3f4f6; align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
    background: #f3f4f6; flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; color: #111; margin-bottom: 3px; line-height: 1.4; }
.cart-item-price { font-size: 12px; color: #7c3aed; font-weight: 700; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.qty-btn {
    width: 24px; height: 24px; border-radius: 6px; border: 1px solid #e5e7eb;
    background: #fff; cursor: pointer; font-size: 14px; font-weight: 700; color: #374151;
    display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.qty-btn:hover { border-color: #7c3aed; color: #7c3aed; }
.qty-num { font-size: 13px; font-weight: 700; color: #111; min-width: 20px; text-align: center; }
.cart-item-remove {
    background: none; border: none; cursor: pointer; color: #d1d5db;
    font-size: 16px; padding: 2px; transition: color .2s; align-self: flex-start;
}
.cart-item-remove:hover { color: #ef4444; }
.cart-footer {
    border-top: 1px solid #f0f0f0; padding: 16px 20px 24px; background: #fff;
}
.cart-total {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px; font-size: 15px; font-weight: 600; color: #111;
}
.cart-total-price { font-size: 20px; font-weight: 800; color: #7c3aed; }
.cart-checkout-btn {
    width: 100%; padding: 13px; border-radius: 12px; border: none;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
    transition: all .2s; margin-bottom: 8px;
}
.cart-checkout-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 58, 237, .35); }
.cart-clear-btn {
    width: 100%; padding: 10px; border-radius: 10px;
    border: 1px solid #e5e7eb; background: #fff;
    color: #6b7280; font-size: 13px; cursor: pointer; transition: all .2s;
}
.cart-clear-btn:hover { background: #f9fafb; color: #374151; }
.cart-zip {
    display: flex; gap: 6px; margin-bottom: 12px;
    padding: 12px 0 8px; border-top: 1px dashed #e5e7eb;
}
.cart-zip input {
    flex: 1; padding: 9px 10px; border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 13px; color: #111; background: #fff; outline: none; transition: border .2s;
}
.cart-zip input:focus { border-color: #7c3aed; }
.cart-zip-btn {
    padding: 0 14px; border: none; border-radius: 8px;
    background: #111; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
}
.cart-zip-btn:hover { background: #7c3aed; }
.cart-summary-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; color: #4b5563; margin-bottom: 5px;
}
.cart-summary-row.total {
    font-size: 16px; font-weight: 800; color: #111;
    border-top: 1px solid #f0f0f0; padding-top: 8px; margin-top: 8px;
}
.cart-summary-row .v { font-weight: 700; }
.cart-summary-row.total .v { color: #7c3aed; }
.cart-free-shipping-hint {
    font-size: 11px; color: #10b981; font-weight: 600;
    background: #ecfdf5; border-radius: 6px; padding: 5px 8px; margin-bottom: 8px;
    text-align: center;
}
.cart-empty-cart-cta {
    display: inline-block; margin-top: 16px; padding: 10px 24px;
    background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
    border-radius: 24px; font-size: 13px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: all .2s;
}
.cart-empty-cart-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124, 58, 237, .4); }

/* ===== Language Switcher ===== */
.lang-switcher { position: relative; }
.lang-btn {
    display: flex; align-items: center; gap: 6px; padding: 6px 14px;
    border: 1.5px solid var(--border, #EDE0F0); border-radius: 24px; background: white;
    cursor: pointer; font-size: 13px; font-weight: 500; color: var(--medium, #4A4A5A);
    transition: all 0.2s;
}
.lang-btn:hover { border-color: var(--purple-light, #A569BD); }
.lang-btn .flag { font-size: 16px; }
.lang-btn .arrow { font-size: 10px; transition: transform 0.2s; }
.lang-btn.open .arrow { transform: rotate(180deg); }
.lang-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0; background: white;
    border: 1.5px solid var(--border, #EDE0F0); border-radius: 12px; overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); min-width: 150px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: all 0.2s;
}
.lang-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    cursor: pointer; font-size: 13px; color: var(--medium, #4A4A5A); transition: background 0.15s;
}
.lang-option:hover { background: var(--lavender, #F3E5F5); }
.lang-option.selected { color: var(--purple, #7B3FA0); font-weight: 600; }
.lang-option .check { margin-left: auto; color: var(--purple, #7B3FA0); font-weight: 700; }

/* ===== Mobile Nav ===== */
.mobile-toggle {
    display: none; background: none; border: none; cursor: pointer; padding: 8px;
}
.mobile-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--dark, #1A1A2E); margin: 5px 0; border-radius: 2px; transition: 0.3s;
}
.mobile-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4); z-index: 2000;
    opacity: 0; transition: opacity 0.3s;
}
.mobile-overlay.open { opacity: 1; }
.mobile-panel {
    position: fixed; top: 0; right: -280px; width: 280px; height: 100%; background: white;
    z-index: 2001; transition: right 0.3s; padding: 24px; box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}
.mobile-panel.open { right: 0; }
.mobile-close {
    background: none; border: none; font-size: 24px; cursor: pointer;
    color: var(--medium, #4A4A5A); margin-bottom: 24px;
}
.mobile-panel a {
    display: block; padding: 14px 0; text-decoration: none;
    color: var(--medium, #4A4A5A); font-size: 16px; font-weight: 500;
    border-bottom: 1px solid var(--border, #EDE0F0);
}
.mobile-panel a.active { color: var(--purple, #7B3FA0); }

/* ===== Page System ===== */
.page { display: none; padding-top: 96px; }
.page.active { display: block; }

/* ===== Page Banner ===== */
.page-banner {
    background: linear-gradient(135deg, var(--cream, #FDF8F5) 0%, var(--lavender, #F3E5F5) 50%, var(--pink-soft, #FCE4EC) 100%);
    padding: 64px 32px 48px; text-align: center;
}
.page-banner h1 {
    font-family: 'Playfair Display', serif; font-size: 42px; font-weight: 700;
    color: var(--dark, #1A1A2E); margin-bottom: 12px;
}
.page-banner h1 em { color: var(--purple, #7B3FA0); font-style: italic; }
.page-banner p { color: var(--medium, #4A4A5A); font-size: 16px; max-width: 560px; margin: 0 auto; }
.breadcrumb { margin-bottom: 16px; font-size: 13px; color: var(--light, #8A8A9A); }
.breadcrumb a { color: var(--purple, #7B3FA0); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; }

/* ===== Page Transition — 由各页面 <head> 内联样式控制 ===== */
/* 遮罩淡出由 #pageTransitionOverlay.zq-hidden { opacity: 0 } 驱动 */
/* 此处仅保留全局 keyframes，供内联样式引用 */
@keyframes zq-spin { to { transform: rotate(360deg); } }

/* ===== Page Enter Animation ===== */
.zoqui-page-enter {
    animation: zq-page-in 0.8s ease-out both;
}
@keyframes zq-page-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Fade-in on page load ===== */
@keyframes ck-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ck-fade-in { animation: ck-fade-in 0.5s ease-out both; }
.ck-fade-in-delay-1 { animation: ck-fade-in 0.5s ease-out 0.08s both; }
.ck-fade-in-delay-2 { animation: ck-fade-in 0.5s ease-out 0.16s both; }
.ck-fade-in-delay-3 { animation: ck-fade-in 0.5s ease-out 0.24s both; }
