/*
 * Anh Thư Wellness — design-system layer (loaded after typography.css).
 * Tokens keep the existing green brand; rules only adjust color contrast,
 * minimum text size, tap-target size, focus visibility and motion.
 * No layout logic, markup or JavaScript behavior is changed.
 */
:root {
  /* Brand */
  --ds-green-900: #1f4d2a;
  --ds-green-700: #2f6f3b;   /* primary (existing greenoly green) */
  --ds-green-500: #3d7530;   /* accessible on white (5.4:1) */
  --ds-green-100: #eef5ea;
  /* Accent / price — darker orange so text passes WCAG AA on white */
  --ds-accent-600: #b4570b;  /* 4.7:1 on white */
  --ds-accent-700: #9a4a08;
  /* Neutrals */
  --ds-ink: #1f2a22;
  --ds-muted: #55605a;       /* 6.3:1 on white */
  --ds-subtle: #6b7570;      /* 4.7:1 on white, for struck-through prices */
  --ds-line: #dfe7dc;
  --ds-surface: #ffffff;
  /* Shape & motion */
  --ds-radius-sm: 6px;
  --ds-radius-md: 10px;
  --ds-radius-lg: 16px;
  --ds-shadow-1: 0 2px 8px rgba(31, 77, 42, .06);
  --ds-shadow-2: 0 12px 30px rgba(31, 77, 42, .10);
  --ds-ease: cubic-bezier(.2, .7, .2, 1);
  --ds-dur: 180ms;
  --ds-focus: 0 0 0 3px #fff, 0 0 0 5px var(--ds-green-700);
  /* Type floor */
  --ds-text-min: 13px;
}

/* ---------- Readability: minimum sizes for meta labels & small buttons ---------- */
.product-info small,
.journal-card small,
.product-assurance-heading span,
.product-assurance article small,
.product-assurance-help small,
.drawer-head small,
.checkout-head small,
.cart-footer > small,
.no-reviews,
.feedback-sold { font-size: var(--ds-text-min) !important; }
.product-assurance-help small { opacity: 1; }

.product-detail-button,
.product-buy-now,
.product-add-cart-button { font-size: 14px !important; }

.hotline-call-button,
.hotline-zalo-button,
.hotline-messenger-button,
.hotline-fanpage-button { font-size: 13px !important; }

/* ---------- Color contrast (WCAG AA 4.5:1) ---------- */
.price b,
.modal-price b,
.grand-total b,
.checkout-summary b { color: var(--ds-accent-600) !important; }

.price del,
.modal-price del { color: var(--ds-subtle) !important; }

.sale-badge,
.modal-product-image > span {
  background: var(--ds-accent-600) !important;
  color: #fff !important;
  font-weight: 700;
  border-radius: var(--ds-radius-sm);
}

.product-info small { color: var(--ds-green-500) !important; }
.no-reviews,
.feedback-sold { color: var(--ds-muted) !important; }

/* Product names: clear, two-line clamp-friendly sizing */
.product-info h3 {
  font-size: 16px;
  line-height: 1.45;
  color: var(--ds-ink);
}

/* ---------- Cards: consistent surface, radius, elevation ---------- */
.product-card {
  border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-1);
  transition: box-shadow var(--ds-dur) var(--ds-ease), transform var(--ds-dur) var(--ds-ease);
}
@media (hover: hover) {
  .product-card:hover { box-shadow: var(--ds-shadow-2); }
}

/* ---------- Focus visibility for keyboard users ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ds-focus);
  border-radius: var(--ds-radius-sm);
}

/* ---------- Tap targets (≥ 44px where it matters, ≥ 24px minimum) ---------- */
/* Banner dots: keep the small visual dot, enlarge the clickable area */
.promo-picker button { position: relative; }
.promo-picker button::after {
  content: "";
  position: absolute;
  inset: -14px -6px;
}
.socials a {
  width: 44px !important;
  height: 44px !important;
}
.quantity { height: 40px; }
.quantity button { min-width: 36px; }

@media (max-width: 760px) {
  footer .footer-grid > div > a:not(.brand) {
    display: flex !important;
    align-items: center;
    min-height: 44px;
    margin: 0 !important;
  }
  .text-link,
  .feedback-contact { display: inline-flex; align-items: center; min-height: 44px; }
  .quantity { height: 44px; }
  .quantity button { min-width: 44px; }
}

