/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.cn/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS Variables ===== */
:root {
  --color-primary: #1A1A2E;
  --color-gold: #E8D5B7;
  --color-accent: #C9A96E;
  --color-bg: #FAFAFA;
  --color-card: #FFFFFF;
  --color-text: #1A1A2E;
  --color-text-secondary: #6B7280;
  --color-border: #E5E7EB;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(26,26,46,0.08);
  --shadow-hover: 0 8px 30px rgba(26,26,46,0.14);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select { font-family: inherit; }

/* ===== Utility ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ===== Navbar ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar .logo {
  font-family: var(--font-heading);
  font-size: 1.5rem; font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1px;
}
.navbar .logo span { color: var(--color-accent); }
.navbar .nav-links { display: flex; gap: 28px; align-items: center; }
.navbar .nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--color-text);
  transition: color 0.2s;
}
.navbar .nav-links a:hover { color: var(--color-accent); }
.cart-badge {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
}
.cart-badge .count {
  position: absolute; top: -8px; right: -10px;
  background: var(--color-accent); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mobile-menu-btn { display: none; font-size: 1.5rem; color: var(--color-primary); }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d2d5e 40%, var(--color-accent) 100%);
  min-height: 520px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201,169,110,0.15) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; max-width: 720px; }
.hero h1 {
  font-family: var(--font-heading);
  font-size: 3rem; font-weight: 700;
  color: #fff; line-height: 1.2;
  margin-bottom: 16px;
  animation: fadeInUp 0.8s ease-out;
}
.hero p {
  color: var(--color-gold); font-size: 1.15rem;
  margin-bottom: 32px; font-weight: 300;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}
.hero .cta-btn {
  display: inline-block;
  background: var(--color-accent); color: #fff;
  padding: 14px 40px; border-radius: 50px;
  font-weight: 600; font-size: 1rem;
  transition: background 0.3s, transform 0.2s;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}
.hero .cta-btn:hover { background: #b8913d; transform: scale(1.02); }

/* ===== Section Title ===== */
.section-title {
  text-align: center; margin: 56px 0 32px;
}
.section-title h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem; font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}
.section-title p {
  color: var(--color-text-secondary); font-size: 1rem;
}

/* ===== Carousel ===== */
.carousel-section { padding: 0 20px 48px; }
.carousel-wrapper {
  position: relative; max-width: 1200px; margin: 0 auto; overflow: hidden;
}
.carousel-track {
  display: flex; gap: 24px;
  transition: transform 0.5s ease;
}
.carousel-card {
  min-width: calc(33.333% - 16px);
  background: var(--color-card); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.carousel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.carousel-card img {
  width: 100%; height: 300px; object-fit: cover; object-position: center;
  background: #f3f4f6;
}
.carousel-card .card-info { padding: 20px; }
.carousel-card .card-info h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem; margin-bottom: 4px;
}
.carousel-card .card-info .price {
  font-size: 1.25rem; font-weight: 700; color: var(--color-accent);
}
.carousel-card .card-info .subtitle {
  font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 8px;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.9); box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: var(--color-primary);
  z-index: 2; transition: background 0.2s;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

/* ===== Categories ===== */
.categories { padding: 40px 0 56px; }
.category-grid {
  display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;
}
.category-item {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: transform 0.2s;
}
.category-item:hover { transform: translateY(-3px); }
.category-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #2d2d5e);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--color-gold);
  box-shadow: 0 4px 16px rgba(26,26,46,0.12);
}
.category-item span {
  font-size: 0.9rem; font-weight: 500; color: var(--color-text);
}

