/* Nhụy Atelier – styles
   Palette: moss #12221B · petal #F3D3DA · peony #B3365F · paper #FBF7F7 · stone #5B6862
   Type: Noto Serif Display (tiêu đề) + Be Vietnam Pro (nội dung)
   Điểm nhấn duy nhất: khung vòm ở hero. Phần còn lại giữ yên tĩnh. */

:root {
  --moss: #12221b;
  --moss-2: #1d3329;
  --petal: #f3d3da;
  --petal-2: #f8e6ea;
  --peony: #b3365f;
  --peony-dark: #8f2a4c;
  --paper: #fbf7f7;
  --white: #ffffff;
  --ink: #1a1f1c;
  --stone: #5b6862;
  --line: #e6dadc;
  --danger: #a3262f;

  --font-display: "Noto Serif Display", "Times New Roman", Georgia, serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --header-h: 60px;
  --wrap: 1200px;
  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--peony); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--moss); color: var(--paper); padding: 10px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 12px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* ---------- Thanh flash sale ---------- */
.sale-bar { background: var(--peony); color: #fff; text-align: center; font-size: 14px; padding: 8px 16px; }
.sale-bar p { margin: 0; }
.sale-bar__timer { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 6px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(251, 247, 247, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; }
.brand__name { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--moss); }
.brand__sub { font-size: 13px; color: var(--stone); letter-spacing: 0.04em; }
.site-nav { display: none; gap: 28px; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--stone); padding: 6px 0; border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s; }
.site-nav a:hover { color: var(--moss); border-color: var(--peony); }
.site-header__actions { display: flex; align-items: center; gap: 4px; }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--moss); transition: background 0.2s; }
.icon-btn:hover { background: var(--petal-2); }