/* Interactive affordance */
button, [role="button"], summary, label[for] { cursor: pointer; }
button, a { touch-action: manipulation; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
 * Product detail panel — clean editorial style
 * (removes numbered badges, tinted bars, uppercase headings, stacked boxes)
 * ===================================================================== */
.product-article h4 {
  margin: 40px 0 14px;
  padding: 22px 0 0;
  border: 0;
  border-top: 1px solid var(--ds-line);
  border-radius: 0;
  background: none;
  color: var(--ds-ink);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}
.product-story h4::before { content: none; display: none; }

/* FAQ: hairline list with +/− indicator */
.product-faq {
  border: 0;
  border-top: 1px solid var(--ds-line);
  border-radius: 0;
  overflow: visible;
}
.product-faq details { border-bottom: 1px solid var(--ds-line); }
.product-faq details + details { border-top: 0; }
.product-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  list-style: none;
  color: var(--ds-ink);
  font-weight: 600;
  line-height: 1.45;
}
.product-faq summary::-webkit-details-marker { display: none; }
.product-faq summary::after {
  content: "+";
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ds-green-100);
  color: var(--ds-green-700);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: transform var(--ds-dur) var(--ds-ease);
}
.product-faq details[open] summary::after { content: "−"; }
.product-faq details[open] summary,
.product-faq p { background: none; }
.product-faq p { margin: -4px 0 0; padding: 0 44px 18px 0; color: var(--ds-muted); }
@media (hover: hover) { .product-faq summary:hover { color: var(--ds-green-700); } }

/* Note: quiet rounded panel, no colored side bar */
.product-notice {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid #efe4d2;
  border-left: 1px solid #efe4d2;
  border-radius: var(--ds-radius-md);
  background: #fcf8f2;
}
.product-notice strong {
  margin-bottom: 4px;
  color: var(--ds-accent-700);
  font-size: 15px;
  font-weight: 650;
}
.product-notice p { margin: 0; color: #4a4339; }

/* Sources: plain small print, not a box */
.ingredient-other {
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ds-subtle);
  font-size: 14px;
  line-height: 1.7;
}
.ingredient-other a { color: var(--ds-green-700); text-underline-offset: 3px; }

/* Table of contents & decision guide: lighter, no gradient / dark band */
.product-story-toc {
  padding: 18px 20px;
  border: 1px solid var(--ds-line);
  background: #fff;
}
.decision-guide-heading {
  background: none;
  color: var(--ds-ink);
  border-bottom: 1px solid var(--ds-line);
}
.decision-guide-heading span { color: var(--ds-green-500); }
.product-decision-guide { background: #fff; border-color: var(--ds-line); }

.product-notice + .ingredient-other, .product-notice + p { margin-top: 16px; }

/* Fix (pre-existing): on ≤720px the product photo area collapsed to ~60px,
   so the photo and thumbnails overlapped the product title/price. */
@media (max-width: 720px) {
  .product-modal {
    grid-template-rows: none;
    grid-auto-rows: max-content;
    align-content: start;
  }
}

/* Decision guide ("Đọc nhanh trước khi mua"): fix broken cell borders with an
   odd number of items; use hairline separators instead of a cell grid. */
.decision-guide-heading {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 18px 20px 6px;
  border-bottom: 0;
}
.decision-guide-heading strong { font-size: 18px; line-height: 1.4; }
.decision-guide-grid {
  column-gap: 28px;
  padding: 0 20px 6px;
}
.decision-guide-grid article,
.decision-guide-grid article:nth-child(2n),
.decision-guide-grid article:nth-last-child(-n+2),
.decision-guide-grid article:last-child:nth-child(odd) {
  min-height: 0;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--ds-line);
}
.decision-guide-grid small { margin-bottom: 4px; }
@media (max-width: 560px) {
  .decision-guide-grid { grid-template-columns: 1fr; }
}


/* =====================================================================
 * Audit fixes — 2026-11-07
 * ===================================================================== */
/* Contrast (WCAG AA) */
.eyebrow, .article-sidebar nav .eyebrow { color: #55663f; }
.reference { color: #4c6232; }
.about-number { color: #56663f; }
.category-wall small { color: var(--ds-muted); }
.hotline-fanpage-button { background: #1462d6 !important; }
.hotline-copy small,
.hotline-qr small { font-size: 13px !important; }
.feedback-demo-note { color: var(--ds-muted); }

/* Article TOC: comfortable tap rows; sticky sidebar scrolls when taller than the screen */
.article-sidebar nav a { display: block; padding: 5px 0; }
@media (min-width: 900px) {
  .article-sidebar {
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    scrollbar-width: thin;
  }
}

/* Mobile tables: wrap cell text so tables fit the screen instead of being cut off */
@media (max-width: 640px) {
  .article-table-wrap table { min-width: 0; }
  .article-table-wrap td:not(:first-child) { white-space: normal; }
  .article-table-wrap th, .article-table-wrap td { padding: 12px 12px; }
}

/* Large pull-quote: balanced line breaks on small screens */
blockquote, .about-quote, [class*="quote"] p { text-wrap: balance; }

/* Remaining contrast fixes: floating contact buttons, newsletter button, small labels */
.floating-phone,
.floating-chat,
.consultation-widget .floating-chat { background: var(--ds-green-700) !important; }
.newsletter button { background: var(--ds-accent-600) !important; color: #fff !important; }
.hotline-copy small { color: #55663f !important; }
.eco-stage-list small { color: #4f6457; }
.feedback-star-picker legend span { color: var(--ds-muted); }
