:root {
  --paper: #f5f0e8;
  --card: #fbf8f3;
  --ink: #2b211a;
  --muted: #7d6f63;
  --line: #e2d8c9;
  --accent: #a8532b;
  --accent-ink: #fff8f0;
  --well: #e9e0d2;
  --body2: #54473c;
  --field: #fff;
  --err: #b3261e;
  --shadow: rgba(43, 33, 26, .45);
  --edge: rgba(43, 33, 26, .25);
  --stage-top: #efe8dc;
  --stage-bottom: #ddd2c1;
  color-scheme: light;
  --radius: 14px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  --paper: #191512;
  --card: #231e1a;
  --ink: #f1e9dd;
  --muted: #a99a8b;
  --line: #3a322b;
  --accent: #e08a5c;
  --accent-ink: #1d140e;
  --well: #2b2420;
  --body2: #d4c8ba;
  --field: #1d1915;
  --err: #ff8a80;
  --shadow: rgba(0, 0, 0, .7);
  --edge: rgba(255, 245, 230, .3);
  --stage-top: #2e2723;
  --stage-bottom: #1d1916;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; transition: background .25s, color .25s; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px 80px; }
.wrap.narrow { max-width: 720px; }

/* header / footer */
.top { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; max-width: 1180px; margin: 0 auto; }
.brand { font: 600 26px var(--serif); text-decoration: none; letter-spacing: .01em; }
.top nav { display: flex; gap: 26px; font-size: 15px; }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--accent); }
#cart-count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }
.foot { border-top: 1px solid var(--line); padding: 32px 24px 48px; max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.foot strong { font: 600 20px var(--serif); color: var(--ink); display: block; }
.foot-contact { display: flex; flex-direction: column; gap: 4px; text-align: right; }

/* buttons */
.btn { display: inline-flex; justify-content: center; align-items: center; padding: 14px 28px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); font: 500 15px var(--sans); text-decoration: none; cursor: pointer; transition: transform .12s, background .15s, color .15s; }
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.wide { width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* hero */
.hero { max-width: 1180px; margin: 0 auto; padding: 28px 24px 72px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--accent); margin: 0 0 18px; font-weight: 500; }
.hero h1, .hero-title { font-size: clamp(44px, 6vw, 78px); }
.hero h1 em, .hero-title em { font-style: italic; font-weight: 500; color: var(--accent); }
.lead { color: var(--muted); font-size: 17px; max-width: 46ch; margin: 20px 0 28px; }
.hero-img img { border-radius: 220px 220px var(--radius) var(--radius); aspect-ratio: 4/5; object-fit: cover; width: 100%; }