.cart-btn__count { position: absolute; top: 3px; right: 1px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--peony); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-btn__count[data-empty="true"] { display: none; }
.cart-btn__count.bump { animation: bump 0.4s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border: 1px solid transparent; border-radius: 999px; font-weight: 500; font-size: 15px; text-decoration: none; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s; }
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; }
.btn--petal { background: var(--petal); color: var(--moss); }
.btn--petal:hover { background: #fff; }
.btn--ghost { border-color: rgba(251, 247, 247, 0.4); color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); background: rgba(255, 255, 255, 0.08); }
.btn--dark { background: var(--moss); color: var(--paper); }
.btn--dark:hover { background: var(--moss-2); }
.btn--dark:disabled { background: var(--stone); cursor: progress; }
.btn--line { border-color: var(--moss); color: var(--moss); min-height: 44px; padding: 0 18px; }
.btn--line:hover { background: var(--moss); color: var(--paper); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--peony-dark); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { background: var(--moss); color: var(--paper); overflow: hidden; }
.hero__inner { width: min(100% - 32px, var(--wrap)); margin-inline: auto; display: grid; gap: 40px; padding: 48px 0 0; }
.hero__copy { max-width: 560px; }
.hero h1 { font-size: clamp(34px, 8.5vw, 64px); font-weight: 400; line-height: 1.08; margin-bottom: 20px; }
.hero__lead { color: rgba(251, 247, 247, 0.78); font-size: 17px; max-width: 46ch; margin-bottom: 28px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__arch { position: relative; margin: 0; justify-self: center; width: min(100%, 420px); }
.hero__arch-frame { aspect-ratio: 4 / 5; border-radius: 999px 999px 0 0; overflow: hidden; background: linear-gradient(160deg, var(--petal), #d98aa2 60%, var(--peony)); }
.hero__arch-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero__note { position: absolute; left: -4px; bottom: 28px; max-width: 220px; background: var(--paper); color: var(--moss); font-size: 13px; line-height: 1.4; padding: 10px 14px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }

/* Một chuyển động duy nhất khi tải trang: vòm hoa mở lên từ dưới */
@media (prefers-reduced-motion: no-preference) {
  .hero__arch-frame { animation: arch-reveal 1.1s var(--ease) both; }
  .hero__copy { animation: copy-in 0.9s var(--ease) 0.15s both; }
  .hero__note { animation: copy-in 0.8s var(--ease) 0.8s both; }
}
@keyframes arch-reveal { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes copy-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Bộ sưu tập ---------- */
.collection { padding: 56px 0 72px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(28px, 5vw, 40px); }
.section-head__sub { color: var(--stone); font-size: 14px; margin: 0; }

.toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.toolbar__selects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; color: var(--stone); transition: border-color 0.2s; }
.field:focus-within { border-color: var(--moss); }
.field input, .field select { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; outline: none; color: var(--ink); }
.field select { cursor: pointer; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; margin-bottom: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--stone); font-size: 14px; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.chip:hover { border-color: var(--moss); color: var(--moss); }
.chip[aria-pressed="true"] { background: var(--moss); border-color: var(--moss); color: var(--paper); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }

.card { display: flex; flex-direction: column; min-width: 0; }
.card__media { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 4px; overflow: hidden; aspect-ratio: 4 / 5; background: linear-gradient(160deg, var(--petal-2), var(--petal)); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card__media:hover img { transform: scale(1.04); }
.card__media.img-failed img { visibility: hidden; }
.card__media.img-failed::after { content: attr(data-name); position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font-family: var(--font-display); font-size: 18px; color: var(--moss); }
.tag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--peony); color: #fff; font-size: 12px; font-weight: 600; }
.tag--out { background: var(--moss); }
.card__body { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; flex: 1; }
.card__name { font-family: var(--font-display); font-size: 18px; font-weight: 500; line-height: 1.25; margin: 0; }
.card__name button { padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; }
.card__name button:hover { color: var(--peony-dark); }
.card__cat { margin: 0; font-size: 13px; color: var(--stone); }
.card__foot { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 8px; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-variant-numeric: tabular-nums; }
.price strong { font-size: 16px; font-weight: 600; }
.price s { font-size: 13px; color: var(--stone); }
.price--sale strong { color: var(--peony-dark); }
.btn-add { min-height: 44px; border: 1px solid var(--moss); border-radius: 999px; background: transparent; color: var(--moss); font-size: 14px; font-weight: 500; transition: background 0.2s, color 0.2s; }
.btn-add:hover:not(:disabled) { background: var(--moss); color: var(--paper); }
.btn-add:disabled { border-color: var(--line); color: var(--stone); cursor: not-allowed; }

.skeleton { aspect-ratio: 4 / 5; border-radius: 4px; background: linear-gradient(100deg, #f1e7e9 30%, #f8eff1 50%, #f1e7e9 70%); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.4s linear infinite; } }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 56px 16px; }
.empty h3 { font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--stone); margin-bottom: 20px; }

/* ---------- Đặt theo ảnh mẫu ---------- */
.custom { background: var(--petal-2); padding: 56px 0; }
.custom__inner { display: grid; gap: 28px; }
.custom h2 { font-size: clamp(26px, 5vw, 38px); margin-bottom: 12px; }
.custom p { color: var(--stone); max-width: 52ch; margin: 0; }
.custom__list { display: grid; gap: 0; align-content: start; }
.custom__list li { padding: 14px 0; border-top: 1px solid rgba(18, 34, 27, 0.18); }
.custom__list li:last-child { border-bottom: 1px solid rgba(18, 34, 27, 0.18); }

/* ---------- Footer ---------- */
.site-footer { background: var(--moss); color: rgba(251, 247, 247, 0.8); padding: 48px 0 56px; font-size: 15px; }
.site-footer__inner { display: grid; gap: 28px; }
.site-footer p { margin: 0 0 8px; }
.brand--footer .brand__name { color: var(--paper); }
.brand--footer .brand__sub { color: rgba(251, 247, 247, 0.6); }
.footer-title { font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--paper); margin-bottom: 10px; letter-spacing: 0; }

/* ---------- Drawer giỏ hàng ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(18, 34, 27, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.is-open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; display: flex; flex-direction: column; width: min(100%, 440px); height: 100dvh; background: var(--paper); transform: translateX(100%); transition: transform 0.35s var(--ease); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18); }
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 24px; }
.drawer__view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.checkout { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer__scroll { flex: 1; overflow-y: auto; padding: 16px 20px; overscroll-behavior: contain; }
.drawer__foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--paper); }

.cart-lines { display: grid; gap: 0; }
.cart-line { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line__img { width: 76px; aspect-ratio: 4 / 5; border-radius: 4px; object-fit: cover; background: linear-gradient(160deg, var(--petal-2), var(--petal)); }
.cart-line__name { font-family: var(--font-display); font-size: 16px; line-height: 1.25; margin: 0 0 2px; }
.cart-line__price { font-size: 14px; color: var(--stone); margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.cart-line__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.qty button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 18px; line-height: 1; }
.qty button:hover:not(:disabled) { background: var(--petal-2); }
.qty button:disabled { color: #b7b0b1; cursor: not-allowed; }
.qty output { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 500; }
.cart-line__total { font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-empty { text-align: center; padding: 56px 8px; color: var(--stone); }
.cart-empty__title { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 4px; }

.ship-note { font-size: 13px; color: var(--stone); margin: 0 0 12px; }
.promo { display: flex; gap: 8px; }
.promo input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); text-transform: uppercase; }
.promo input:focus { outline: none; border-color: var(--moss); }
.promo__msg { min-height: 20px; margin: 6px 0 0; font-size: 13px; color: var(--stone); }
.promo__msg.is-ok { color: #1f6b43; }
.promo__msg.is-error { color: var(--danger); }
.promo__hints { margin: 0 0 8px; font-size: 12.5px; color: var(--stone); }
.promo__hints button { margin: 0 4px 4px 0; padding: 2px 10px; border: 1px dashed var(--stone); border-radius: 999px; background: none; font-size: 12.5px; }
.promo__hints button:hover { border-color: var(--peony); color: var(--peony-dark); }

.summary { margin: 0 0 14px; display: grid; gap: 6px; font-size: 14px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.summary dt { color: var(--stone); }
.summary dd { margin: 0; text-align: right; }
.summary .is-saving dd { color: var(--peony-dark); }
.summary .is-total { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 600; }
.summary .is-total dt { color: var(--ink); }
.summary--compact { margin-top: 20px; }

/* ---------- Thanh toán ---------- */
.checkout__title { font-size: 24px; margin: 8px 0 16px; }
.input { display: grid; gap: 6px; margin-bottom: 14px; }
.input > span { font-size: 14px; font-weight: 500; }
.input input, .input textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); resize: vertical; }
.input input:focus, .input textarea:focus { outline: none; border-color: var(--moss); }
.input input:user-invalid, .input textarea:user-invalid { border-color: var(--danger); }
.upload input[type="file"] { width: 100%; font-size: 14px; padding: 10px; border: 1px dashed var(--stone); border-radius: 8px; background: var(--white); }
.upload__preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 14px; color: var(--stone); }
.upload__preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.form-error { min-height: 20px; margin: 8px 0 0; color: var(--danger); font-size: 14px; }
.fine { margin: 10px 0 0; font-size: 12.5px; color: var(--stone); text-align: center; }

