:root {
  --ink: #17150f;
  --muted: #6f6a5e;
  --line: #e7e2d8;
  --bg: #f7f4ee;
  --card: #ffffff;
  --accent: #17150f;
  --accent-ink: #ffffff;
  --star: #b98a2f;
  --green: #1e7e4e;
  --red: #c0392b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23,21,15,.05), 0 12px 32px rgba(23,21,15,.07);
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 20px; height: 72px; }
.brand { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: .2px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--star); font-style: italic; }
.search-wrap { flex: 1; max-width: 520px; margin: 0 auto; }
.search-wrap input {
  width: 100%; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; background: var(--bg); outline: none;
}
.search-wrap input:focus { border-color: var(--ink); background: #fff; }
.cart-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  background: #fff; cursor: pointer; color: var(--ink);
}
.cart-btn:hover { border-color: var(--ink); }
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px;
  background: var(--star); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.trust-bar { background: var(--ink); color: #fff; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; }
.trust-bar .container { display: flex; justify-content: center; gap: 14px 30px; padding: 9px 20px; flex-wrap: wrap; }
.trust-bar span { opacity: .92; display: inline-flex; align-items: center; gap: 8px; }
.trust-bar span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--star); flex: 0 0 auto; }

/* Hero */
.hero {
  text-align: center; padding: 72px 0 40px; position: relative;
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(185,138,47,.10), transparent 70%),
    linear-gradient(180deg, #fbf9f4 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-family: var(--font-display); font-size: 46px; font-weight: 600; letter-spacing: -.5px; line-height: 1.12; }
.hero p { color: var(--muted); margin-top: 14px; font-size: 17px; max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-cta {
  display: inline-block; margin-top: 26px; padding: 14px 34px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .3px;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 20px rgba(23,21,15,.18);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(23,21,15,.24); }

/* Chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 18px 0 28px; }
.chip {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; cursor: pointer; color: var(--muted);
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; padding-bottom: 64px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
  border: 1px solid rgba(231,226,216,.7);
}
.card:hover { transform: translateY(-4px); box-shadow: 0 4px 8px rgba(23,21,15,.06), 0 20px 44px rgba(23,21,15,.12); }
.card-img { position: relative; aspect-ratio: 1; background: #efece5; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.badge {
  position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge.sale { background: var(--red); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.card-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.stars { color: var(--star); font-size: 13px; letter-spacing: 1px; }
.stars .count { color: var(--muted); font-size: 12px; margin-left: 5px; letter-spacing: 0; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 12px; gap: 10px; }
.price-wrap { display: flex; align-items: baseline; gap: 8px; }
.price { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.price-was { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.add-btn {
  padding: 10px 18px; border: none; border-radius: 999px; background: var(--accent);
  color: var(--accent-ink); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease; white-space: nowrap;
}
.add-btn:hover { background: #2c281d; box-shadow: 0 6px 16px rgba(23,21,15,.2); }
.add-btn:active { transform: scale(.97); }

/* Footer */
.site-footer { background: #14120d; color: #cfc9bd; border-top: 1px solid var(--line); margin-top: 24px; }
.footer-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 48px 20px 28px; }
.footer-legal a { color: #cfc9bd; text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }
.footer-brand { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: #fff; }
.footer-brand span { color: var(--star); font-style: italic; }
.site-footer p, .site-footer li { color: #a89f8f; font-size: 13px; margin-top: 6px; }
.site-footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: #fff; margin-bottom: 4px; }
.site-footer ul { list-style: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 20px; font-size: 12px; color: #8a8272; text-align: center; }

/* Overlay + drawer */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.overlay.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100vw);
  background: #fff; z-index: 100; transform: translateX(100%);
  transition: transform .25s ease; display: flex; flex-direction: column;
  box-shadow: -8px 0 30px rgba(0,0,0,.12);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 18px; }
.icon-btn { border: none; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.icon-btn:hover { color: var(--ink); }
.free-ship { padding: 12px 20px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.free-ship .bar { height: 5px; background: var(--line); border-radius: 999px; margin-top: 7px; overflow: hidden; }
.free-ship .bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 20px; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #f0f0ee; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.ci-price { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ci-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty-btn {
  width: 26px; height: 26px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 14px; line-height: 1;
}
.qty-btn:hover { border-color: var(--ink); }
.ci-qty { font-size: 13px; min-width: 20px; text-align: center; }
.ci-remove { border: none; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; margin-left: auto; }
.ci-remove:hover { color: var(--red); }
.ci-total { font-size: 14px; font-weight: 700; white-space: nowrap; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px; }
.totals { font-size: 14px; }
.totals .row { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); }
.totals .row.grand { font-size: 17px; font-weight: 700; color: var(--ink); margin-top: 10px; }
.checkout-btn {
  width: 100%; margin-top: 12px; padding: 14px; border: none; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 700; cursor: pointer;
}
.checkout-btn:hover { opacity: .88; }
.checkout-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 110; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; background: rgba(0,0,0,.5); padding: 40px 16px; }
.modal.show { display: flex; }
.modal-card { position: relative; background: #fff; border-radius: 14px; width: 100%; max-width: 560px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-close { position: absolute; top: 12px; right: 14px; }
.co-title { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-bottom: 4px; letter-spacing: -.2px; }
.co-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.co-steps { display: flex; gap: 8px; margin-bottom: 20px; }
.co-step { font-size: 12px; color: var(--muted); padding: 5px 12px; border-radius: 999px; background: var(--bg); }
.co-step.active { background: var(--ink); color: #fff; font-weight: 600; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none; background: #fff;
}
.field input:focus, .field select:focus { border-color: var(--ink); }
.field .err { border-color: var(--red) !important; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.co-actions { display: flex; gap: 10px; margin-top: 18px; }
.co-actions button { flex: 1; padding: 13px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn-primary { border: none; background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .88; }
.btn-ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.pay-note { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pay-error { background: #fdecea; color: var(--red); font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-top: 12px; }
.pay-icons { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; }
.pay-icon {
  height: 30px; min-width: 46px; padding: 0 10px; border-radius: 6px; background: #fff;
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: .3px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.pay-icon.visa { color: #1a1f71; font-style: italic; }
.pay-icon.mc { font-size: 0; position: relative; }
.pay-icon.mc::before, .pay-icon.mc::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; }
.pay-icon.mc::before { background: #eb001b; left: 9px; }
.pay-icon.mc::after { background: #f79e1b; opacity: .92; left: 19px; }
.pay-icon.amex { color: #2e77bc; }
.pay-icon.discover { color: #e65c00; font-size: 9px; }
.secure-row {
  display: flex; align-items: center; gap: 8px; background: #f2f7f3; border: 1px solid #dcebe0;
  color: #1e5c3c; font-size: 12px; font-weight: 600; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px;
}
.secure-row svg { flex: 0 0 auto; }
#payment-element, #card-element { margin-bottom: 4px; }
#payment-element .StripeElement, #card-element .StripeElement {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
}
#payment-element .StripeElement--focus, #card-element .StripeElement--focus { border-color: var(--ink); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Confirmation */
.confirm { text-align: center; padding: 10px 0; }
.confirm .check {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  background: #e8f5ee; color: var(--green); font-size: 32px;
  display: flex; align-items: center; justify-content: center;
}
.confirm h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-bottom: 6px; }
.confirm p { color: var(--muted); font-size: 14px; }
.order-id { font-weight: 700; color: var(--ink); }
.confirm .summary { text-align: left; background: var(--bg); border-radius: 10px; padding: 16px; margin-top: 18px; font-size: 13px; }
.confirm .summary .row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.confirm .summary .row.total { font-weight: 700; font-size: 15px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .header-inner { gap: 10px; height: 60px; }
  .brand { font-size: 21px; }
  .search-wrap { max-width: none; }
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; }
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
  .field-row-3 { grid-template-columns: 1fr 1fr; }
}

/* ---------- product detail modal ---------- */
.product-card-modal { max-width: 760px; }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pd-img { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #f0f0ee; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-img .badge { position: absolute; top: 12px; left: 12px; z-index: 2; }
.pd-thumbs { position: absolute; bottom: 10px; left: 10px; right: 10px; z-index: 2; display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.pd-thumb { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 2px solid #fff; background: #fff; padding: 0; cursor: pointer; opacity: .75; transition: opacity .15s, border-color .15s; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb:hover { opacity: 1; }
.pd-thumb.active { border-color: var(--ink); opacity: 1; }
.pd-info { display: flex; flex-direction: column; gap: 10px; }
.pd-name { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.18; letter-spacing: -.2px; }
.pd-price { font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.pd-desc { color: var(--muted); font-size: 14px; line-height: 1.6; }
.pd-controls { display: flex; gap: 12px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pd-qty { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.pd-qty #pd-qty { min-width: 22px; text-align: center; font-weight: 600; }
.pd-add { padding: 12px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.pd-trust { list-style: none; margin-top: 12px; padding: 14px 16px; background: var(--bg); border-radius: 10px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 720px) {
  .pd-grid { grid-template-columns: 1fr; }
  .pd-name { font-size: 20px; }
  .pd-price { font-size: 22px; }
}
