/* Quang Sơn — quangsoncashew.com
   Bảng màu lấy từ logo: đỏ rượu vang trên nền kem.
   Điểm nhấn duy nhất của trang: mục Chứng nhận trên nền đỏ. */

:root {
  --cream: #f5ebe2;
  --tint: #ecddd0;
  --paper: #fbf6f1;
  --maroon: #821518;
  --maroon-deep: #5e0f11;
  --ink: #2a1b17;
  --ink-soft: #6b564e;
  --line: #d3bfb0;
  --field: #8c7566;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 24px;
  --max: 1120px;
  --max-wide: 1240px;
  --header-h: 72px;
}

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

html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; padding: 0; }
ul, ol { list-style: none; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.certs :focus-visible, .site-footer :focus-visible, .lightbox :focus-visible { outline-color: var(--cream); }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-wide { max-width: calc(var(--max-wide) + var(--gutter) * 2); }

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  background: var(--maroon);
  color: var(--cream);
  padding: 10px 16px;
  z-index: 100;
}
.skip:focus { top: 12px; }

/* ---------- Kiểu chữ tiêu đề ---------- */
h1, h2, .facts dd, .steps li::before, .service dt, .cert-meta h3 {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

h1 {
  color: var(--maroon);
  font-weight: 700;
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h2 {
  color: var(--maroon);
  font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* Hai đường kẻ song song, gợi chữ viền kép trong logo */
.rule {
  display: block;
  width: 72px;
  height: 8px;
  border-top: 3px solid var(--maroon);
  border-bottom: 1px solid var(--maroon);
  margin: 22px 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

.brand img { height: 40px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 26px; }
.site-nav ul a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.97rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav ul a:hover { border-bottom-color: var(--maroon); }

.lang {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.lang:hover { color: var(--maroon); border-bottom-color: var(--maroon); }

.menu-btn {
  display: none;
  font: inherit;
  font-weight: 600;
  color: var(--maroon);
  background: transparent;
  border: 2px solid var(--maroon);
  border-radius: 3px;
  padding: 8px 16px;
  min-height: 44px;
  cursor: pointer;
}

/* ---------- Nút ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--cream);
  background: var(--maroon);
  border: 2px solid var(--maroon);
  border-radius: 3px;
  padding: 14px 24px;
  min-height: 48px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--maroon-deep); border-color: var(--maroon-deep); }
.btn-ghost { background: transparent; color: var(--maroon); }
.btn-ghost:hover { background: var(--maroon); color: var(--cream); border-color: var(--maroon); }
.btn-small { padding: 9px 16px; font-size: 0.95rem; min-height: 0; }
.btn-icon { display: inline-flex; align-items: center; gap: 10px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 6vw, 88px) 0 clamp(56px, 7vw, 104px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}

.lead { margin-top: 28px; max-width: 34rem; font-size: 1.2rem; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

/* Khối đỏ chứa logo. Khi có ảnh nhà máy, thay bằng ảnh. */
.hero-media {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--maroon);
  aspect-ratio: 5 / 4;
}
.hero-media::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 5px double rgba(245, 235, 226, 0.5);
  pointer-events: none;
}
.hero-media img { width: 74%; }
.hero-photo { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 1081px) {
  .hero { min-height: min(calc(100svh - var(--header-h)), 800px); display: grid; align-items: center; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.1s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.2s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- Công suất ---------- */
.capacity { background: var(--tint); padding: clamp(56px, 7vw, 88px) 0; }
.capacity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
}
.capacity h2 { font-size: clamp(2.3rem, 5.2vw, 4.25rem); line-height: 1.05; max-width: 14ch; }
.capacity p { margin-top: 18px; color: var(--ink-soft); font-size: 1.1rem; max-width: 30rem; }

.facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--ink-soft); }
.facts dd { font-size: 1.35rem; font-weight: 600; color: var(--maroon); text-align: right; line-height: 1.25; }

/* ---------- Chứng nhận (điểm nhấn) ---------- */
.certs {
  background: var(--maroon);
  color: var(--cream);
  padding: clamp(64px, 8vw, 112px) 0;
}
.certs h2 { color: var(--cream); font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
.certs .rule { border-color: var(--cream); }
.certs-head { max-width: var(--max); margin-inline: auto; }
.certs-head p { max-width: 34rem; opacity: 0.92; font-size: 1.1rem; }

.cert-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: clamp(24px, 3.4vw, 48px);
  margin-top: clamp(40px, 5vw, 64px);
  align-items: start;
}

.cert-doc {
  position: relative;
  display: block;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 30px 56px -14px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  cursor: zoom-in;
}
@media (prefers-reduced-motion: no-preference) {
  .cert-doc { transition: transform 0.2s ease, box-shadow 0.2s ease; }
  .cert-doc:hover { transform: translateY(-6px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 40px 64px -14px rgba(0, 0, 0, 0.65); }
}
.cert-doc img { width: 100%; height: auto; }
.zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--maroon);
  color: var(--cream);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.cert-meta { margin-top: 22px; }
.cert-meta h3 { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.cert-meta p { margin-top: 6px; font-size: 0.97rem; opacity: 0.92; }
.cert-meta .when { font-weight: 600; opacity: 1; }
.pdf {
  display: inline-block;
  margin-top: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  text-underline-offset: 4px;
  padding: 4px 0;
}

/* ---------- Mục chung ---------- */
.section { padding: clamp(64px, 8vw, 96px) 0; }
.section-tint { background: var(--tint); }
section[id] { scroll-margin-top: calc(var(--header-h) - 1px); }

.head { max-width: 40rem; margin-bottom: 56px; }
.head p, .split-head p { color: var(--ink-soft); max-width: 30rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(36px, 6vw, 72px);
  align-items: start;
}

/* Dịch vụ */
.services { border-bottom: 1px solid var(--line); }
.service { padding: 28px 0; border-top: 1px solid var(--line); }
.service dt { font-size: 1.45rem; font-weight: 600; color: var(--ink); line-height: 1.25; }
.service dd { margin-top: 8px; color: var(--ink-soft); max-width: 38rem; }

/* Quy trình (một trình tự thật nên có đánh số) */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  counter-reset: step;
}
.steps li { counter-increment: step; border-top: 3px solid var(--maroon); padding-top: 18px; }
.steps li::before {
  content: counter(step);
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--maroon);
  margin-bottom: 12px;
}
.steps h3 { font-size: 1.12rem; font-weight: 600; line-height: 1.35; }
.steps p { margin-top: 6px; color: var(--ink-soft); font-size: 1rem; }
.note { margin-top: 40px; font-size: 0.92rem; color: var(--ink-soft); }

/* Nhà máy */
.addresses { margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.addresses > div { padding: 18px 0; border-top: 1px solid var(--line); }
.addresses dt { font-weight: 600; }
.addresses dd { margin-top: 4px; color: var(--ink-soft); max-width: 28rem; }

.photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 56px;
}
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Liên hệ */
.mail { margin-top: 28px; }
.mail span { color: var(--ink-soft); font-size: 0.95rem; }
.mail a { font-weight: 600; color: var(--maroon); text-underline-offset: 4px; overflow-wrap: anywhere; }

.form { display: grid; gap: 20px; }
.form label { display: grid; gap: 6px; font-weight: 500; }
.form input, .form textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--field);
  border-radius: 3px;
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
}
.form textarea { resize: vertical; min-height: 140px; }
.form .btn { justify-self: start; }
.hint { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--maroon-deep); color: var(--cream); padding: 56px 0; }
.foot { display: grid; gap: 10px; }
.foot img { height: 44px; width: auto; margin-bottom: 8px; }
.foot a { text-underline-offset: 4px; }

