/* =====================================================
   MEI BEDDING — base.css
   Reset, design tokens, typography, container, buttons, forms, utilities.
   Extracted from hifi-v2.css sections 1-6, 23-24.
   ===================================================== */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- 2. Design tokens ---------- */
:root {
  /* Colors */
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --muted: #767064;
  --line: #e5e5e5;
  --bone: #f7f3ec;
  --bone-soft: #faf7f1;
  --white: #ffffff;
  --sale: #7a1f2b;          /* burgundy — đồng bộ giá + button */
  --sale-bg: #fef0f1;       /* nền nhẹ cho badge */
  --cta-red: #7a1f2b;       /* CTA chính (Mua ngay, Đặt hàng) + giá SP */
  --cta-red-hover: #5a141d;
  --success: #1a6e3f;
  --info: #1d4e89;
  --warn-bg: #fffbe6;
  --warn-border: #ffe58f;
  --warn-text: #874d00;

  /* Font — system stack giống demxinh */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-serif: var(--font); /* unified — heading dùng cùng font với body (system-sans) */

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Layout */
  --container: 1280px;
  --gutter: 16px;
  --header-h: 80px;
  --header-h-mobile: 60px;
  --radius: 4px;
  --radius-lg: 8px;

  /* Easing */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 400ms;

  /* Z-index */
  --z-header: 50;
  --z-sticky-cta: 60;
  --z-zalo: 70;
  --z-drawer: 80;
  --z-filter-popup: 90;
  --z-modal: 100;
  --z-search-overlay: 200;
  --z-toast: 999;
}

/* ---------- 2b. Parent-theme (Blocksy) CSS-variable overrides ---------- *
 * Blocksy applies font-family/font-size/line-height/weight on body+headings+labels
 * via `var(--theme-font-family)` etc. — coming from global.css generated styles.
 * We can't override the long selector without !important, so instead we
 * redirect those CSS variables to our design tokens. Keeps cascade clean.
 */
:root,
body {
  --theme-font-family: var(--font);
  --theme-font-style: normal;
  --theme-list-indent: 0;
  --theme-content-spacing: 0;
}

/* Headings inherit our family explicitly even when Blocksy resets font-size/weight. */
body,
h1, h2, h3, h4, h5, h6,
label, button, input, select, textarea,
.ct-label, .ct-breadcrumbs, .ct-post-title,
.ct-product-title, .ct-woo-card-stock,
.woocommerce-tabs .tabs, .ct-module-title,
.woocommerce-loop-product__title,
.woocommerce-loop-category__title {
  font-family: var(--font);
}

/* ---------- 3. Typography ---------- */
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.25; color: var(--ink); }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
.text-eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.text-muted { color: var(--muted); }
.text-sale { color: var(--sale); font-weight: 700; }
.text-strike { text-decoration: line-through; color: var(--muted); font-weight: 400; }
@media (min-width: 1024px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
}

/* ---------- 4. Container ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  text-align: center;
}
.btn--filled { background: var(--ink); color: var(--white); }
.btn--filled:hover,
.btn--filled:focus,
.btn--filled:visited { background: var(--ink-soft); color: var(--white); }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--outline:hover,
.btn--outline:focus { background: var(--ink); color: var(--white); }
.btn--ghost { background: transparent; color: var(--ink-soft); padding: 6px 12px; }
.btn--ghost:hover,
.btn--ghost:focus { color: var(--ink); }
.btn--sale { background: var(--sale); color: var(--white); }
.btn--sale:hover,
.btn--sale:focus { background: var(--cta-red-hover); color: var(--white); }
/* Defensive: a.btn always white text regardless of visited state */
a.btn,
a.btn:visited,
a.btn--filled,
a.btn--filled:visited,
a.btn--cta,
a.btn--cta:visited,
a.btn--sale,
a.btn--sale:visited { color: var(--white); }
a.btn--outline,
a.btn--outline:visited,
a.btn--ghost,
a.btn--ghost:visited { color: var(--ink); }
.btn--cta { background: var(--cta-red); color: var(--white); border-color: var(--cta-red); }
.btn--cta:hover { background: var(--cta-red-hover); border-color: var(--cta-red-hover); color: var(--white); }
.btn--addcart { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn--addcart:hover { background: var(--ink); color: var(--white); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 28px; font-size: 15px; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 6. Forms ---------- */
.form-field { margin-bottom: var(--sp-4); }
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: var(--sp-2);
  color: var(--ink-soft);
}
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color var(--t-fast) var(--ease);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); }
.textarea { resize: vertical; min-height: 80px; }
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.checkbox input[type="checkbox"] { accent-color: var(--ink); width: 16px; height: 16px; }
.radio { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-size: 13px; }
.radio input[type="radio"] { accent-color: var(--ink); width: 16px; height: 16px; }


/* ---------- 23. Utilities ---------- */
.hide-mobile { display: none; }
.hide-desktop { display: block; }
@media (min-width: 1024px) {
  .hide-mobile { display: block; }
  .hide-desktop { display: none; }
}
.text-center { text-align: center; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }

/* ---------- 24. Body scroll lock helper ---------- */
body.no-scroll { overflow: hidden; }

/* ---------- 25. Page title (cart/checkout/about/policy/etc.) ---------- */
/* Match hifi cart H1 inline style: serif font, weight 400, fs 28px, mb sp-5. */
.page-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: var(--sp-5);
}
.page-header { margin-bottom: 0; padding: 0; border: 0; }

/* ---------- Page hero (banner toàn cục — content pages, journal, reels) ---------- */
.page-hero {
  background: var(--bone-soft);
  padding: var(--sp-7) 0 var(--sp-6);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  margin-bottom: var(--sp-3);
}
.page-hero p {
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .page-hero { padding: var(--sp-8) 0 var(--sp-7); }
  .page-hero h1 { font-size: 40px; }
}
.page-section { padding: var(--sp-7) 0; }
@media (min-width: 1024px) { .page-section { padding: var(--sp-8) 0; } }

