/* =====================================================
   Khoai tây Quế Võ – Nông sản Minh Thắng
   Tông màu: đất nâu + nắng chiều
   ===================================================== */
:root {
  --earth-950: #1c0b05;
  --earth-900: #2b1209;
  --earth-800: #3d1a0e;
  --earth-700: #55261a;
  --earth-600: #73371f;
  --clay: #a5573a;
  --sun: #f0b46a;
  --sun-2: #ffd8a4;
  --gold: #e3a04c;
  --cream: #fff3e4;
  --peach: #f6c9a5;
  --peach-2: #f0ad86;
  --muted: rgba(255, 226, 200, 0.72);
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-script: 'Dancing Script', 'Brush Script MT', cursive;
  --header-h: 108px;
  --radius: 28px;
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--earth-900);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
button { font-family: inherit; }
ul { list-style: none; }
/* Các phần tử đang chờ animation (translateX) không được làm rộng trang */
main { overflow-x: clip; }

/* ---------- Nền ảnh cánh đồng ---------- */
.bg-photo {
  position: fixed; inset: 0; z-index: -3;
  background: radial-gradient(ellipse at 22% 18%, #f3b06a 0%, #c46d3d 22%, #7a3520 52%, var(--earth-900) 100%);
}
.bg-photo::before {
  content: ''; position: absolute; inset: 0;
  background-image: var(--bg-img, none);
  background-size: cover; background-position: center 35%;
  opacity: 0; transition: opacity 1.4s ease;
  transform: scale(1.02);
}
.bg-photo.loaded::before { opacity: 1; }
.bg-shade {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(61, 26, 14, 0.22) 0%,
    rgba(61, 26, 14, 0.42) 28%,
    rgba(43, 18, 9, 0.72) 60%,
    rgba(31, 12, 5, 0.94) 100%);
}
.bg-sun {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle at 18% 12%, rgba(255, 196, 120, 0.42) 0%, rgba(255, 170, 90, 0.12) 22%, transparent 45%);
  animation: sunPulse 9s ease-in-out infinite alternate;
}
@keyframes sunPulse { from { opacity: .75; } to { opacity: 1; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 12px 0;
  transition: background .45s, padding .45s, box-shadow .45s;
}
.site-header.scrolled {
  background: rgba(43, 18, 9, 0.78);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 6px 0;
  box-shadow: 0 8px 30px rgba(20, 8, 3, 0.35);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 5vw;
  display: flex; align-items: center; gap: clamp(20px, 3vw, 48px);
}
.brand { display: flex; flex-direction: column; align-items: center; text-decoration: none; gap: 1px; }
.brand img {
  width: 84px; height: 84px; object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  transition: width .45s var(--ease), height .45s var(--ease);
}
.site-header.scrolled .brand img { width: 54px; height: 54px; }
.brand-l1 { font-size: .6rem; letter-spacing: .26em; text-transform: uppercase; color: #f79544; font-weight: 700; }
.brand-l2 { font-size: .92rem; letter-spacing: .06em; text-transform: uppercase; color: #5be27a; font-weight: 800; line-height: 1.1; }
.site-header.scrolled .brand-l1, .site-header.scrolled .brand-l2 { display: none; }

.site-nav { display: flex; gap: clamp(18px, 3vw, 44px); }
.site-nav a {
  color: var(--peach); text-decoration: none; text-transform: uppercase;
  letter-spacing: .1em; font-size: .92rem; font-weight: 500;
  position: relative; padding: 8px 0; transition: color .3s;
  text-shadow: 0 2px 10px rgba(30, 10, 3, 0.5);
}
.site-nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1.5px;
  background: var(--sun); transition: right .35s var(--ease);
}
.site-nav a:hover, .site-nav a.active { color: var(--sun-2); }
.site-nav a:hover::after, .site-nav a.active::after { right: 0; }

.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid rgba(255, 205, 160, 0.35);
  background: rgba(43, 18, 9, 0.45); border-radius: 10px; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--peach); transition: transform .3s, opacity .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Section chung ---------- */
.panel {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 12px) 5vw 56px;
  position: relative;
}
.panel-inner { width: 100%; max-width: 1240px; margin: 0 auto; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 36px; border: 1.5px solid var(--peach); color: #ffe3c6;
  text-transform: uppercase; letter-spacing: .12em; font-weight: 600; font-size: .88rem;
  text-decoration: none; background: rgba(43, 18, 9, 0.28);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: pointer; position: relative; overflow: hidden; isolation: isolate;
  transition: color .35s, border-color .35s, transform .35s, box-shadow .35s;
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, var(--gold), var(--peach-2));
  transform: translateX(-101%); transition: transform .45s var(--ease);
}
.btn:hover, .btn:focus-visible {
  color: var(--earth-900); border-color: var(--gold);
  transform: translateY(-2px); box-shadow: 0 14px 30px rgba(227, 160, 76, 0.3);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateX(0); }
