/* =====================================================================
   Lexia-b – giao diện
   Màu và font nằm ở :root. Khi nhân bản cho nhãn sách khác, đổi các
   biến dưới đây là đủ để có bộ màu mới (màu nhấn: --accent, --accent-soft).
   ===================================================================== */

:root {
  --ink: #596176;          /* màu logo */
  --ink-deep: #2f3442;
  --ink-soft: #666e83;
  --paper: #f6f1e8;        /* nền giấy ngà */
  --paper-2: #ede4d6;
  --paper-3: #e3d8ce;      /* màu nền bộ nhận diện */
  --text: #1f1d1a;
  --muted: #5a5348;
  --rule: #d5cab8;
  --accent: #64775b;       /* xanh sage – dải màu của 5 cuốn sách đầu tiên */
  --accent-soft: #a9b8a0;  /* sage nhạt: đường kẻ, chữ trên nền tối */
  --leather: #4e2620;
  --leather-2: #6b3328;
  --danger: #9b3b2f;
  --ok: #4f6b4a;

  --serif-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --serif: 'EB Garamond', Georgia, serif;

  --wrap: 980px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 2px;
  --shadow-book: 0 1px 1px rgba(40, 30, 20, .08), 0 8px 18px -6px rgba(40, 30, 20, .35), 0 24px 40px -18px rgba(40, 30, 20, .35);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; font-size: 88%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.14rem; /* ≈ 16px */
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

img { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink-deep); }

h1, h2, h3, h4 {
  font-family: var(--serif-display);
  font-weight: 500;
  color: var(--ink-deep);
  line-height: 1.15;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), 640px); margin-inline: auto; }

.eyebrow {
  font-family: var(--serif-display);
  font-size: .9rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 600;
}

.lead { font-size: 1.2rem; color: var(--muted); font-style: italic; }

.ornament {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--accent);
  margin: 2.5rem auto;
  max-width: 320px;
}
.ornament::before, .ornament::after { content: ''; flex: 1; height: 1px; background: var(--accent-soft); }
.ornament span { width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); }

.section { padding: clamp(40px, 6vw, 72px) 0; }
.section--tint { background: var(--paper-2); }
.section__head { text-align: center; margin-bottom: 2.5rem; }

/* ----------------------------- Nút ----------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: var(--serif-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: .95em 2em;
  border: 1px solid var(--ink-deep);
  background: var(--ink-deep);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink-deep); }
.btn--ghost:hover { background: var(--ink-deep); color: var(--paper); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.link-more {
  font-family: var(--serif-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px;
  font-weight: 600;
}

/* ----------------------------- Đầu trang ----------------------------- */

.demo-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: .85rem;
  padding: 6px 16px;
  letter-spacing: .02em;
}

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: relative; z-index: 5; }
.site-header::after { content: ''; display: block; height: 3px; border-bottom: 1px solid var(--rule); }

.site-header__top {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.lang-switch {
  background: none;
  border: 0;
  font-family: var(--serif-display);
  font-size: .85rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 0;
  font-weight: 600;
}
.lang-switch:hover { color: var(--ink-deep); text-decoration: underline; }

.site-header__brand { display: flex; justify-content: center; padding: 6px 0 14px; }
.logo img { width: 147px; height: auto; }

.site-nav {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3.5vw, 44px);
  padding: 10px 0 14px;
  border-top: 1px solid var(--rule);
  width: min(100% - 2 * var(--gutter), 700px);
  margin: 0 auto;
}
.site-nav a {
  white-space: nowrap;
  font-family: var(--serif-display);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink-deep); border-bottom-color: var(--accent); }

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 .35em;
  margin-left: .2em;
  border-radius: 1em;
  background: var(--ink-deep);
  color: var(--paper);
  font-family: var(--serif);
  font-size: .75rem;
  letter-spacing: 0;
  vertical-align: 2px;
}
.cart-count[hidden] { display: none; }

.menu-toggle { display: none; }

@media (max-width: 640px) {
  .site-header__top { padding-top: 6px; }
  .site-header__brand { justify-content: space-between; align-items: center; padding: 0 var(--gutter) 12px; }
  .logo img { width: 112px; }
  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 0 11px;
    cursor: pointer;
  }
  .menu-toggle span { display: block; height: 1px; background: var(--ink-deep); }
  .site-nav { display: none; flex-direction: column; gap: 0; width: 100%; padding: 0; }
  .site-header.is-open .site-nav { display: flex; }
  .site-nav a { padding: 14px var(--gutter); border-bottom: 1px solid var(--rule); }
  .site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--rule); background: var(--paper-2); }
}