/* grid */
.section-title { font-size: 36px; margin-bottom: 24px; }
.page-title { font-size: clamp(34px, 5vw, 48px); margin: 20px 0 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.card { text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px var(--shadow); }
.card-img { position: relative; aspect-ratio: 1; background: var(--well); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.tag3d { position: absolute; top: 12px; left: 12px; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 600; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; }
.card-body { padding: 18px 20px 20px; }
.card-body h3 { font-size: 26px; }
.card-body p { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.price { font-weight: 600; }
.dots i, .swatch i { display: inline-block; border-radius: 50%; border: 1px solid var(--edge); }
.dots i { width: 14px; height: 14px; margin-left: 4px; }

/* product */
.product { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; padding-top: 12px; align-items: start; }
.gallery { position: sticky; top: 16px; }
.gallery, .buy { min-width: 0; }
.stage { position: relative; aspect-ratio: 1; max-height: calc(100vh - 150px); min-height: 280px; width: 100%; background: var(--well); border-radius: var(--radius); overflow: hidden; }
.stage img { width: 100%; height: 100%; object-fit: contain; }
model-viewer { width: 100%; height: 100%; background: linear-gradient(var(--stage-top), var(--stage-bottom)); --poster-color: transparent; }
.hint3d { position: absolute; bottom: 10px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding: 3px; }
.thumb { flex: 0 0 76px; height: 76px; padding: 0; border: 1.5px solid transparent; border-radius: 10px; overflow: hidden; background: var(--well); cursor: pointer; opacity: .75; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on, .thumb:hover { opacity: 1; border-color: var(--ink); }
.thumb3d { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 500 11px var(--sans); color: var(--ink); background: var(--card); border-color: var(--line); opacity: 1; }
.buy h1 { font-size: clamp(40px, 5vw, 56px); margin-top: 14px; }
.buy .lead { margin: 8px 0 0; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }
.bigprice { font-size: 26px; font-weight: 600; margin: 18px 0 8px; }
.opt { padding: 18px 0; border-top: 1px solid var(--line); }
.opt-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-width: 56px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font: 500 15px var(--sans); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--muted); }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip small { display: block; font-size: 12px; font-weight: 400; opacity: .75; margin-top: 2px; }
.size-info { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.size-info:empty { display: none; }
.custom-size { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.custom-size .cs-label { margin: 0 0 6px; font-size: 13px; font-weight: 500; }
.custom-size .small { font-size: 12.5px; margin: 4px 0 0; }
.dims-in { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.dims-in span { color: var(--muted); }
.dims-in input { width: 0; flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); text-align: center; }
.dims-in input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.swatches { display: flex; gap: 12px; }
.swatch { padding: 3px; border-radius: 50%; border: 1.5px solid transparent; background: none; cursor: pointer; line-height: 0; }
.swatch i { width: 34px; height: 34px; }
.swatch.on { border-color: var(--ink); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); }
.qty button { width: 42px; height: 42px; border: 0; background: none; font-size: 20px; color: var(--ink); cursor: pointer; }
.qty input { width: 48px; border: 0; background: none; text-align: center; font: 500 16px var(--sans); color: var(--ink); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.actions .btn { white-space: nowrap; }
@media (max-width: 1000px) { .product { gap: 32px; } }
.actions .btn { flex: 1; }
.added { font-size: 14px; color: var(--accent); margin: 12px 0 0; }
.desc { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--body2); }
.desc p { margin: 0 0 12px; }

/* cart / order */
.checkout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.panel h2 { font-size: 26px; margin-bottom: 16px; }
.panel p { margin: 0 0 6px; }
.pre { white-space: pre-line; }
.cart-row { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-row:first-child { padding-top: 0; }
.cart-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.cart-info { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.cart-info strong { font: 600 22px var(--serif); }
.line { font-weight: 600; white-space: nowrap; }
.qty.small { align-self: flex-start; border: 0; background: none; gap: 6px; margin-top: 4px; }
.qty.small button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; background: var(--card); }
.qty.small span { min-width: 22px; text-align: center; font-weight: 500; }
.qty.small .link { width: auto; border: 0; background: none; font-size: 13px; color: var(--muted); text-decoration: underline; margin-left: 8px; }
form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 14px; }
input, textarea, select { font: 400 15px var(--sans); color: var(--ink); }
form input:not([type=radio]):not([type=checkbox]):not([type=color]):not([type=file]), form textarea, form select { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--field); }
form input:focus, form textarea:focus, form select:focus { outline: none; border-color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 4px 0 16px; }
legend { font-size: 14px; font-weight: 500; margin-bottom: 8px; padding: 0; }
label.radio { font-weight: 400; margin-bottom: 6px; }
.hp { position: absolute !important; left: -9999px; width: 1px !important; height: 1px; opacity: 0; }
.err { color: var(--err); font-size: 13px; font-weight: 400; min-height: 0; display: block; margin: 4px 0 0; }
.sum { margin: 16px 0; }
.sum div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 15px; }
.sum dd { margin: 0; }
.sum .grand { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 19px; font-weight: 600; }
.empty { text-align: center; padding: 60px 0; }
.empty p { color: var(--muted); margin-bottom: 20px; }

@media (max-width: 860px) {
  .hero, .product, .checkout { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding-bottom: 48px; }
  .hero-img { order: -1; }
  .hero-img img { aspect-ratio: 1; border-radius: 120px 120px var(--radius) var(--radius); }
  .gallery { position: static; }
  .wrap { padding: 0 16px 56px; }
  .top { padding: 14px 16px; }
  .foot-contact { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* video review */
.videos { padding-bottom: 80px; }
.video-row { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.video { flex: 0 0 300px; margin: 0; scroll-snap-align: start; }
.video-frame { aspect-ratio: 9/16; border-radius: var(--radius); overflow: hidden; background: #1c1714; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video figcaption { font-size: 13px; margin-top: 8px; }
.video figcaption a { color: var(--muted); }
.video-link { display: inline-block; margin-top: 16px; font-size: 14px; font-weight: 500; color: var(--accent); text-decoration: none; }
.video-link:hover { text-decoration: underline; }
@media (max-width: 860px) { .video { flex-basis: 78vw; max-width: 320px; } }

/* nút đổi giao diện sáng / tối */
.theme-toggle { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 1.5px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; }
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.top nav { align-items: center; }

/* trang chủ: sản phẩm lên đầu */
.shop-top { padding-top: 8px; padding-bottom: 72px; }
.intro { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.intro h1 { font-size: clamp(30px, 4vw, 42px); }
.intro p { margin: 0; font-size: 15px; }
.hero { border-top: 1px solid var(--line); padding-top: 64px; }
@media (max-width: 860px) { .shop-top { padding-bottom: 48px; } .hero { padding-top: 40px; } .hero-img { order: 0; } }
.brand, .top nav a { white-space: nowrap; }
@media (max-width: 860px) {
  .top nav { gap: 16px; }
  .brand { font-size: 22px; }
}
/* điện thoại: 2 sản phẩm mỗi hàng để khách so sánh nhanh */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-body h3 { font-size: 19px; }
  .card-body p { font-size: 12.5px; margin: 2px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .price { font-size: 14px; }
  .dots i { margin: 0 4px 0 0; }
  .tag3d { top: 8px; left: 8px; }
  .intro h1 { font-size: 26px; }
  .intro p { font-size: 13.5px; }
}
.privacy { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; text-align: center; }