.btn-sm { padding: 9px 20px; font-size: .74rem; letter-spacing: .1em; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Section 1: Hero ---------- */
.hero-grid {
  display: grid; grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 6vw, 96px); align-items: center;
}
.hero-title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; line-height: 1.05;
  font-size: clamp(2.3rem, 4.9vw, 4.4rem);
  background: linear-gradient(180deg, #fff0cf 0%, #f3c07a 45%, #d9903a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 18px rgba(40, 15, 5, 0.55));
}
.hero-sub {
  margin-top: 20px; font-size: clamp(1.05rem, 1.6vw, 1.45rem);
  color: var(--sun-2); font-weight: 400; text-shadow: 0 2px 12px rgba(40, 15, 5, 0.6);
}
.hero-brand {
  display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: #ffe3bd; font-size: clamp(1.15rem, 1.75vw, 1.6rem); margin-top: 6px;
}
.hero-highlights { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-top: 40px; }
.hero-highlights li { display: flex; flex-direction: column; }
.hero-highlights strong {
  font-family: var(--font-display); font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  color: var(--sun); line-height: 1; text-shadow: 0 4px 16px rgba(40, 15, 5, 0.6);
}
.hero-highlights span { font-size: .82rem; color: var(--muted); margin-top: 6px; letter-spacing: .02em; }
.hero-tagline {
  font-family: var(--font-script); font-size: clamp(2rem, 3.4vw, 3rem);
  color: #ffd0a6; font-weight: 600; text-shadow: 0 4px 18px rgba(40, 15, 5, 0.6);
}
.hero-desc {
  margin-top: 18px; font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.85;
  color: var(--cream); max-width: 36em; text-shadow: 0 2px 12px rgba(40, 15, 5, 0.6);
}
.hero-cta { margin-top: 34px; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1.5px solid rgba(255, 214, 170, 0.55); border-radius: 14px;
  display: flex; justify-content: center; padding-top: 6px; opacity: .8;
}
.scroll-hint span {
  width: 4px; height: 8px; border-radius: 2px; background: var(--sun);
  animation: hint 1.8s ease-in-out infinite;
}
@keyframes hint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Section 2: Sản phẩm ---------- */
.product-grid {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 80px); align-items: center;
}
.product-media {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1.18 / 1; position: relative;
  box-shadow: 0 40px 80px rgba(20, 8, 3, 0.55), 0 0 0 1px rgba(255, 214, 170, 0.18);
}
.product-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.02); transition: transform 1.2s var(--ease);
}
.product-media:hover img { transform: scale(1.07); }
.product-media::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 60%, rgba(43, 18, 9, 0.35));
}
.product-kicker { font-family: var(--font-script); font-size: clamp(1.4rem, 1.9vw, 1.8rem); color: #ffcfa3; }
.product-name { font-size: clamp(1.6rem, 2.4vw, 2.2rem); font-weight: 700; color: #fff; margin-top: 4px; }
.product-desc {
  margin-top: 16px; line-height: 1.85; color: var(--cream);
  font-size: clamp(.98rem, 1.15vw, 1.12rem);
}
.product-specs {
  display: flex; flex-wrap: wrap; gap: 8px 0; margin-top: 22px;
  text-transform: uppercase; letter-spacing: .1em; font-size: .86rem; color: #ffe3c6; font-weight: 500;
}
.product-specs li + li::before { content: '|'; margin: 0 12px; color: rgba(255, 200, 150, 0.5); }
.product-price { margin-top: 14px; font-size: 1.4rem; font-weight: 700; color: var(--sun); }
.product-cta { margin-top: 30px; }

/* ---------- Section 3: Món ngon + Liên hệ ---------- */
.info-grid {
  display: grid; grid-template-columns: 1.55fr 1fr;
  gap: clamp(20px, 2.5vw, 40px); align-items: stretch;
}
.card {
  background: rgba(66, 27, 14, 0.74);
  border: 1px solid rgba(255, 205, 160, 0.14);
  border-radius: var(--radius);
  padding: clamp(24px, 2.6vw, 40px);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px rgba(20, 8, 3, 0.45);
}
.card-title {
  font-size: clamp(1.35rem, 1.9vw, 1.8rem); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700; color: #ffe3c6;
}
.card-recipes .card-title { text-align: center; }
.card-intro { margin-top: 8px; color: var(--muted); font-size: .92rem; line-height: 1.6; }

.recipes-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 28px); margin-top: 28px;
}
.recipe { display: flex; flex-direction: column; }
.recipe-media {
  border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1;
  box-shadow: 0 14px 30px rgba(20, 8, 3, 0.4);
}
.recipe-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .9s var(--ease); }
.recipe:hover .recipe-media img { transform: scale(1.08); }
.recipe h4 { margin-top: 16px; font-size: 1.08rem; font-weight: 700; color: #fff; line-height: 1.35; }
.recipe p { margin-top: 8px; font-size: .88rem; color: var(--muted); line-height: 1.6; flex: 1; }
.recipe .btn { margin-top: 14px; align-self: flex-start; }

.contact-inner { display: grid; grid-template-columns: 1fr .85fr; gap: 20px; margin-top: 22px; }
.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form input, .contact-form textarea {
  width: 100%; background: rgba(43, 18, 9, 0.35);
  border: 1.5px solid rgba(255, 200, 150, 0.45); color: var(--cream);
  padding: 13px 16px; font: inherit; font-size: .95rem; border-radius: 4px; outline: none;
  transition: border-color .3s, box-shadow .3s;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: rgba(255, 220, 190, 0.55); }
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--sun); box-shadow: 0 0 0 3px rgba(240, 180, 106, 0.18);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form .btn { align-self: flex-start; margin-top: 4px; }
.contact-media { border-radius: 16px; overflow: hidden; min-height: 220px; box-shadow: 0 14px 30px rgba(20, 8, 3, 0.4); }
.contact-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.contact-meta { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--muted); }
.contact-meta a, .contact-meta span { display: inline-flex; align-items: center; gap: 10px; color: var(--sun-2); text-decoration: none; }
.contact-meta svg { width: 16px; height: 16px; flex: none; stroke: var(--sun); fill: none; stroke-width: 1.8; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1240px; margin: 0 auto; padding: 30px 5vw 40px;
  text-align: center; color: rgba(255, 220, 190, 0.6); font-size: .92rem; position: relative;
}
.site-footer::before {
  content: ''; position: absolute; top: 0; left: 5vw; right: 5vw; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 150, 0.35), transparent);
}

