/* ============================================
   LUXE GEMS - Premium Jewelry Store Styles
   Responsive Design for Desktop & Mobile
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #c9a96e;
    --accent-dark: #b8944f;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #fff;
    --bg-light: #f8f6f3;
    --border: #e8e5e0;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
}
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--text); line-height: 1.6; background: var(--bg); }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 2rem; color: var(--primary); margin-bottom: 8px; font-weight: 300; letter-spacing: 1px; }
.section-header p { color: var(--text-light); font-size: 1.05rem; }
.bg-light { background: var(--bg-light); }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border: none; border-radius: var(--radius); font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-sm { padding: 6px 16px; font-size: 0.85rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-cart { background: var(--primary); color: #fff; width: 100%; justify-content: center; }
.btn-cart:hover { background: var(--accent); color: #fff; }

/* === Top Bar === */
.top-bar { background: var(--primary); color: #fff; padding: 8px 0; font-size: 0.85rem; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; }
.top-links { display: flex; gap: 16px; }
.top-links a { color: rgba(255,255,255,0.8); font-size: 0.85rem; }
.top-links a:hover { color: var(--accent); }

/* === Header === */
.header { background: #fff; padding: 16px 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo-text { font-size: 1.5rem; font-weight: 700; color: var(--primary); letter-spacing: 2px; }
.logo-text i { color: var(--accent); }
.nav-main { display: flex; gap: 4px; }
.nav-link { padding: 8px 14px; font-size: 0.9rem; font-weight: 500; color: var(--text); border-radius: var(--radius); }
.nav-link:hover { background: var(--bg-light); color: var(--accent); }
.nav-sale { color: #e74c3c !important; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-form { display: flex; }
.search-input { border: 1px solid var(--border); padding: 8px 12px; border-radius: var(--radius) 0 0 var(--radius); font-size: 0.85rem; width: 180px; outline: none; }
.search-btn { border: 1px solid var(--border); border-left: none; background: var(--bg-light); padding: 8px 12px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.cart-icon { position: relative; font-size: 1.2rem; padding: 8px; }
.cart-badge { position: absolute; top: 0; right: 0; background: var(--accent); color: #fff; font-size: 0.7rem; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 8px; }
.auth-links { display: flex; align-items: center; gap: 8px; }
.auth-link { padding: 8px 16px; border-radius: var(--radius); font-size: 0.85rem; font-weight: 500; transition: var(--transition); color: var(--text); border: 1px solid var(--border); }
.auth-link:hover { border-color: var(--accent); color: var(--accent); }
.auth-register { background: var(--accent); color: #fff; border-color: var(--accent); }
.auth-register:hover { background: var(--accent-dark); color: #fff; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-greeting { font-size: 0.85rem; color: var(--text); white-space: nowrap; }
.user-logout { font-size: 0.8rem; color: var(--text-muted); }

/* === Hero Banner === */
.hero-banner { position: relative; overflow: hidden; }
.banner-slide { padding: 80px 0; color: #fff; display: none; }
.banner-slide.active { display: block; }
.banner-content { max-width: 600px; }
.banner-content h1 { font-size: 3rem; font-weight: 300; letter-spacing: 2px; margin-bottom: 16px; line-height: 1.2; }
.banner-content p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 24px; }

/* === Category Grid === */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.category-card { text-align: center; padding: 30px 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); transition: var(--transition); }
.category-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.category-icon { width: 60px; height: 60px; margin: 0 auto 12px; background: var(--bg-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--accent); }
.category-card h3 { font-size: 0.95rem; font-weight: 500; }

/* === Product Grid === */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-image { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-light); display: flex; align-items: center; justify-content: center; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-image img { transform: scale(1.05); }
.product-placeholder { font-size: 3rem; color: var(--text-muted); }
.badge { position: absolute; top: 10px; padding: 4px 10px; font-size: 0.7rem; font-weight: 600; border-radius: 4px; text-transform: uppercase; }
.badge-new { left: 10px; background: var(--primary); color: #fff; }
.badge-sale { right: 10px; background: #e74c3c; color: #fff; }
.product-info { padding: 16px; }
.product-name { font-size: 0.95rem; font-weight: 500; margin-bottom: 8px; }
.product-name a { color: var(--text); }
.product-name a:hover { color: var(--accent); }
.product-price { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.price-current { font-size: 1.1rem; font-weight: 700; color: var(--accent-dark); }
.price-original { font-size: 0.85rem; color: var(--text-muted); text-decoration: line-through; }

/* === Page Header === */
.page-header { background: var(--bg-light); padding: 40px 0; text-align: center; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 2rem; font-weight: 300; letter-spacing: 1px; }
.breadcrumb { margin-top: 8px; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-light); }

/* === Shop Layout === */
.shop-section { padding: 40px 0; }
.shop-layout { display: grid; grid-template-columns: 240px 1fr; gap: 30px; }
.shop-sidebar { }
.filter-group { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.filter-group h3 { font-size: 1rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.filter-list { list-style: none; }
.filter-list li a { display: block; padding: 8px 0; font-size: 0.9rem; color: var(--text-light); border-bottom: 1px solid #f5f5f5; }
.filter-list li a.active, .filter-list li a:hover { color: var(--accent); font-weight: 500; }
.shop-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sort-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; }
.result-count { font-size: 0.9rem; color: var(--text-muted); }

/* === Product Detail === */
.product-detail { padding: 30px 0; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 20px; }
.product-gallery { }
.main-image { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--bg-light); margin-bottom: 12px; }
.main-image img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail-grid { display: flex; gap: 8px; }
.thumb { width: 70px; height: 70px; border-radius: 6px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: 0.7; transition: var(--transition); }
.thumb.active, .thumb:hover { border-color: var(--accent); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info h1 { font-size: 1.8rem; font-weight: 400; margin-bottom: 12px; }
.product-meta { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.product-price-lg { margin-bottom: 20px; display: flex; align-items: baseline; gap: 12px; }
.product-price-lg .price-current { font-size: 1.8rem; }
.price-save { font-size: 0.85rem; color: #e74c3c; background: #fef2f2; padding: 2px 8px; border-radius: 4px; }
.product-short-desc { color: var(--text-light); margin-bottom: 20px; }
.option-row { display: flex; gap: 8px; margin-bottom: 8px; font-size: 0.9rem; }
.option-row label { font-weight: 600; min-width: 80px; }
.add-to-cart-form { display: flex; gap: 12px; margin: 24px 0; }
.qty-selector { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.qty-selector button { width: 40px; height: 40px; border: none; background: var(--bg-light); cursor: pointer; font-size: 1.1rem; }
.qty-selector input { width: 50px; height: 40px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 1rem; }
.product-stock { margin-bottom: 16px; }
.in-stock { color: #16a34a; font-size: 0.9rem; }
.out-stock { color: #e74c3c; font-size: 0.9rem; }
.product-features { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.product-features div { padding: 6px 0; font-size: 0.9rem; color: var(--text-light); }
.product-features i { color: var(--accent); margin-right: 8px; width: 20px; }
.product-description { margin-top: 40px; padding: 30px; background: var(--bg-light); border-radius: var(--radius); }
.product-description h2 { font-size: 1.3rem; margin-bottom: 16px; font-weight: 400; }
.related-products { margin-top: 50px; }
.related-products h2 { font-size: 1.5rem; font-weight: 400; margin-bottom: 24px; text-align: center; }
.product-placeholder-lg { font-size: 5rem; color: var(--text-muted); display: flex; align-items: center; justify-content: center; height: 100%; }

/* === Cart === */
.cart-section { padding: 40px 0; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 30px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: 12px; border-bottom: 2px solid var(--border); font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); }
.cart-table td { padding: 16px 12px; border-bottom: 1px solid #f5f5f5; }
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-product-img { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; background: var(--bg-light); flex-shrink: 0; }
.cart-product-img img { width: 100%; height: 100%; object-fit: cover; }
.btn-remove { background: none; border: none; color: #e74c3c; cursor: pointer; font-size: 1rem; }
.cart-summary { background: var(--bg-light); padding: 24px; border-radius: var(--radius); height: fit-content; position: sticky; top: 80px; }
.cart-summary h3 { font-size: 1.1rem; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.95rem; }
.summary-row.total { border-top: 2px solid var(--border); margin-top: 12px; padding-top: 12px; font-weight: 700; font-size: 1.15rem; }
.cart-summary .btn { margin-top: 12px; }

/* === Checkout === */
.checkout-section { padding: 40px 0; }
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 30px; }
.checkout-form-area h3 { font-size: 1.2rem; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; outline: none; transition: var(--transition); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,169,110,0.15); }
textarea.form-control { resize: vertical; }
.checkout-summary { background: var(--bg-light); padding: 24px; border-radius: var(--radius); height: fit-content; position: sticky; top: 80px; }
.checkout-items { max-height: 300px; overflow-y: auto; }
.checkout-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eee; }
.checkout-item-img { width: 50px; height: 50px; border-radius: 6px; overflow: hidden; background: #fff; flex-shrink: 0; }
.checkout-item-img img { width: 100%; height: 100%; object-fit: cover; }
.checkout-item-info { flex: 1; }
.item-name { font-size: 0.85rem; display: block; }
.item-qty { font-size: 0.8rem; color: var(--text-muted); }
.item-price { font-weight: 600; font-size: 0.9rem; }
.summary-divider { height: 1px; background: var(--border); margin: 16px 0; }
.checkout-note { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 12px; }

/* === Success Page === */
.success-section { padding: 60px 0; text-align: center; }
.success-box { max-width: 500px; margin: 0 auto; }
.success-icon { font-size: 4rem; color: #16a34a; margin-bottom: 16px; }
.success-box h1 { font-size: 1.8rem; margin-bottom: 8px; }
.order-info { background: var(--bg-light); padding: 24px; border-radius: var(--radius); margin: 24px 0; text-align: left; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; }
.success-actions { display: flex; gap: 12px; justify-content: center; }

/* === Features === */
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.feature-item { text-align: center; padding: 24px; }
.feature-item i { font-size: 2rem; color: var(--accent); margin-bottom: 12px; }
.feature-item h4 { font-size: 1rem; margin-bottom: 6px; }
.feature-item p { font-size: 0.85rem; color: var(--text-muted); }

/* === Footer === */
.footer { background: var(--primary); color: rgba(255,255,255,0.8); padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; }
.footer-col h3 { color: #fff; margin-bottom: 16px; }
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { padding: 4px 0; }
.footer-col ul li a { color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.footer-col ul li a:hover { color: var(--accent); }
.contact-list li { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.contact-list i { color: var(--accent); width: 16px; }
.social-links { display: flex; gap: 12px; margin-top: 16px; }
.social-links a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.7); }
.social-links a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.85rem; }
.payment-icons { display: flex; gap: 12px; font-size: 1.5rem; }

/* === Pagination === */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 30px; }
.page-link { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; color: var(--text); }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-link:hover { border-color: var(--accent); color: var(--accent); }

/* === Alerts === */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.alert-danger { background: #fef2f2; color: #e74c3c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* === Empty State === */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 1.2rem; color: var(--text); margin-bottom: 8px; }
.img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--bg-light); font-size: 1.5rem; color: var(--text-muted); }
.img-placeholder-sm { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; background: var(--bg-light); font-size: 1rem; color: var(--text-muted); border-radius: 6px; }

/* ============================================
   RESPONSIVE DESIGN - Mobile & Tablet
   ============================================ */
@media (max-width: 992px) {
    .shop-layout { grid-template-columns: 1fr; }
    .shop-sidebar { display: none; }
    .cart-layout { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .product-detail-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .banner-content h1 { font-size: 2rem; }
    .banner-slide { padding: 50px 0; }
}

@media (max-width: 768px) {
    .top-links { display: none; }
    .nav-main { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #fff; z-index: 9999; flex-direction: column; padding: 60px 20px 20px; gap: 0; }
    .nav-main.open { display: flex; }
    .nav-main .nav-link { padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid #f5f5f5; }
    .mobile-toggle { display: block; }
    .search-form { display: none; }
    .header-inner { flex-wrap: wrap; }

    /* 移动端商品详情页标题优化 */
    .product-detail-info h1 { font-size: 1.2rem; line-height: 1.45; margin-bottom: 8px; word-wrap: break-word; }
    .breadcrumb { font-size: 0.75rem; padding: 8px 0; margin-bottom: 12px; }
    .product-price-lg .price-current { font-size: 1.3rem; }
    .product-meta { font-size: 0.8rem; gap: 8px; flex-wrap: wrap; }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .features-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    .cart-table th:nth-child(4), .cart-table td:nth-child(4) { display: none; }
    .form-row { grid-template-columns: 1fr; }

    .section { padding: 30px 0; }
    .section-header h2 { font-size: 1.5rem; }
    .page-header h1 { font-size: 1.5rem; }

    .add-to-cart-form { flex-direction: column; }
    .add-to-cart-form .btn { width: 100%; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-info { padding: 10px; }
    .product-name { font-size: 0.8rem; }
    .price-current { font-size: 0.95rem; }
    .btn-cart { font-size: 0.75rem; padding: 6px 8px; }
    .container { padding: 0 12px; }
    .banner-content h1 { font-size: 1.5rem; }
    
    /* 小屏幕商品详情页标题进一步优化 */
    .product-detail-info h1 { font-size: 1rem; line-height: 1.4; margin-bottom: 6px; }
    .product-price-lg .price-current { font-size: 1.15rem; }
    .product-meta { font-size: 0.75rem; gap: 6px; }
    .product-short-desc { font-size: 0.8rem; line-height: 1.4; }
}