.done { text-align: center; padding-top: 40px; }
.done__title { font-size: 28px; margin-bottom: 16px; }
.done p { color: var(--stone); }
.done__code { font-family: var(--font-display); font-size: 30px; letter-spacing: 0.04em; color: var(--moss) !important; margin: -8px 0 16px; }
.done .summary { text-align: left; margin-bottom: 24px; }

/* ---------- Dialog sản phẩm ---------- */
.product-dialog { width: min(100% - 24px, 920px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 10px; background: var(--paper); color: var(--ink); overflow: auto; }
.product-dialog::backdrop { background: rgba(18, 34, 27, 0.6); }
.product-dialog__close { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(251, 247, 247, 0.9); }
.pd { display: grid; }
.pd__img { aspect-ratio: 4 / 4.4; background: linear-gradient(160deg, var(--petal-2), var(--petal)); }
.pd__img img { width: 100%; height: 100%; object-fit: cover; }
.pd__info { padding: 22px 20px 26px; }
.pd__cat { font-size: 14px; color: var(--stone); margin-bottom: 6px; }
.pd__name { font-size: clamp(26px, 5vw, 34px); margin-bottom: 12px; }
.pd__price { margin-bottom: 16px; }
.pd__price strong { font-size: 22px; }
.pd__desc { color: var(--stone); margin-bottom: 20px; }
.pd__stock { font-size: 13px; color: var(--stone); margin-bottom: 14px; }
.pd__buy { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.pd__buy .btn { flex: 1; }
.pd__related { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.pd__related h3 { font-size: 18px; margin-bottom: 12px; }
.pd__related ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pd__related button { width: 100%; padding: 0; border: 0; background: none; text-align: left; font-size: 12.5px; line-height: 1.3; }
.pd__related img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: 4px; margin-bottom: 4px; background: var(--petal-2); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 80; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 10px; background: var(--moss); color: var(--paper); font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); transform: translate(-50%, 24px); opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease); }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .toolbar { grid-template-columns: 1fr auto; align-items: center; }
  .toolbar__selects { grid-template-columns: 180px 170px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 20px; }
  .site-footer__inner { grid-template-columns: 1.2fr 1fr 1fr; }
  .custom__inner { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 56px; }
}
@media (min-width: 860px) {
  :root { --header-h: 68px; }
  .site-nav { display: flex; }
  #searchToggle { display: none; }
  .hero__inner { grid-template-columns: 1.1fr 0.9fr; align-items: end; gap: 56px; padding-top: 72px; }
  .hero__copy { padding-bottom: 80px; }
  .hero__arch { justify-self: end; width: 100%; }
  .pd { grid-template-columns: 1fr 1fr; }
  .pd__img { aspect-ratio: auto; min-height: 520px; }
  .pd__info { padding: 36px 32px; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .collection { padding: 72px 0 96px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .drawer, .overlay, .toast { transition: none; }
  .card__media img { transition: none; }
}