/* ---------- Chấm điều hướng ---------- */
.dots {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 14px; z-index: 40;
}
.dots button {
  width: 10px; height: 10px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1.5px solid rgba(255, 214, 170, 0.6); background: transparent; transition: all .3s;
}
.dots button.active {
  background: var(--sun); border-color: var(--sun); transform: scale(1.3);
  box-shadow: 0 0 12px rgba(240, 180, 106, 0.6);
}

/* ---------- Modal công thức ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(20, 8, 3, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .3s;
}
.modal-dialog {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(940px, 92vw); max-height: 88vh; overflow: auto;
  background: linear-gradient(160deg, #5a2818, #35150b);
  border: 1px solid rgba(255, 205, 160, 0.2); border-radius: 24px;
  display: grid; grid-template-columns: 1fr 1.35fr;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); animation: popIn .45s var(--ease);
}
.modal-media img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; display: block; }
.modal-body { padding: 40px 36px; }
.modal-body h3 { font-size: 1.7rem; color: #fff; line-height: 1.3; }
.modal-body p { margin-top: 14px; color: var(--cream); line-height: 1.8; white-space: pre-line; font-size: .98rem; }
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 50%; z-index: 2;
  border: 1px solid rgba(255, 205, 160, 0.35); background: rgba(43, 18, 9, 0.6);
  color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background .3s;
}
.modal-close:hover { background: var(--clay); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: rgba(43, 18, 9, 0.94); border: 1px solid rgba(255, 205, 160, 0.3);
  color: var(--cream); padding: 14px 24px; border-radius: 12px; max-width: 90vw;
  opacity: 0; pointer-events: none; transition: .4s; z-index: 120; font-size: .95rem;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: #e07a5f; }

/* ---------- Animation khi cuộn ---------- */
[data-reveal] {
  opacity: 0;
  transition: opacity .9s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
[data-reveal="up"] { transform: translateY(44px); }
[data-reveal="down"] { transform: translateY(-34px); }
[data-reveal="left"] { transform: translateX(-64px); }
[data-reveal="right"] { transform: translateX(64px); }
[data-reveal="zoom"] { transform: scale(.9); }
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .bg-sun, .scroll-hint span { animation: none; }
}