/* ===== Product Grid ===== */
.products-section { padding: 0 20px 64px; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px; max-width: 1200px; margin: 0 auto;
}
.product-card {
  background: var(--color-card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.product-card img {
  width: 100%; height: 220px; object-fit: contain; object-position: center;
  background: #f9f9f9; padding: 12px;
}
.product-card .card-info { padding: 16px; }
.product-card .card-info h3 {
  font-size: 0.95rem; font-weight: 600; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-card .card-info .subtitle {
  font-size: 0.8rem; color: var(--color-text-secondary); margin-bottom: 6px;
}
.product-card .card-info .price {
  font-size: 1.1rem; font-weight: 700; color: var(--color-accent);
}
.product-card .card-info .add-btn {
  margin-top: 10px; width: 100%; padding: 8px;
  background: var(--color-primary); color: #fff;
  border-radius: 8px; font-weight: 600; font-size: 0.85rem;
  transition: background 0.2s, transform 0.15s;
}
.product-card .card-info .add-btn:hover { background: #2d2d5e; transform: scale(1.02); }

/* ===== Trust Badges ===== */
.trust-section {
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 48px 20px;
}
.trust-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; max-width: 900px; margin: 0 auto; text-align: center;
}
.trust-item .icon {
  font-size: 2.5rem; margin-bottom: 12px; color: var(--color-accent);
}
.trust-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.trust-item p { font-size: 0.85rem; color: var(--color-text-secondary); }

/* ===== Footer ===== */
.footer {
  background: var(--color-primary); color: rgba(255,255,255,0.7);
  padding: 48px 20px 24px;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px; max-width: 1200px; margin: 0 auto;
}
.footer h4 {
  font-family: var(--font-heading);
  color: var(--color-gold); font-size: 1rem; margin-bottom: 14px;
}
.footer a { color: rgba(255,255,255,0.7); transition: color 0.2s; font-size: 0.9rem; }
.footer a:hover { color: var(--color-accent); }
.footer ul li { margin-bottom: 8px; }
.footer-bottom {
  text-align: center; margin-top: 32px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem; max-width: 1200px; margin-left: auto; margin-right: auto;
}

/* ===== Product Detail ===== */
.product-detail { padding: 40px 20px 64px; }
.product-detail .container {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  max-width: 1100px; margin: 0 auto;
}
.detail-image {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
  display: flex; align-items: center; justify-content: center;
}
.detail-image img { max-height: 400px; object-fit: contain; }
.detail-info h1 {
  font-family: var(--font-heading); font-size: 2rem; margin-bottom: 8px;
}
.detail-info .price {
  font-size: 1.5rem; font-weight: 700; color: var(--color-accent); margin-bottom: 16px;
}
.detail-info .desc {
  color: var(--color-text-secondary); line-height: 1.7; margin-bottom: 24px;
}
.detail-info .meta { margin-bottom: 24px; }
.detail-info .meta span {
  display: inline-block; padding: 4px 12px;
  background: #f3f4f6; border-radius: 6px;
  font-size: 0.85rem; margin-right: 8px; margin-bottom: 6px;
}
.detail-info .qty-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.detail-info .qty-row label { font-weight: 500; }
.detail-info .qty-row input {
  width: 60px; padding: 8px; border: 1px solid var(--color-border);
  border-radius: 8px; text-align: center; font-size: 1rem;
}
.detail-info .add-cart-btn {
  display: inline-block; background: var(--color-accent);
  color: #fff; padding: 14px 40px; border-radius: 50px;
  font-weight: 600; font-size: 1rem;
  transition: background 0.2s, transform 0.15s;
}
.detail-info .add-cart-btn:hover { background: #b8913d; transform: scale(1.02); }

/* ===== Cart Page ===== */
.cart-page { padding: 40px 20px 64px; }
.cart-page .container { max-width: 1000px; margin: 0 auto; }
.cart-page h1 {
  font-family: var(--font-heading); font-size: 2rem; margin-bottom: 32px; text-align: center;
}
.cart-empty {
  text-align: center; padding: 60px 20px;
  color: var(--color-text-secondary);
}
.cart-empty a { color: var(--color-accent); font-weight: 600; }
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.cart-table th {
  text-align: left; padding: 12px; font-weight: 600; font-size: 0.85rem;
  border-bottom: 2px solid var(--color-border); color: var(--color-text-secondary);
}
.cart-table td {
  padding: 16px 12px; border-bottom: 1px solid var(--color-border); vertical-align: middle;
}
.cart-table .product-cell { display: flex; align-items: center; gap: 12px; }
.cart-table .product-cell img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: #f9f9f9; }
.cart-table .qty-ctrl { display: flex; align-items: center; gap: 8px; }
.cart-table .qty-ctrl button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  background: #fff; transition: background 0.15s;
}
.cart-table .qty-ctrl button:hover { background: #f3f4f6; }
.cart-table .qty-ctrl span { min-width: 24px; text-align: center; font-weight: 600; }
.cart-table .remove-btn { color: #ef4444; font-size: 0.85rem; cursor: pointer; }
.cart-table .remove-btn:hover { text-decoration: underline; }
.cart-summary {
  display: flex; justify-content: flex-end;
}
.cart-summary .summary-box {
  background: var(--color-card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; min-width: 300px;
}
.cart-summary .row {
  display: flex; justify-content: space-between; margin-bottom: 12px;
  font-size: 0.95rem;
}
.cart-summary .row.total {
  font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--color-border);
  padding-top: 12px; margin-top: 12px;
}
.cart-summary .checkout-btn {
  display: block; width: 100%; margin-top: 20px;
  background: var(--color-accent); color: #fff;
  padding: 14px; border-radius: 50px; font-weight: 600; font-size: 1rem;
  text-align: center; transition: background 0.2s, transform 0.15s;
}
.cart-summary .checkout-btn:hover { background: #b8913d; transform: scale(1.02); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
  background: #fff; border-radius: 16px; padding: 36px;
  max-width: 460px; width: 90%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal h2 {
  font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 8px;
}
.modal p { color: var(--color-text-secondary); font-size: 0.9rem; margin-bottom: 20px; }
.modal label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.9rem; }
.modal input[type="email"],
.modal input[type="text"],
.modal input[type="password"],
.modal input[type="tel"] {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--color-border);
  border-radius: 10px; font-size: 1rem; margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}
.modal input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(201,169,110,0.12); background: #fff; }
.modal .input-group {
  position: relative;
  margin-bottom: 20px;
}
.modal .input-group .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #b0b0b0; display: flex; align-items: center; justify-content: center;
  transition: color 0.2s; pointer-events: none; z-index: 1;
}
.modal .input-group input {
  width: 100%; padding: 16px 44px 16px 48px;
  border: 1.5px solid var(--color-border); border-radius: 14px;
  font-size: 1rem; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  background: #fff; margin-bottom: 0;
}
.modal .input-group input::placeholder { color: transparent; }
.modal .input-group input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(201,169,110,0.12); background: #fff; }
.modal .input-group label {
  position: absolute; left: 48px; top: 50%; transform: translateY(-50%);
  font-size: 0.95rem; font-weight: 400; color: #9ca3af;
  pointer-events: none; transition: all 0.2s ease;
  background: transparent; padding: 0 4px; line-height: 1;
}
.modal .input-group input:focus ~ label,
.modal .input-group input:not(:placeholder-shown) ~ label {
  top: 0; left: 14px; transform: translateY(-50%);
  font-size: 0.72rem; font-weight: 600; color: var(--color-accent);
  background: #fff; padding: 0 6px; letter-spacing: 0.5px;
}
.modal .input-group input:focus ~ .input-icon { color: var(--color-accent); }
.modal .input-group .toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #b0b0b0; cursor: pointer; padding: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s; z-index: 1;
}
.modal .input-group .toggle-pw:hover { color: var(--color-accent); }
.modal .btn-primary {
  display: block; width: 100%; background: var(--color-accent);
  color: #fff; padding: 12px; border-radius: 50px;
  font-weight: 600; font-size: 1rem; text-align: center;
  transition: background 0.2s;
}
.modal .btn-primary:hover { background: #b8913d; }
.modal .btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.modal .btn-secondary {
  display: block; width: 100%; background: transparent;
  color: var(--color-text-secondary); padding: 10px; border-radius: 50px;
  font-weight: 500; font-size: 0.9rem; text-align: center; margin-top: 8px;
}
.modal .error-msg { color: #ef4444; font-size: 0.85rem; margin-top: -10px; margin-bottom: 12px; }
.modal .success-msg { color: #22c55e; font-size: 0.85rem; margin-bottom: 12px; }

/* ===== Payment Methods ===== */
.payment-methods { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.payment-method {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border: 2px solid var(--color-border);
  border-radius: 12px; cursor: pointer; transition: border-color 0.2s;
}
.payment-method:hover, .payment-method.selected { border-color: var(--color-accent); }
.payment-method .radio {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--color-border); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.payment-method.selected .radio { border-color: var(--color-accent); }
.payment-method.selected .radio::after {
  content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent);
}
.payment-method .pm-logo { font-weight: 700; font-size: 1.1rem; color: var(--color-primary); }
.payment-method .pm-desc { font-size: 0.8rem; color: var(--color-text-secondary); }

/* ===== Policy Pages ===== */
.policy-page { padding: 48px 20px 64px; }
.policy-page .container { max-width: 800px; margin: 0 auto; }
.policy-page h1 {
  font-family: var(--font-heading); font-size: 2.2rem; margin-bottom: 24px; text-align: center;
}
.policy-page h2 { font-size: 1.3rem; margin: 28px 0 12px; color: var(--color-primary); }
.policy-page p { margin-bottom: 14px; line-height: 1.7; color: var(--color-text-secondary); }
.policy-page ul { margin-bottom: 14px; padding-left: 20px; }
.policy-page ul li { margin-bottom: 8px; color: var(--color-text-secondary); line-height: 1.6; }

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* ===== Toast ===== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--color-primary); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease-out;
  display: flex; align-items: center; gap: 8px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .carousel-card { min-width: calc(50% - 12px); }
}
@media (max-width: 768px) {
  .navbar .nav-links { display: none; }
  .navbar .nav-links.open {
    display: flex; flex-direction: column; position: absolute;
    top: 64px; left: 0; right: 0; background: #fff;
    padding: 16px 24px; border-bottom: 1px solid var(--color-border);
    gap: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  .mobile-menu-btn { display: block; }
  .hero h1 { font-size: 2rem; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .carousel-card { min-width: calc(80% - 8px); }
  .footer-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; gap: 24px; }
  .product-detail .container { grid-template-columns: 1fr; }
  .cart-table { font-size: 0.85rem; }
  .cart-summary { justify-content: stretch; }
  .cart-summary .summary-box { min-width: auto; width: 100%; }
  .category-grid { gap: 24px; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .product-card img { height: 160px; }
  .hero { min-height: 400px; padding: 60px 16px; }
  .hero h1 { font-size: 1.7rem; }
}
