/* === Reset & Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #2c2c2c;
    --accent: #8B7355;
    --bg: #fafafa;
    --white: #fff;
    --gray: #888;
    --light: #eee;
    --border: #ddd;
    --error: #c0392b;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
    --font-ja: 'Noto Sans JP', sans-serif;
    --font-zh: 'Noto Sans SC', sans-serif;
}
html { scroll-behavior: smooth; }
body { font-family: var(--font-ja); background: var(--bg); color: var(--primary); line-height: 1.7; }

/* === Header === */
.header { position: sticky; top: 0; background: var(--white); border-bottom: 1px solid var(--border); z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; }
.logo { font-size: 1.4rem; font-weight: 700; text-decoration: none; color: var(--primary); letter-spacing: 2px; }
.nav { display: flex; gap: 20px; flex: 1; }
.nav a { text-decoration: none; color: var(--gray); font-size: .9rem; transition: color .2s; }
.nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.cart-btn { text-decoration: none; font-size: 1.1rem; color: var(--primary); position: relative; }
#cart-count { font-size: .75rem; background: var(--accent); color: #fff; border-radius: 50%; padding: 1px 6px; position: absolute; top: -8px; right: -12px; }
.account-btn { text-decoration: none; color: var(--gray); font-size: .85rem; }
.lang-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; cursor: pointer; font-family: inherit; font-size: .8rem; color: var(--primary); }

/* === Main === */
main { max-width: 1200px; margin: 0 auto; padding: 40px 20px; min-height: 60vh; }
.loading { text-align: center; padding: 80px 0; color: var(--gray); }

/* === Hero === */
.hero { text-align: center; padding: 80px 0 60px; }
.hero h1 { font-size: 2.4rem; font-weight: 300; margin-bottom: 16px; letter-spacing: 3px; }
.hero p { font-size: 1rem; color: var(--gray); max-width: 600px; margin: 0 auto 32px; }
.hero .cta { display: inline-block; background: var(--primary); color: #fff; padding: 14px 40px; border-radius: var(--radius); text-decoration: none; font-size: .95rem; transition: opacity .2s; }
.hero .cta:hover { opacity: .85; }

/* === Product Grid === */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin: 32px 0; }
.product-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; text-decoration: none; color: inherit; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.product-card img { width: 100%; height: 280px; object-fit: cover; background: #f5f5f5; display: block; }
.product-card .info { padding: 16px; }
.product-card .name { font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
.product-card .category { font-size: .8rem; color: var(--gray); }
.product-card .price { margin-top: 8px; font-size: 1.1rem; font-weight: 500; letter-spacing: 1px; }
.product-card .price .sale { color: var(--error); margin-left: 8px; font-weight: 400; }
.product-card .price .original { text-decoration: line-through; color: var(--gray); font-size: .85rem; margin-left: 8px; }
.product-card .no-image { height: 280px; display: flex; align-items: center; justify-content: center; color: var(--gray); background: #f5f5f5; }

/* === Product Detail === */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.product-detail .gallery { position: relative; }
.product-detail .gallery .main-img { width: 100%; border-radius: var(--radius); background: #f5f5f5; }
.product-detail .gallery .thumbnails { display: flex; gap: 8px; margin-top: 8px; }
.product-detail .gallery .thumbnails img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.product-detail .gallery .thumbnails img.active { border-color: var(--accent); }
.product-detail .info h1 { font-size: 1.6rem; font-weight: 500; margin-bottom: 8px; }
.product-detail .info .price { font-size: 1.5rem; font-weight: 500; margin: 16px 0; letter-spacing: 1px; }
.product-detail .info .price .sale { color: var(--error); }
.product-detail .info .sku { color: var(--gray); font-size: .8rem; }
.product-detail .info .desc { margin: 16px 0; line-height: 1.8; color: #444; }
.product-detail .info .bullets { list-style: none; margin: 16px 0; }
.product-detail .info .bullets li { padding: 8px 0; padding-left: 20px; position: relative; }
.product-detail .info .bullets li::before { content: '●'; position: absolute; left: 0; color: var(--accent); font-size: .7rem; top: 12px; }
.product-detail .info .specs { margin: 20px 0; font-size: .9rem; }
.product-detail .info .specs dt { font-weight: 500; margin-top: 8px; }
.product-detail .info .specs dd { color: #555; }
.add-to-cart-btn { display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); padding: 14px 48px; font-size: 1rem; cursor: pointer; transition: opacity .2s; margin-top: 16px; font-family: inherit; }
.add-to-cart-btn:hover { opacity: .85; }

/* === Cart === */
.cart-page { max-width: 800px; margin: 0 auto; }
.cart-item { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; background: #f5f5f5; }
.cart-item .info { flex: 1; }
.cart-item .name { font-weight: 500; }
.cart-item .qty { display: flex; align-items: center; gap: 8px; }
.cart-item .qty button { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 4px; background: none; cursor: pointer; }
.cart-item .remove { color: var(--error); cursor: pointer; font-size: .85rem; }
.cart-total { text-align: right; padding: 20px 0; font-size: 1.2rem; font-weight: 500; }
.checkout-btn { display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); padding: 14px 48px; font-size: 1rem; cursor: pointer; text-decoration: none; }

/* === Auth Forms === */
.auth-form { max-width: 400px; margin: 60px auto; padding: 32px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-form h2 { font-weight: 500; margin-bottom: 24px; text-align: center; }
.auth-form label { display: block; margin-bottom: 4px; font-size: .9rem; font-weight: 500; }
.auth-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; font-family: inherit; font-size: .9rem; }
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form button { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 1rem; font-family: inherit; }
.auth-form .switch { text-align: center; margin-top: 16px; font-size: .9rem; color: var(--gray); }
.auth-form .switch a { color: var(--accent); cursor: pointer; }

/* === Page Headers === */
.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 1.8rem; font-weight: 300; letter-spacing: 2px; }
.page-header p { color: var(--gray); margin-top: 8px; }

/* === Legal Pages === */
.legal-page { max-width: 800px; margin: 0 auto; line-height: 2; }
.legal-page h1 { font-size: 1.6rem; margin-bottom: 24px; font-weight: 500; }
.legal-page h2 { font-size: 1.2rem; margin-top: 32px; margin-bottom: 12px; font-weight: 500; }
.legal-page p { margin: 8px 0; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.legal-page th, .legal-page td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.legal-page th { background: #f5f5f5; font-weight: 500; }

/* === Contact Page === */
.contact-form { max-width: 600px; margin: 0 auto; }
.contact-form label { display: block; margin-bottom: 4px; font-weight: 500; }
.contact-form input, .contact-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; font-family: inherit; font-size: .9rem; }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-form button { padding: 12px 40px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 1rem; font-family: inherit; }

/* === Footer === */
.footer { background: var(--primary); color: #ccc; padding: 40px 20px; margin-top: 80px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.footer-links a { color: #aaa; text-decoration: none; font-size: .85rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: .8rem; color: #666; text-align: center; }

/* === Responsive === */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .nav { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 8px; }
    .nav a { white-space: nowrap; }
    .hero h1 { font-size: 1.6rem; }
    .product-detail { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card img { height: 200px; }
}