/* Cuộn snap trên thiết bị cảm ứng (desktop dùng JS) */
@media (pointer: coarse) {
  html { scroll-snap-type: y proximity; }
  .panel { scroll-snap-align: start; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid, .product-grid, .info-grid { grid-template-columns: 1fr; }
  .product-media { max-width: 560px; }
  .contact-inner { grid-template-columns: 1fr; }
  .contact-media { display: none; }
  .dots { display: none; }
  .panel { min-height: auto; padding-top: calc(var(--header-h) + 8px); }
  .panel-hero { min-height: 100svh; }
  .scroll-hint { display: none; }
  .modal-dialog { grid-template-columns: 1fr; }
  .modal-media img { max-height: 240px; min-height: 0; }
  .modal-body { padding: 28px 24px; }
}
@media (max-width: 720px) {
  :root { --header-h: 108px; }
  .header-inner { padding: 0 20px; }
  .brand img { width: 58px; height: 58px; }
  .brand-l1 { font-size: .5rem; letter-spacing: .2em; }
  .brand-l2 { font-size: .74rem; }
  .site-header.scrolled .brand img { width: 44px; height: 44px; }
  .hero-title { font-size: 2.15rem; }
  /* Trên mobile, mọi thứ trượt lên từ dưới cho tự nhiên */
  [data-reveal="left"], [data-reveal="right"] { transform: translateY(40px); }
  [data-reveal].is-visible { transform: none; }
  .site-nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 82vw);
    background: rgba(43, 18, 9, 0.97); flex-direction: column;
    padding: 120px 32px; gap: 22px; margin: 0;
    transform: translateX(100%); transition: transform .45s var(--ease);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.4);
  }
  .site-nav.open { transform: none; }
  .nav-toggle { display: flex; }
  .panel { padding-left: 20px; padding-right: 20px; }
  .recipes-grid { grid-template-columns: 1fr; gap: 20px; }
  .recipe { display: grid; grid-template-columns: 104px 1fr; gap: 6px 16px; align-items: start; }
  .recipe .recipe-media { grid-row: span 3; }
  .recipe h4 { margin-top: 0; font-size: 1rem; }
  .recipe p { margin-top: 2px; }
  .recipe .btn { margin-top: 8px; }
  .hero-highlights { gap: 12px 22px; margin-top: 30px; }
  .card { border-radius: 20px; }
}
