/* =====================================================================
   หนองบัว วิลเลจ — Theme: Soft Gray + Soft Yellow / Font: Chakra Petch
   ===================================================================== */

:root {
  --nb-gray-50:  #f7f7f6;
  --nb-gray-100: #eeeeec;
  --nb-gray-200: #e2e2de;
  --nb-gray-300: #c9c9c2;
  --nb-gray-600: #6b6b62;
  --nb-gray-800: #3f3f38;
  --nb-yellow-50:  #fffceb;
  --nb-yellow-100: #fdf3c8;
  --nb-yellow-200: #f9e79b;
  --nb-yellow-400: #eecd4e;
  --nb-yellow-500: #e0b62e;
  --nb-green-600:  #5c7a52;   /* เขียวใบบัว ใช้เป็นจุดเน้นรอง */
  --nb-white: #ffffff;
  --nb-radius: 16px;
  --nb-shadow: 0 2px 14px rgba(63,63,56,0.08);
  --nb-shadow-lg: 0 8px 30px rgba(63,63,56,0.14);
  --nb-nav-height: 64px;
  --nb-bottomnav-height: 62px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--nb-gray-50);
  color: var(--nb-gray-800);
  font-family: 'Chakra Petch', sans-serif;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: 'Chakra Petch', sans-serif; font-weight: 600; margin: 0 0 .5em; }
p { line-height: 1.7; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- Top App Bar ---------- */
.nb-topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--nb-nav-height);
  background: var(--nb-white);
  border-bottom: 1px solid var(--nb-gray-200);
  display: flex; align-items: center;
}
.nb-topbar-inner {
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.nb-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.nb-brand-badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--nb-yellow-200), var(--nb-yellow-400));
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.nb-nav-desktop { display: none; gap: 2px; flex-wrap: wrap; justify-content: center; }
.nb-nav-desktop a {
  padding: 8px 11px; border-radius: 999px; font-size: .87rem; font-weight: 600;
  color: var(--nb-gray-600); transition: .15s; white-space: nowrap;
}
.nb-nav-desktop a:hover, .nb-nav-desktop a.active {
  background: var(--nb-yellow-100); color: var(--nb-gray-800);
}
.nb-topbar-actions { display: flex; align-items: center; gap: 10px; }
.nb-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--nb-gray-200); border: 2px solid var(--nb-yellow-300, var(--nb-yellow-200));
}
.nb-avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 860px) {
  .nb-nav-desktop { display: flex; }
  .nb-hide-desktop { display: none !important; }
}

/* ---------- Bottom App Nav (mobile, app-like) ---------- */
.nb-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--nb-bottomnav-height);
  background: var(--nb-white);
  border-top: 1px solid var(--nb-gray-200);
  display: flex;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.05);
}
@media (min-width: 860px) { .nb-bottomnav { display: none; } }
.nb-bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: .68rem; color: var(--nb-gray-600); font-weight: 600;
}
.nb-bottomnav a .ic { font-size: 1.25rem; }
.nb-bottomnav a.active { color: var(--nb-green-600); }
body { padding-bottom: calc(var(--nb-bottomnav-height) + 10px); }
@media (min-width: 860px) { body { padding-bottom: 0; } }

/* ---------- Hero (บ้านหนองบัว) ---------- */
.nb-hero {
  position: relative;
  min-height: 62vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: var(--nb-gray-800);
}
.nb-hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.nb-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(63,63,56,0) 0%, rgba(40,40,32,0.75) 100%);
}
.nb-hero-content {
  position: relative; z-index: 2;
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 18px;
  color: var(--nb-white);
}
.nb-hero-eyebrow {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  background: rgba(253,243,200,0.92); color: var(--nb-gray-800);
  font-size: .78rem; font-weight: 700; margin-bottom: 12px;
}
.nb-hero-content h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 6px; }
.nb-hero-content p { color: var(--nb-gray-100); font-size: 1rem; max-width: 560px; }

/* ---------- Section ---------- */
.nb-section { padding: 48px 0; }
.nb-section-title { font-size: 1.5rem; margin-bottom: 4px; }
.nb-section-desc { color: var(--nb-gray-600); margin-bottom: 22px; }
.nb-section-alt { background: var(--nb-gray-100); }