/* ---------- Xem phóng to chứng nhận ---------- */
.lightbox {
  width: min(96vw, 1100px);
  max-width: none;
  height: 94vh;
  max-height: none;
  padding: 0;
  border: 0;
  background: var(--maroon-deep);
  color: var(--cream);
  overflow: hidden;
}
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgba(30, 14, 12, 0.88); }
.lb-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(245, 235, 226, 0.25);
}
.lb-title { flex: 1; font-weight: 600; }
.lb-pdf { font-size: 0.95rem; text-underline-offset: 4px; padding: 10px 4px; }
.lb-close {
  font: inherit;
  font-weight: 600;
  color: var(--maroon);
  background: var(--cream);
  border: 0;
  border-radius: 3px;
  padding: 10px 18px;
  min-height: 44px;
  cursor: pointer;
}
.lb-body { flex: 1; min-height: 0; overflow: auto; background: #2a1b17; padding: 16px; }
.lb-body img { margin: 0 auto; max-width: 100%; max-height: none; height: auto; background: #fff; }

/* ---------- Máy tính bảng và điện thoại ---------- */
@media (max-width: 1080px) {
  .menu-btn { display: inline-block; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px var(--gutter) 24px;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .site-nav ul a { display: block; padding: 12px 0; font-size: 1.05rem; }
  .lang { align-self: flex-start; padding: 10px 0; }
  .site-nav .btn { align-self: flex-start; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-media { aspect-ratio: 16 / 10; }
  .hero-media img { width: auto; height: 74%; }
  .capacity-grid { grid-template-columns: 1fr; gap: 36px; align-items: start; }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* iPad dọc: bản ISO còn hiệu lực ở giữa phía trên, hai bản còn lại bên dưới */
  .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cert-card:first-child { grid-column: 1 / -1; justify-self: center; width: min(100%, 440px); }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; --header-h: 64px; }
  body { font-size: 1rem; }
  .brand img { height: 34px; }
  .lead { font-size: 1.1rem; }
  .hero-media { aspect-ratio: 4 / 3; }
  .facts > div { flex-direction: column; gap: 2px; }
  .facts dd { text-align: left; }
  .steps { grid-template-columns: 1fr; gap: 32px; }
  .cert-grid { grid-template-columns: 1fr; }
  .cert-card:first-child { width: 100%; }
  .photos { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; }
  .form .btn { justify-self: stretch; }
  .lightbox { width: 100vw; height: 100dvh; }
  .lb-bar { flex-wrap: wrap; gap: 8px 12px; }
  .lb-title { flex: 1 1 100%; }
  .lb-body { padding: 8px; }
}

/* FAQ */
.faq { margin: 0; display: grid; gap: 0; }
.faq > div { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq dt { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.12rem; color: var(--maroon); }
.faq dd { margin: .4rem 0 0; color: var(--ink); }
