/* ESTILO CON STILETO — clean white fashion storefront (Dawn-inspired) */
:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e8e8e8;
  --bg: #ffffff;
  --soft: #f7f7f7;
  --accent: #8a6d3b;
  --accent-hover: #755c31;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: .5px;
}
.brand-name { font-weight: 700; letter-spacing: 2px; font-size: 15px; }
.category-nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.category-nav button {
  border: 0; background: none; padding: 8px 14px; border-radius: 999px;
  font-size: 14px; color: var(--muted); cursor: pointer;
}
.category-nav button:hover { color: var(--ink); background: var(--soft); }
.category-nav button.active { color: #fff; background: var(--ink); }
.cart-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 18px; font-size: 15px; cursor: pointer;
}
.cart-btn:hover { border-color: var(--ink); }
.cart-btn span {
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 1px 8px; font-size: 12px; margin-left: 4px;
}

/* Hero */
.hero { background: var(--soft); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 1180px; margin: 0 auto; padding: 56px 24px; }
.hero h1 { font-size: clamp(26px, 4vw, 42px); font-weight: 600; letter-spacing: -.5px; }
.hero p { color: var(--muted); margin-top: 8px; font-size: 17px; }

/* Grid */
.product-grid {
  display: grid; gap: 28px; padding: 40px 0 64px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 1; background: var(--soft); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px 18px 20px; }
.card-cat { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.card h3 { font-size: 16px; font-weight: 600; margin: 6px 0 4px; }
.card-price { font-size: 16px; font-weight: 700; }
.card-add {
  margin-top: 12px; width: 100%; padding: 10px;
  border: 1px solid var(--ink); background: #fff; border-radius: 8px;
  font-size: 14px; cursor: pointer;
}
.card-add:hover { background: var(--ink); color: #fff; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); padding: 36px 24px; text-align: center;
  color: var(--muted); font-size: 14px;
}
.pay-note { margin-top: 6px; font-size: 13px; }

/* Modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.45); display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 14px; max-width: 560px; width: 100%;
  max-height: 90vh; overflow: auto; padding: 28px; position: relative;
  box-shadow: var(--shadow);
}
.modal-checkout { max-width: 480px; }
.modal h2 { font-size: 22px; margin-bottom: 12px; }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted);
}
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-img img { width: 100%; border-radius: var(--radius); background: var(--soft); display: block; }
.detail-info h3 { font-size: 22px; margin: 4px 0 8px; }
.stock-badge { display: inline-block; font-size: 13px; font-weight: 600; color: #1c7a3d; background: #e8f7ee; border-radius: 999px; padding: 3px 12px; margin-bottom: 10px; }
.detail-info .price { font-size: 22px; font-weight: 700; margin: 14px 0; }
.detail-info p.desc { color: var(--muted); font-size: 15px; }
.detail-perks { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); display: grid; gap: 6px; }

/* Related products */
.related { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.related h4 { font-size: 16px; margin-bottom: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.related-card { cursor: pointer; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; transition: box-shadow .15s ease; }
.related-card:hover { box-shadow: var(--shadow); }
.related-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--soft); display: block; }
.related-name { font-size: 12.5px; font-weight: 600; padding: 8px 8px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-price { font-size: 13px; font-weight: 700; padding: 2px 8px 10px; }
.qty-row { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.qty-row input { width: 64px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.btn-primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 12px 24px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

/* Cart drawer */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45);
}
.drawer-overlay[hidden] { display: none; }
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(400px, 92vw);
  background: #fff; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-header h2 { font-size: 19px; }
.drawer-body { flex: 1; overflow: auto; padding: 12px 24px; }
.cart-line { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.cart-line-info { flex: 1; }
.cart-line-info h4 { font-size: 14px; font-weight: 600; }
.cart-line-info .unit { color: var(--muted); font-size: 13px; }
.cart-line-controls { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.cart-line-controls button {
  width: 26px; height: 26px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1;
}
.cart-remove { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 0; }
.drawer-footer { padding: 18px 24px 24px; border-top: 1px solid var(--line); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 17px; margin-bottom: 14px; }
.cart-hint { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }

/* Checkout */
.checkout-total { margin-bottom: 18px; font-size: 16px; }
.hero-pickup { margin-top: 10px; font-size: 15px; color: var(--accent); font-weight: 600; }

/* Fulfillment: pickup vs shipping */
.fulfillment { margin-bottom: 16px; }
.fulfillment h3 { font-size: 15px; margin-bottom: 10px; font-weight: 600; }
.fulfill-option { display: block; margin-bottom: 8px; cursor: pointer; }
.fulfill-option input { display: none; }
.fulfill-card {
  display: block; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color .15s ease, background .15s ease;
}
.fulfill-card strong { display: block; font-size: 15px; }
.fulfill-card em { font-style: normal; font-size: 13px; color: var(--muted); }
.fulfill-option input:checked + .fulfill-card {
  border-color: var(--ink); background: var(--soft);
}
.fulfill-detail { margin-bottom: 16px; }
.fulfill-detail[hidden] { display: none; }
.store-line { font-size: 14px; margin-bottom: 4px; }
.muted-sm { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.field {
  width: 100%; padding: 11px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
}
.field:focus { outline: none; border-color: var(--ink); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.payment-status {
  padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px;
}
.payment-status.ok { background: #e8f7ee; color: #1c7a3d; }
.payment-status.err { background: #fdecec; color: #b3261e; }
.secure-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* Wallet buttons (Apple Pay / Google Pay) */
.wallet-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.wallet-buttons > div { min-height: 44px; }
.wallet-buttons > div:empty { display: none; }
/* 钱包按钮加载骨架屏 */
.wallet-skeleton { display: flex; flex-direction: column; gap: 10px; }
.wallet-skeleton[hidden] { display: none; }
.wallet-skeleton span {
  display: block; height: 48px; border-radius: 10px;
  background: linear-gradient(90deg, #f1f1f1 25%, #e2e2e2 50%, #f1f1f1 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
/* 钱包按钮：统一全宽、等高、圆角 */
#googlePayButton { width: 100%; }
#googlePayButton .gpay-button {
  width: 100% !important;
  min-height: 48px !important;
  border-radius: 10px !important;
}
/* Apple Pay 官方按钮样式（Safari 专属） */
.apple-pay-btn {
  -webkit-appearance: -apple-pay-button;
  -apple-pay-button-type: buy;
  -apple-pay-button-style: black;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.wallet-debug { font-size: 12px; color: #9a6a00; background: #fff8e6; border: 1px solid #f0dfae; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }

@media (max-width: 640px) {
  .product-detail { grid-template-columns: 1fr; }
  .header-inner { gap: 14px; flex-wrap: wrap; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { padding: 40px 24px; }
  /* 结算弹窗：移动端底部上滑式 */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 18px 18px 0 0;
    max-height: 94vh;
    padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  }
  .modal-checkout { max-width: none; }
  /* 表单字段更大更好点 */
  .field { font-size: 16px; padding: 14px; }
  .fulfill-card { padding: 14px; }
}