/* ---------- Card ---------- */
.nb-card {
  background: var(--nb-white);
  border-radius: var(--nb-radius);
  box-shadow: var(--nb-shadow);
  padding: 20px;
}
.nb-grid { display: grid; gap: 18px; }
.nb-grid-2 { grid-template-columns: repeat(1, 1fr); }
.nb-grid-3 { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) { .nb-grid-2, .nb-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .nb-grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Buttons ---------- */
.nb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: none;
  font-weight: 700; font-size: .92rem; font-family: inherit;
  background: var(--nb-yellow-400); color: var(--nb-gray-800);
  transition: .15s;
}
.nb-btn:hover { background: var(--nb-yellow-500); }
.nb-btn-outline {
  background: transparent; color: var(--nb-gray-800);
  border: 1.5px solid var(--nb-gray-300);
}
.nb-btn-outline:hover { background: var(--nb-gray-100); }
.nb-btn-danger { background: #e2685c; color: #fff; }
.nb-btn-sm { padding: 7px 16px; font-size: .8rem; }
.nb-btn-block { width: 100%; }

/* ---------- Forms ---------- */
.nb-form-group { margin-bottom: 16px; }
.nb-label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.nb-input, .nb-textarea, .nb-select {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--nb-gray-200); background: var(--nb-white);
  font-family: inherit; font-size: .95rem; color: var(--nb-gray-800);
}
.nb-input:focus, .nb-textarea:focus, .nb-select:focus {
  outline: none; border-color: var(--nb-yellow-500);
  box-shadow: 0 0 0 3px rgba(224,182,46,0.18);
}
.nb-textarea { min-height: 130px; resize: vertical; }
.nb-form-card { max-width: 480px; margin: 40px auto; }
.nb-hint { font-size: .78rem; color: var(--nb-gray-600); margin-top: 4px; }

/* ---------- Alerts ---------- */
.nb-alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }
.nb-alert-error { background: #fdeceb; color: #b3392d; }
.nb-alert-success { background: #eaf3e5; color: #3d6b30; }

/* ---------- Tables ---------- */
.nb-table { width: 100%; border-collapse: collapse; background: var(--nb-white); border-radius: var(--nb-radius); overflow: hidden; }
.nb-table th, .nb-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--nb-gray-100); font-size: .88rem; }
.nb-table th { background: var(--nb-gray-100); font-weight: 700; }
.nb-table-wrap { overflow-x: auto; background: var(--nb-white); border-radius: var(--nb-radius); box-shadow: var(--nb-shadow); }

/* ---------- Badge ---------- */
.nb-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.nb-badge-yellow { background: var(--nb-yellow-100); color: #8a6d0f; }
.nb-badge-green { background: #eaf3e5; color: #3d6b30; }
.nb-badge-gray { background: var(--nb-gray-200); color: var(--nb-gray-600); }
.nb-badge-red { background: #fdeceb; color: #b3392d; }

/* ---------- Admin layout ---------- */
.nb-admin-shell { display: flex; min-height: 100vh; }
.nb-admin-sidebar {
  width: 230px; background: var(--nb-gray-800); color: var(--nb-white);
  padding: 20px 14px; flex-shrink: 0;
}
.nb-admin-sidebar a {
  display: block; padding: 10px 12px; border-radius: 10px; margin-bottom: 4px;
  color: var(--nb-gray-100); font-size: .88rem; font-weight: 600;
}
.nb-admin-sidebar a:hover, .nb-admin-sidebar a.active { background: rgba(255,255,255,0.1); color: var(--nb-yellow-200); }
.nb-admin-main { flex: 1; padding: 26px; min-width: 0; }
@media (max-width: 760px) {
  .nb-admin-shell { flex-direction: column; }
  .nb-admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 4px; padding: 10px; }
  .nb-admin-sidebar a { white-space: nowrap; margin-bottom: 0; }
}

/* ---------- Gallery / thumb grids ---------- */
.nb-thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nb-thumb-grid img { width: 100%; height: 100px; object-fit: cover; border-radius: 10px; }

/* ---------- Product / Post card ---------- */
.nb-p-card { overflow: hidden; padding: 0; }
.nb-p-cover { width: 100%; height: 170px; object-fit: cover; background: var(--nb-gray-200); }
.nb-p-body { padding: 14px 16px; }
.nb-p-title { font-weight: 700; margin-bottom: 4px; }
.nb-p-price { color: var(--nb-green-600); font-weight: 700; }
.nb-p-meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--nb-gray-600); margin-top: 8px; }

/* ---------- Video player block ---------- */
.nb-video-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: var(--nb-radius); overflow: hidden; background: #000; }
.nb-video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Footer ---------- */
.nb-footer { background: var(--nb-gray-800); color: var(--nb-gray-200); padding: 36px 0; margin-top: 30px; }
.nb-footer a { color: var(--nb-yellow-200); }
.nb-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.nb-footer small { display: block; margin-top: 18px; color: var(--nb-gray-300); }

/* ---------- Slider (opacity) ---------- */
input[type=range] { width: 100%; accent-color: var(--nb-yellow-500); }

/* ---------- Misc ---------- */
.nb-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nb-empty { text-align: center; padding: 50px 20px; color: var(--nb-gray-600); }