/* ----------------------------- Chân trang ----------------------------- */

.site-footer { background: var(--ink-deep); color: #d9d3c7; margin-top: auto; }
.site-footer__inner { width: min(100% - 2 * var(--gutter), var(--wrap)); margin: 0 auto; padding: 56px 0 28px; text-align: center; }
.site-footer__seal { width: 96px; height: auto; margin: 0 auto 10px; }
.site-footer__slogan { font-family: var(--serif-display); font-style: italic; font-size: 1.3rem; letter-spacing: .12em; color: var(--accent-soft); }
.site-footer__cols { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px 72px; margin: 28px 0; }
.site-footer__cols div { display: flex; flex-direction: column; gap: 4px; }
.site-footer h4 { color: #fff; font-size: .95rem; letter-spacing: .24em; text-transform: uppercase; margin-bottom: 6px; }
.site-footer a { color: #d9d3c7; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__copy { font-size: .85rem; color: #9a9588; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 20px; margin: 0; }

/* ----------------------------- Trang chủ ----------------------------- */

.section--dark { background: var(--ink-deep); color: #e9e3d6; }
.section--dark h2 { color: #fff; }
.section--dark .lead { color: #c9c2b4; }
.section--dark .eyebrow { color: var(--accent-soft); }
.subscribe { text-align: center; }
.subscribe__fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0 16px; }
@media (max-width: 640px) { .subscribe__fields { grid-template-columns: 1fr; } }
.section--dark input { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); color: #fff; }
.section--dark input::placeholder { color: #a9a395; }
.section--dark .btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.section--dark .btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.subscribe__msg { min-height: 1.6em; margin: 14px 0 0; color: var(--accent-soft); font-style: italic; }
.subscribe__msg.is-error { color: #f0b3a6; }

.elsewhere { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 22px; }
.elsewhere .field-label { margin: 0 6px 0 0; }
.elsewhere .chip { text-decoration: none; letter-spacing: .08em; }

/* ----------------------------- Lưới sách ----------------------------- */

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px clamp(24px, 3vw, 44px); }
.grid--center { grid-template-columns: repeat(auto-fit, minmax(170px, 210px)); justify-content: center; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid, .grid--center { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; } }

.card__link { display: block; text-decoration: none; color: inherit; }
.card__cover { position: relative; padding: 18px 8% 0; }
.card__cover .cover { transition: transform .35s ease, box-shadow .35s ease; }
.card__link:hover .cover { transform: translateY(-6px); }
.card__badges { position: absolute; top: 6px; left: calc(8% - 12px); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.card__body { text-align: center; padding-top: 30px; }
.card__title { font-size: 1.35rem; margin-bottom: .15em; }
.card__orig { font-style: italic; color: var(--muted); font-size: .95rem; margin-bottom: .2em; font-weight: 500; }
.card__author { font-family: var(--serif-display); letter-spacing: .14em; text-transform: uppercase; font-size: .82rem; color: var(--ink); margin-bottom: .4em; font-weight: 600; }
.card__price { color: var(--ink-deep); margin: 0; }
.card__price span { font-style: italic; color: var(--muted); }
.card--soldout .cover { filter: grayscale(.6) opacity(.75); }
@media (max-width: 520px) {
  .card__cover { padding: 8px 20px 0; }
  .card__badges { left: 12px; }
  .card__body { padding-top: 20px; }
  .card__title { font-size: 1.1rem; }
}

.badge {
  display: inline-block;
  font-family: var(--serif-display);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 9px;
  background: var(--ink-deep);
  color: var(--paper);
  border-radius: var(--radius);
}
.badge--accent { background: var(--accent); }
.badge--muted { background: #8b8578; }

/* ----------------------------- Bìa sách vẽ sẵn ----------------------------- */

.cover {
  aspect-ratio: 2 / 3;
  width: 100%;
  border-radius: 2px 4px 4px 2px;
  box-shadow: var(--shadow-book);
  position: relative;
  overflow: hidden;
  container-type: inline-size;
}
.cover::before { /* gáy sách */
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(255, 255, 255, .08) 60%, rgba(0, 0, 0, .1));
  z-index: 1;
}
.cover--photo img { width: 100%; height: 100%; object-fit: cover; }

.cover__frame {
  position: absolute;
  inset: 7% 8% 7% 11%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5cqw;
  padding: 8cqw 6cqw;
}
.cover__author { font-family: var(--serif-display); font-size: 6cqw; letter-spacing: .22em; text-transform: uppercase; }
.cover__title { font-family: var(--serif-display); font-size: 11cqw; line-height: 1.05; font-weight: 500; }
.cover__rule { width: 30%; height: 1px; background: currentColor; opacity: .6; }
.cover__mark { font-family: var(--serif-display); font-size: 13cqw; line-height: 1; margin-top: auto; }
.cover__brand { font-family: var(--serif-display); font-size: 4.6cqw; letter-spacing: .3em; text-transform: lowercase; opacity: .85; }

.cover--leather {
  background:
    radial-gradient(120% 80% at 30% 20%, rgba(255, 255, 255, .08), transparent 60%),
    radial-gradient(circle at 70% 80%, rgba(0, 0, 0, .25), transparent 55%),
    repeating-radial-gradient(circle at 40% 40%, rgba(0, 0, 0, .05) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, var(--leather-2), var(--leather));
  color: #d8b878;
}
.cover--leather .cover__frame { border: 1px solid rgba(216, 184, 120, .7); outline: 1px solid rgba(216, 184, 120, .35); outline-offset: 3cqw; }
.cover--leather .cover__title { color: #e6c98d; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }

.cover--hard {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .04) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #6a7288, var(--ink-deep));
  color: #efe7d8;
}
.cover--hard .cover__frame { border: 1px solid rgba(239, 231, 216, .45); }

.cover--soft {
  background: linear-gradient(160deg, #f3ecdf, #e6dccb);
  color: var(--ink-deep);
}
.cover--soft .cover__frame { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.cover--soft .cover__mark { color: var(--ink); }

/* ----------------------------- Danh sách sách ----------------------------- */

.page-head { text-align: center; padding: clamp(40px, 7vw, 72px) 0 24px; }
.page-head .lead { max-width: 32em; margin-inline: auto; }

.toolbar { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; margin-bottom: 40px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.chip {
  font-family: var(--serif-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
}
.chip[aria-pressed="true"], .chip:hover { background: var(--ink-deep); border-color: var(--ink-deep); color: var(--paper); }
.search { flex: 0 1 300px; }
.search input { width: 100%; }

/* ----------------------------- Chi tiết sách ----------------------------- */

.detail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 88px); align-items: start; padding: 32px 0 64px; }
.detail__media { position: sticky; top: 24px; padding: 12px 10% 0; }
.detail__gallery { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.detail__gallery button { border: 1px solid var(--rule); background: none; padding: 0; width: 60px; cursor: pointer; }
.detail__gallery img { aspect-ratio: 2/3; object-fit: cover; width: 100%; }
.detail__back { display: inline-block; margin: 24px 0 0; font-style: italic; text-decoration: none; }
.detail__orig { font-style: italic; color: var(--muted); font-size: 1.25rem; margin-top: -.3em; }
.detail__author { font-family: var(--serif-display); font-size: 1.05rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); font-weight: 600; }
.detail__summary { font-size: 1.2rem; font-style: italic; color: var(--text); border-left: 2px solid var(--accent-soft); padding-left: 18px; margin: 1.5em 0; }
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .detail__media { position: static; width: 100%; max-width: 280px; margin: 0 auto; }
}

.editions { border: 0; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.editions legend, .field-label { font-family: var(--serif-display); font-size: .9rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; padding: 0; }
.edition { position: relative; }
.edition input { position: absolute; opacity: 0; pointer-events: none; }
.edition label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 16px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color .2s, background .2s;
}
.edition label:hover { border-color: var(--ink-soft); }
.edition input:checked + label { border-color: var(--ink-deep); background: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.edition input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.edition input:disabled + label { opacity: .55; cursor: not-allowed; }
.edition__name { font-family: var(--serif-display); font-size: 1.3rem; font-weight: 600; color: var(--ink-deep); }
.edition__price { font-size: 1.15rem; color: var(--ink-deep); text-align: right; }
.edition__meta { grid-column: 1 / -1; font-size: .95rem; color: var(--muted); }
.edition__stock { font-style: italic; }
.edition__stock--low { color: var(--danger); }

.buy { display: flex; gap: 12px; align-items: stretch; margin-top: 22px; flex-wrap: wrap; }
.buy .btn { flex: 1 1 180px; }
.qty { display: inline-flex; border: 1px solid var(--rule); background: #fff; border-radius: var(--radius); }
.qty button { background: none; border: 0; width: 42px; font-size: 1.2rem; cursor: pointer; color: var(--ink-deep); }
.qty input { width: 46px; border: 0; text-align: center; font: inherit; background: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.note { font-size: .95rem; color: var(--muted); font-style: italic; margin-top: 18px; padding-left: 26px; position: relative; }
.note::before { content: 'Φ'; position: absolute; left: 0; top: -1px; font-style: normal; color: var(--accent); font-family: var(--serif-display); font-size: 1.1rem; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 36px 0; padding: 22px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts dt { font-family: var(--serif-display); letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; color: var(--muted); padding-top: 3px; font-weight: 600; }
.facts dd { margin: 0; }

.prose { font-size: 1.12rem; }
.prose p:first-of-type::first-letter { font-family: var(--serif-display); float: left; font-size: 3.6em; line-height: .85; padding: .06em .08em 0 0; color: var(--ink-deep); }

/* ----------------------------- Biểu mẫu ----------------------------- */

input[type="text"], input[type="tel"], input[type="email"], input[type="search"], select, textarea {
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  background: #fffdf9;
  border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(89, 97, 118, .15); }
textarea { min-height: 96px; resize: vertical; }
select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23596176' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select:disabled { opacity: .55; }
label { display: block; }

.field { margin-bottom: 16px; }
.field label { font-size: .95rem; color: var(--ink-deep); margin-bottom: 5px; }
.field .req { color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pay-options { display: grid; gap: 10px; margin-bottom: 18px; }
.pay-option label { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--rule); background: rgba(255, 255, 255, .35); cursor: pointer; border-radius: var(--radius); }
.pay-option input { margin-top: 6px; accent-color: var(--ink-deep); }
.pay-option strong { display: block; font-weight: 500; color: var(--ink-deep); }
.pay-option small { color: var(--muted); font-size: .9rem; }
.pay-option input:checked ~ span strong { text-decoration: underline; text-decoration-color: var(--accent); }
.pay-option:has(input:checked) label { border-color: var(--ink-deep); background: #fff; }

/* ----------------------------- Giỏ hàng / đặt hàng ----------------------------- */

.checkout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-bottom: 72px; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }

.panel { background: #fffdf9; border: 1px solid var(--rule); padding: clamp(20px, 3vw, 32px); border-radius: var(--radius); }
.panel + .panel { margin-top: 24px; }
.panel h2 { font-size: 1.6rem; }
.summary { position: sticky; top: 24px; }
@media (max-width: 900px) { .summary { position: static; } }

.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.line:first-child { padding-top: 0; }
.line .cover { box-shadow: 0 4px 10px -4px rgba(40, 30, 20, .4); }
.line__title { font-family: var(--serif-display); font-size: 1.2rem; font-weight: 600; color: var(--ink-deep); text-decoration: none; display: block; line-height: 1.2; }
.line__edition { color: var(--muted); font-size: .95rem; font-style: italic; }
.line__controls { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.line__controls .qty button { width: 32px; }
.line__controls .qty input { width: 36px; }
.line__remove { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .9rem; }
.line__price { text-align: right; white-space: nowrap; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 16px 0 0; }
.totals dd { padding-left: 16px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-family: var(--serif-display); font-size: 1.5rem; color: var(--ink-deep); padding-top: 12px; border-top: 1px solid var(--rule); margin-top: 6px; }
.free-hint { font-size: .92rem; font-style: italic; color: var(--accent); margin: 12px 0 0; }

.coupon { display: flex; gap: 8px; margin-top: 20px; }
.coupon input { text-transform: uppercase; }
.coupon .btn { padding: .7em 1.2em; letter-spacing: .12em; white-space: nowrap; }
.coupon-msg { font-size: .92rem; margin: 6px 0 0; }
.coupon-msg--ok { color: var(--ok); }
.coupon-msg--err { color: var(--danger); }

.notice { padding: 14px 18px; border: 1px solid var(--rule); background: #fffdf9; border-radius: var(--radius); }
.notice--error { border-color: #d8b2aa; background: #fbf0ec; color: var(--danger); }
.notice--ok { border-color: #c3cfbf; background: #f1f5ee; color: var(--ok); }
.empty { text-align: center; padding: 48px 0; }
.empty p { font-style: italic; color: var(--muted); }

.privacy { font-size: .88rem; color: var(--muted); font-style: italic; margin-top: 12px; text-align: center; }

/* ----------------------------- Thanh toán ----------------------------- */

.payment { text-align: center; padding: 24px 0 80px; }
.payment__code { font-family: var(--serif-display); font-size: 2rem; letter-spacing: .14em; color: var(--ink-deep); }
.payment__box { display: grid; grid-template-columns: 300px 1fr; gap: clamp(24px, 4vw, 48px); align-items: center; text-align: left; margin: 32px auto; max-width: 820px; }
@media (max-width: 720px) { .payment__box { grid-template-columns: 1fr; text-align: center; } }
.qr { background: #fff; padding: 14px; border: 1px solid var(--rule); width: 100%; max-width: 300px; margin: 0 auto; }
.qr img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.bank-info { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: center; }
.bank-info dt { color: var(--muted); font-size: .95rem; }
.bank-info dd { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 1.1rem; color: var(--ink-deep); }
@media (max-width: 720px) { .bank-info { grid-template-columns: 1fr; text-align: left; } .bank-info dt { margin-top: 6px; } }
.copy { font: inherit; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; background: none; border: 1px solid var(--rule); padding: 3px 9px; cursor: pointer; color: var(--ink); border-radius: var(--radius); }
.copy:hover { border-color: var(--ink); }
.order-items { max-width: 520px; margin: 0 auto; text-align: left; }

/* ----------------------------- Giới thiệu ----------------------------- */

.about { padding: 24px 0 80px; }
.about .prose { font-size: 1.2rem; }
.about .prose p:first-of-type::first-letter { font-size: 4em; }

/* ----------------------------- Thông báo nổi ----------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink-deep);
  color: var(--paper);
  padding: 14px 22px;
  display: flex;
  gap: 18px;
  align-items: center;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  transition: opacity .25s, transform .25s;
  z-index: 20;
  max-width: calc(100% - 32px);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: var(--accent-soft); white-space: nowrap; }

.skeleton { min-height: 320px; display: grid; place-items: center; color: var(--muted); font-style: italic; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ----------------------------- Tài khoản ----------------------------- */
.account-login { max-width: 480px; margin: 0 auto 80px; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.orders { display: grid; }
.order-row { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.order-row:last-child { border-bottom: 0; }
.order-row__code { font-family: var(--serif-display); font-size: 1.2rem; letter-spacing: .1em; text-decoration: none; margin-right: 12px; }
.order-row__date, .order-row__items { color: var(--muted); font-size: .95rem; }
.account-hint { margin: 0 0 20px; padding: 12px 16px; background: var(--paper-2); border-radius: var(--radius); font-size: .95rem; }
#main > .wrap--narrow .panel + .panel { margin-bottom: 80px; }

.note-inline { display: block; color: var(--muted); font-style: italic; font-size: .9rem; margin-top: 2px; }
.account-invite { max-width: 520px; margin: 28px auto 0; text-align: center; }

/* ----------------------------- Tin tức ----------------------------- */
.news-list { display: grid; gap: 40px; max-width: 900px; margin: 0 auto 96px; }
.news-card__link { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 32px; text-decoration: none; color: inherit; align-items: center; }
.news-card__link:not(:has(.news-card__image)) { grid-template-columns: 1fr; }
.news-card__image { aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); }
.news-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.news-card__link:hover img { transform: scale(1.03); }
.news-card__date { font-family: var(--serif-display); letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; color: var(--accent); margin-bottom: .4em; font-weight: 600; }
.news-card__title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .3em; }
.news-card__summary { color: var(--muted); }
.news-card + .news-card { border-top: 1px solid var(--rule); padding-top: 40px; }
@media (max-width: 640px) { .news-card__link { grid-template-columns: 1fr; gap: 18px; } }

.article { padding-bottom: 24px; }
.article__head { text-align: center; padding: 24px 0 28px; }
.article__head .lead { max-width: 32em; margin: 0 auto; }
.article__image { display: block; max-width: 100%; max-height: min(70vh, 560px); width: auto; margin: 0 auto 36px; border-radius: var(--radius); box-shadow: var(--shadow-book); }
.article__body h2 { font-size: 1.6rem; margin: 1.6em 0 .5em; }

.comments { padding-bottom: 96px; }
.comments h2 { font-size: 1.6rem; }
.comments__count { color: var(--muted); font-size: 1.1rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.comment { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.comment__meta { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.comment__time { color: var(--muted); font-size: .9rem; }
.comment__text { margin: 0; }
.comment-form .btn { margin-top: 4px; }
