/* ============================================================
   SAVOR HAPPINESS — MASTER STYLESHEET (PERFORMANCE OPTIMIZED)
   Grouped & Categorized for Maintainability
   ============================================================ */

/* ============================================================
   [GROUP 1] FONTS, VARIABLES & BASE THEME
   ============================================================ */
@font-face {
  font-family: "NangKaiThot";
  src: url("fonts/MN-Nang-Kai-Thot-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* CI BRAND COLORS */
  --ci-green: #007a33;
  --ci-olive: #93a35a;
  --ci-orange: #ff8c00;
  --ci-yellow: #f4e105;
  --ci-soft-yellow: #fffbd3;
  --ci-cream: #f8f2e6;
  --ci-white: #ffffff;

  /* SEMANTIC (LIGHT MODE) */
  --bg-main: var(--ci-cream);
  --bg-nav: rgba(255, 255, 255, 0.95);
  --bg-card: var(--ci-white);
  --text-main: #333333;
  --text-nav: #444444;
  --accent-color: var(--ci-orange);
  --nav-border: rgba(0, 122, 51, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.08);

  /* Legacy aliases */
  --savor-green: var(--ci-green);
  --savor-orange: var(--ci-orange);
  --savor-cream: var(--ci-cream);
  --savor-white: var(--ci-white);
  --savor-yellow: var(--ci-yellow);
  --savor-olive: var(--ci-olive);
}

[data-theme="dark"] .logo-img {
  content: url("img/logo/savorhappiness-2.png") !important;
}

[data-theme="dark"] {
  --bg-main: var(--ci-olive);
  --bg-nav: var(--ci-green);
  --bg-card: var(--ci-white);
  --text-main: #ffffff;
  --text-nav: #ffffff;
  --nav-border: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "NangKaiThot", "Anuphan", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.8;
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  padding-top: 85px !important;
}

img {
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  display: block;
}

/* ============================================================
   [GROUP 2] LAYOUTS & MAIN SECTIONS
   ============================================================ */
.scroll-progress-container {
  position: fixed;
  top: 75px;
  left: 0;
  z-index: 10001;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--ci-green) 0%, var(--ci-orange) 60%, var(--ci-yellow) 100%);
  width: 0%;
  transition: width 0.15s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 0 8px rgba(255, 140, 0, 0.55), 0 0 20px rgba(255, 140, 0, 0.25);
  border-radius: 0 3px 3px 0;
  will-change: width;
  /* GPU Hint */
}

#home {
  min-height: 63vh;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

.grid-item {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  -webkit-backface-visibility: hidden;
  /* ลดขอบแตกตอน Hover */
  backface-visibility: hidden;
  transform: translateZ(0);
  /* บังคับใช้ GPU เรนเดอร์ */
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
  transition: transform 0.8s ease, filter 0.5s ease;
  will-change: transform, filter;
  /* GPU Hint */
}

.grid-item:hover img {
  filter: brightness(0.7);
  transform: scale(1.1);
}

.hero-content-overlay {
  position: relative;
  z-index: 10;
  text-align: center;
  color: white;
  padding: 60px 20px;
  max-width: 1000px;
  width: 100%;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#home h1 {
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  margin-bottom: 10px;
  text-transform: uppercase;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  line-height: 1.1;
  letter-spacing: 2px;
}

#home .subtitle-vibe {
  font-size: clamp(0.9rem, 4vw, 1.4rem);
  letter-spacing: 4px;
  margin-bottom: 15px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--savor-orange);
}

#home .hero-desc {
  font-size: clamp(0.85rem, 3vw, 1.15rem);
  margin-bottom: 30px;
  line-height: 1.8;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.9);
}

.section {
  padding: 100px 15%;
  margin: 0 auto;
  position: relative;
}

.section-title {
  margin-bottom: 60px;
  text-align: center;
  font-size: 2.4rem;
  color: var(--savor-green);
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: var(--savor-orange);
  margin: 15px auto 0;
  border-radius: 10px;
}

.district-label {
  margin: 50px 0 40px 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--savor-orange);
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
}

/* ============================================================
   [GROUP 3] COMPONENTS (CARDS, BUTTONS, SEARCH, VIDEO)
   ============================================================ */

/* --- Search Bar --- */
.search-wrapper {
  max-width: 850px;
  margin: 37px auto 50px !important;
  padding: 0 20px;
  position: relative;
  z-index: 100;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 16px;
  padding: clamp(6px, 2vw, 10px) clamp(6px, 2vw, 10px) clamp(6px, 2vw, 10px) clamp(15px, 4vw, 30px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.search-input-group:focus-within {
  transform: translateY(-2px);
  border-color: #ff8c00;
  box-shadow: 0 20px 50px rgba(255, 140, 0, 0.15);
}

#shopSearchInput {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  color: #007932;
  background: transparent;
  font-weight: 500;
}

#shopSearchInput::placeholder {
  color: #bbb;
}

#searchBtn {
  background: #007a33 !important;
  color: #ffffff !important;
  border: none;
  padding: clamp(10px, 3vw, 14px) clamp(15px, 4vw, 35px);
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.3s ease;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

#searchBtn:hover {
  background: #ff8c00 !important;
  transform: scale(1.02);
}

#searchSuggestions {
  position: absolute;
  top: calc(100% + 15px);
  left: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 10px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 1001;
  display: none;
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-item {
  padding: 18px 25px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: background-color 0.2s, padding-left 0.2s, color 0.2s;
  color: #444;
  font-size: 1rem;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: #fdfaf5;
  color: #007a33;
  padding-left: 35px;
}

.suggestion-item i {
  color: #ff8c00;
  font-size: 1.1rem;
}

[data-theme="dark"] .suggestion-item {
  color: #444444 !important;
}

/* --- Video Section --- */
.video-experience-v2 {
  padding-top: 100px;
  padding-bottom: 100px;
}

.video-wrapper {
  position: relative;
  width: 64%;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  margin: 40px auto;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  transform: translateZ(0);
  /* GPU Accelerated */
}

#myVideo {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  background: transparent !important;
  transition: transform 0.3s ease;
}

#myVideo:hover {
  transform: scale(1.02);
}

.mute-control-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  width: 45px;
  height: 45px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, background-color 0.3s;
}

.mute-control-btn:hover {
  background: rgba(255, 255, 255, 0.4) !important;
  transform: scale(1.1);
}

.video-content-box {
  background: #ffffff !important;
  padding: 50px 40px !important;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid #f0f0f0 !important;
  max-width: 850px !important;
  margin: 0 auto 40px !important;
  text-align: center;
}

.video-content-box .section-title {
  color: #007a33 !important;
  font-size: 2.5rem !important;
  font-weight: 800 !important;
  margin-bottom: 20px !important;
  line-height: 1.2 !important;
}

.video-description {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  text-align: center !important;
  margin: 30px auto 10px !important;
}

.video-description p {
  max-width: 900px !important;
  margin: 0 auto !important;
  line-height: 1.8 !important;
  font-size: 1.15rem !important;
  color: #555 !important;
}

.video-tag {
  display: none !important;
}

/* --- Shop Cards --- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  justify-items: center;
}

.shop-card {
  width: 100%;
  max-width: 450px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  margin-bottom: 30px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  /* กันภาพสั่นกระตุกเวลา Hover */
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.shop-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 122, 51, 0.15);
}

.photo-gallery {
  display: block;
  height: 320px;
  overflow: hidden;
  position: relative;
  background: #f4f4f4;
  border-radius: 10px !important;
  isolation: isolate;
}

.photo-gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px !important;
  cursor: zoom-in;
}

.photo-item {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out, transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1;
  cursor: pointer;
  border-radius: 10px !important;
  will-change: opacity, transform;
}

.photo-item.active {
  opacity: 1;
  z-index: 2;
}

.photo-gallery:hover .photo-item.active {
  transform: scale(1.04);
}

.shop-name {
  padding: 0 !important;
  margin-bottom: 8px !important;
  font-size: 1.25rem !important;
  text-align: left !important;
  line-height: 1.3 !important;
  color: var(--text-main);
  font-weight: 700;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.shop-card img,
.merch-card img,
.author-profile-pic img {
  border-radius: 10px !important;
  object-fit: cover !important;
}

/* --- Ticker Banner --- */
.shop-ticker-banner {
  width: 100%;
  height: 70px;
  background-color: var(--bg-card);
  border-top: 1px solid rgba(0, 122, 51, 0.1);
  border-bottom: 1px solid rgba(0, 122, 51, 0.1);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  z-index: 90;
  margin: 40px 0;
}

.shop-ticker-track {
  display: flex !important;
  white-space: nowrap;
  will-change: transform;
  /* ดัน GPU ทำงาน ลดภาระ CPU ให้เว็บวิ่งฉิว */
  animation: tickerLoopRight 40s linear infinite !important;
}

@keyframes tickerLoopRight {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0%);
  }
}

.ticker-item {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--savor-green);
  padding: 0 30px;
  display: flex;
  align-items: center;
}

.ticker-sep {
  color: var(--savor-orange);
  font-weight: bold;
  margin: 0 10px;
}

/* --- Merch Section --- */
.merch-category {
  margin-bottom: 60px;
}

/* Postcard sub-section only: 2-col grid for MinBuri + NongChok cards */
#merch>.merch-category {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  align-items: start;
}

/* Postcard images — actual size 1500×770 (wide landscape) */
#merch>.merch-category .merch-card img {
  aspect-ratio: 1500 / 770;
  height: auto;
  width: 100%;
  object-fit: contain;
  background: var(--ci-cream);
}

.merch-sub-title {
  grid-column: 1 / -1;
  margin: 40px 0 30px 0 !important;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-main);
  border-left: 6px solid var(--savor-orange);
  padding-left: 20px;
}

.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 35px;
}

.merch-grid.bookmark-triple-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 15px !important;
  width: 100% !important;
  max-width: 1000px;
  margin: 30px auto 0 !important;
  padding: 0 !important;
}

/* Bookmark card image — fixed height to match sticker card */
.merch-grid.bookmark-triple-grid .merch-card img {
  aspect-ratio: auto;
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top;
}

/* is-hero / is-secondary modifier (for bookmark cards) */
.merch-card.is-hero,
.merch-card.is-secondary {
  width: 100% !important;
}

/* Single-item grid (Sticker section) */
.merch-grid.single-item-grid {
  grid-template-columns: 1fr !important;
  max-width: 400px;
  margin: 0 auto;
}

/* --- Merch Split Row (Sticker + Bookmarks side-by-side) --- */
/* Note: HTML has a stray </div> that pushes .merch-split-row outside .section,
   so we apply width/max-width/margin here directly to match the section layout */
.merch-split-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  width: 90%;
  max-width: 960px;
  margin: 20px auto 60px;
  box-sizing: border-box;
}

/* Sticker side */
.sticker-side {
  flex: 0 0 auto;
  width: clamp(200px, 28%, 280px);
  min-width: 0;
}

/* Sticker image — same height as bookmark images */
.sticker-side .merch-card img {
  height: 180px;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

.bookmarks-side {
  flex: 1 1 0;
  min-width: 0;
}

/* Postcard cards (direct children of merch-category, no grid wrapper) */
.merch-category>.merch-card {
  max-width: 100%;
}

.merch-card {
  width: 100% !important;
  box-sizing: border-box;
  background: var(--bg-card);
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.merch-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 122, 51, 0.08);
}

.merch-card img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 20px;
  object-fit: cover;
  aspect-ratio: 4/3;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.55s ease !important;
}

.merch-card img:hover {
  transform: scale(1.045) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

.merch-card p {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  color: var(--savor-green);
  font-weight: 700;
  margin-top: 12px;
}

/* --- Button Group --- */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
}

/* --- Primary Button --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #007a33 !important;
  color: #ffffff !important;
  padding: 16px 35px !important;
  border-radius: 10px;
  text-decoration: none !important;
  font-weight: 700 !important;
  white-space: nowrap;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
  transition: background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.45s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 5px 20px rgba(0, 122, 51, 0.25) !important;
  margin-top: 15px;
  animation: pulse-green 2s infinite;
}

.btn-primary:hover {
  background: #005c26 !important;
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 10px 30px rgba(0, 122, 51, 0.35), 0 4px 12px rgba(0, 122, 51, 0.2) !important;
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.99) !important;
  box-shadow: 0 4px 12px rgba(0, 122, 51, 0.25) !important;
  transition-duration: 0.1s !important;
}

/* --- Lightbox --- */
#simpleLightbox {
  display: none;
  position: fixed;
  z-index: 20000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  overflow: hidden !important;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 0 !important;
}

#lightboxImg {
  max-width: 100vw !important;
  max-height: 100vh !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  transition: transform 0.35s cubic-bezier(0.15, 0, 0.15, 1);
  cursor: zoom-in;
  user-select: none;
  display: block;
}

#lightboxImg.zoomed {
  max-width: none !important;
  max-height: none !important;
  cursor: grab;
}

#lightboxImg.zoomed:active {
  cursor: grabbing;
}

#simpleLightbox .close-btn {
  top: 20px !important;
  right: 20px !important;
  width: 45px !important;
  height: 45px !important;
  background: rgba(0, 0, 0, 0.6) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 28px !important;
  z-index: 20002 !important;
  text-decoration: none !important;
  line-height: 0 !important;
}

#simpleLightbox .nav-btn {
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

#simpleLightbox .nav-btn.prev {
  left: 15px !important;
}

#simpleLightbox .nav-btn.next {
  right: 15px !important;
}

/* ============================================================
   [GROUP 4] FOOTER
   ============================================================ */
.footer {
  position: relative;
  background-color: var(--ci-green);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 40px 40px 0 0;
  margin-top: 60px;
  overflow: hidden;
  padding: 0;
}

.footer-watermark {
  position: absolute;
  top: clamp(-5px, 1vw, 5px);
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(3.5rem, 11vw, 8.5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(251, 206, 74, 0.16);
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 0;
  width: 100%;
  text-align: center;
}

.footer-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(28px, 5vw, 70px);
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 110px) clamp(28px, 6%, 80px) clamp(44px, 5vw, 64px);
}

.footer-col--brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-logo {
  height: 38px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 2px;
  object-fit: contain;
}

.footer-tagline {
  font-size: 0.68rem;
  letter-spacing: 2.5px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
  line-height: 1.5;
}

.footer-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.75;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ci-yellow);
  color: var(--ci-green) !important;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none !important;
  margin-top: 6px;
  width: fit-content;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 15px rgba(251, 206, 74, 0.25);
}

.footer-cta-btn:hover {
  background: var(--ci-orange);
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(255, 140, 0, 0.35);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-col-title {
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ci-yellow);
  font-weight: 700;
  margin: 0 0 18px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(251, 206, 74, 0.22);
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav-list li a {
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.25s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  gap: 9px;
}

.footer-nav-list li a:hover {
  color: var(--ci-yellow);
  transform: translateX(5px);
}

.footer-nav-list li a i {
  font-size: 0.8rem;
  opacity: 0.65;
  width: 15px;
  flex-shrink: 0;
}

.footer-divider {
  position: relative;
  z-index: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.12) 20%, rgba(255, 255, 255, 0.12) 80%, transparent);
  margin: 0 clamp(28px, 6%, 80px);
}

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: clamp(32px, 4vw, 52px) clamp(28px, 6%, 80px) clamp(36px, 4vw, 52px);
}

.footer-socials {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-socials a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  background: rgba(255, 255, 255, 0.04);
}

.footer-socials a:hover {
  background: var(--ci-yellow);
  color: var(--ci-green);
  border-color: var(--ci-yellow);
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 6px 18px rgba(251, 206, 74, 0.3);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-align: center;
  margin: 0;
}

/* ============================================================
   [GROUP 5] MODALS, SUPPORT, AUTHOR
   ============================================================ */

/* --- Custom Modal --- */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 30000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: flex-start !important;
  justify-content: center;
  overflow-y: auto !important;
  padding: 40px 15px !important;
}

.modal-content {
  background: var(--bg-card);
  padding: 30px 20px !important;
  margin: auto !important;
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: modalZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  box-sizing: border-box !important;
}

@keyframes modalZoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content img {
  width: 100% !important;
  border-radius: 12px !important;
  margin-bottom: 20px;
  max-height: 40vh !important;
  object-fit: contain !important;
  background: #f4f4f4 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 32px;
  cursor: pointer;
  color: #888;
  background: none;
  border: none;
  transition: transform 0.2s, color 0.2s;
}

.close-modal:hover {
  color: var(--ci-orange);
  transform: scale(1.1);
}

#modalTitle {
  color: var(--ci-green);
  font-size: 1.8rem;
  margin-bottom: 8px;
  font-weight: 800;
}

#modalDesc {
  color: #666;
  margin-bottom: 25px;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* --- Support/Author Components --- */
.support-hero {
  padding: 80px 20px;
  display: flex;
  justify-content: center;
}

.support-glass-card {
  display: flex;
  flex-direction: row;
  background: linear-gradient(135deg, var(--ci-green) 0%, #004d21 100%);
  border-radius: 24px;
  max-width: 900px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 122, 51, 0.25);
  color: white;
  position: relative;
  transform: translateZ(0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.support-glass-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 122, 51, 0.35);
}

.support-glass-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 250px;
  height: 250px;
  background: rgba(251, 206, 74, 0.15);
  border-radius: 50%;
  filter: blur(40px);
}

.support-text-side {
  flex: 1;
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
}

.support-heading {
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--ci-yellow);
  margin-bottom: 5px;
  font-weight: 800;
  letter-spacing: 1px;
}

.support-sub {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 20px;
  letter-spacing: 1px;
  color: #fff;
}

.support-description {
  font-size: 1.05rem;
  line-height: 1.8;
  opacity: 0.85;
  margin-bottom: 30px;
  color: #fff;
}

.support-creator-tag {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 20px 8px 8px;
  border-radius: 50px;
  width: fit-content;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.small-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--ci-yellow);
  object-fit: cover;
}

.support-qr-side {
  background: rgba(255, 255, 255, 0.05);
  padding: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.qr-wrapper {
  background: white;
  padding: 15px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  margin-bottom: 15px;
  border: 4px solid var(--ci-yellow);
}

.qr-wrapper img {
  width: 180px;
  height: 180px;
  display: block;
}

.qr-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--ci-orange);
  box-shadow: 0 0 15px var(--ci-orange);
  animation: scanQR 3s infinite linear;
}

@keyframes scanQR {
  0% {
    transform: translateY(-10px);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(190px);
    opacity: 0;
  }
}

.qr-hint {
  color: var(--ci-yellow);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 1.1rem;
  animation: pulse-hint 2s infinite;
}

.author-container {
  max-width: 880px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 30px;
  padding: 50px 60px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 50px;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.02);
  transform: translateZ(0);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.author-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 60px rgba(0, 122, 51, 0.07);
}

.author-img {
  width: 210px;
  height: 210px;
  border-radius: 50% !important;
  object-fit: cover;
  box-shadow: -15px 15px 0px rgba(0, 122, 51, 0.08);
  margin-bottom: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  flex-shrink: 0;
}

.author-img:hover {
  transform: translate(5px, -5px);
  box-shadow: -20px 20px 0px rgba(255, 140, 0, 0.2);
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 2.2rem;
  color: var(--ci-green) !important;
  margin-bottom: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.author-role {
  font-size: 1.1rem;
  color: var(--text-main) !important;
  margin-bottom: 30px;
  line-height: 1.6;
  border-left: 3px solid var(--ci-orange);
  padding-left: 15px;
}

.author-logos {
  display: flex;
  gap: 15px;
  justify-content: flex-start;
  margin-bottom: 30px;
  align-items: center;
}

.author-logos img {
  height: 40px !important;
  width: auto !important;
  border-radius: 8px !important;
  transition: transform 0.3s ease;
}

.author-logos img:hover {
  transform: scale(1.1);
}

.author-socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 12px;
  background: rgba(0, 122, 51, 0.05);
  color: var(--ci-green);
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.social-btn:hover {
  background: var(--ci-green);
  color: white !important;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 122, 51, 0.2);
}

/* ============================================================
   [GROUP 6] DARK MODE OVERRIDES
   ============================================================ */
[data-theme="dark"] body {
  background-color: var(--savor-olive) !important;
  color: #ffffff !important;
}

[data-theme="dark"] nav,
[data-theme="dark"] .nav-links {
  background-color: #007A33 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .nav-links li a,
[data-theme="dark"] #hamburgerBtn i,
[data-theme="dark"] .hamburger-menu i {
  color: #ffffff !important;
}

[data-theme="dark"] .section-title {
  color: #ffffff !important;
}

[data-theme="dark"] #author .section-title {
  color: #007A33 !important;
}

[data-theme="dark"] #highlights,
[data-theme="dark"] #merch,
[data-theme="dark"] #book-feature,
[data-theme="dark"] #video-section {
  background-color: #004d21 !important;
}

[data-theme="dark"] .district-label {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  padding: 12px 30px !important;
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 40px !important;
  font-weight: 700;
}

[data-theme="dark"] .shop-card {
  background-color: #ffffff !important;
  border: none !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  isolation: isolate !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .shop-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .shop-info {
  background-color: #ffffff !important;
  padding: 22px !important;
  text-align: left;
}

[data-theme="dark"] .shop-info .shop-name {
  color: #007a33 !important;
  font-weight: 800 !important;
  font-size: 1.25rem !important;
  margin-bottom: 6px !important;
}

[data-theme="dark"] .shop-info .shop-tag {
  color: #ff8c00 !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  display: inline-block;
  margin-bottom: 10px;
}

[data-theme="dark"] .shop-info p,
[data-theme="dark"] .shop-info span {
  color: #333333 !important;
  line-height: 1.5;
}

[data-theme="dark"] .merch-card {
  background-color: #ffffff !important;
  padding: 15px !important;
  border-radius: 10px;
  border: none !important;
  transition: transform 0.3s ease, background-color 0.3s ease !important;
}

[data-theme="dark"] .merch-card:hover {
  background: rgba(0, 122, 51, 0.05) !important;
  transform: translateY(-5px) !important;
}

[data-theme="dark"] .merch-card p {
  color: #007a33 !important;
  font-weight: 600 !important;
  margin-top: 12px !important;
}

[data-theme="dark"] .merch-card .merch-item-name {
  color: var(--ci-orange) !important;
  font-size: 1.15rem !important;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .merch-card .merch-item-price {
  color: var(--ci-soft-yellow) !important;
  opacity: 0.9;
}

[data-theme="dark"] .merch-sub-title {
  color: #ffffff !important;
  border-left: 4px solid var(--ci-orange) !important;
  padding-left: 15px !important;
  margin-bottom: 25px !important;
}

[data-theme="dark"] .merch-sub-title i {
  color: #ffffff !important;
  margin-right: 10px;
}

[data-theme="dark"] #bookmark-section .merch-sub-title {
  color: var(--ci-orange) !important;
}

[data-theme="dark"] .book-text h2,
[data-theme="dark"] .book-description,
[data-theme="dark"] .support-card .section-title,
[data-theme="dark"] .support-card .support-desc {
  color: #ffffff !important;
}

[data-theme="dark"] .video-content-box .section-title {
  color: #007a33 !important;
}

[data-theme="dark"] .video-description p {
  color: #555 !important;
}

[data-theme="dark"] .book-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .book-card:hover {
  box-shadow: 0 25px 50px rgba(251, 206, 74, 0.12);
}

[data-theme="dark"] .book-card h2 {
  color: #ffffff;
}

[data-theme="dark"] .badge {
  background: rgba(251, 206, 74, 0.15);
  color: #fbce4a;
  border-color: rgba(251, 206, 74, 0.3);
}

[data-theme="dark"] .footer {
  background-color: #001f10;
}

[data-theme="dark"] .footer-watermark {
  -webkit-text-stroke-color: rgba(251, 206, 74, 0.1);
}

[data-theme="dark"] .footer-desc,
[data-theme="dark"] .footer-tagline,
[data-theme="dark"] .footer-copy {
  color: rgba(255, 255, 255, 0.55) !important;
}

[data-theme="dark"] .footer-nav-list li a {
  color: rgba(255, 255, 255, 0.55) !important;
}

[data-theme="dark"] .footer-nav-list li a:hover {
  color: var(--ci-yellow) !important;
}

[data-theme="dark"] .footer-cta-btn {
  background: var(--ci-yellow);
  color: #002b17 !important;
}

[data-theme="dark"] .support-glass-card {
  background: linear-gradient(135deg, #004d21 0%, #001f10 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .author-container {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .author-img {
  box-shadow: -15px 15px 0px rgba(244, 225, 5, 0.15);
}

[data-theme="dark"] .author-img:hover {
  box-shadow: -20px 20px 0px rgba(255, 140, 0, 0.3);
}

[data-theme="dark"] .author-name {
  color: var(--ci-yellow) !important;
}

[data-theme="dark"] .author-role {
  color: #dddddd !important;
}

[data-theme="dark"] .social-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

[data-theme="dark"] .social-btn:hover {
  background: var(--ci-yellow);
  color: #000 !important;
}

[data-theme="dark"] .filter-btn {
  border-color: var(--ci-yellow);
  color: var(--ci-yellow);
}

[data-theme="dark"] .filter-btn.active,
[data-theme="dark"] .filter-btn:hover {
  background: var(--ci-yellow);
  color: #004d21;
}

[data-theme="dark"] .shop-info-clickable:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] #modalTitle {
  color: #007a33;
}

[data-theme="dark"] #modalDesc {
  color: #ddd;
}

[data-theme="dark"] .thumb-item.active {
  border-color: #fbce4a;
  box-shadow: 0 8px 20px rgba(251, 206, 74, 0.3);
}

/* --- Theme Toggle for Light Mode explicitly --- */
html:not([data-theme="dark"]) #highlights,
html:not([data-theme="dark"]) #merch {
  background-color: #fcfcfc !important;
}

html:not([data-theme="dark"]) .shop-card,
html:not([data-theme="dark"]) .merch-card {
  background-color: #ffffff !important;
  border: 1px solid #f0f0f0 !important;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05) !important;
}

html:not([data-theme="dark"]) .shop-card:hover,
html:not([data-theme="dark"]) .merch-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 15px 35px rgba(0, 122, 51, 0.08) !important;
}

html:not([data-theme="dark"]) .shop-info {
  background-color: #ffffff !important;
  padding: 22px !important;
}

html:not([data-theme="dark"]) .shop-info .shop-name {
  color: #007a33 !important;
  font-weight: 800 !important;
}

html:not([data-theme="dark"]) .shop-info .shop-tag {
  color: #ff8c00 !important;
  font-weight: 600 !important;
}

html:not([data-theme="dark"]) .shop-info p,
html:not([data-theme="dark"]) .shop-info span {
  color: #444444 !important;
  line-height: 1.8;
}

html:not([data-theme="dark"]) .district-label {
  color: #007a33 !important;
  background: #ffffff !important;
  border: 1.5px solid #007a33 !important;
  padding: 12px 30px !important;
  border-radius: 10px;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(0, 122, 51, 0.1) !important;
}

html:not([data-theme="dark"]) .merch-card p {
  color: #007a33 !important;
  font-weight: 700 !important;
  margin-top: 12px !important;
}

html:not([data-theme="dark"]) .lang-btn {
  border: 1.5px solid #007a33;
  color: #007a33;
  background: transparent;
}

html:not([data-theme="dark"]) .lang-btn:hover {
  background: #007a33;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 122, 51, 0.2);
}

html:not([data-theme="dark"]) .theme-btn {
  border: 1.5px solid #ccc;
  color: #333;
  background: #f5f5f5;
}

html:not([data-theme="dark"]) .theme-btn:hover {
  border-color: #ff8c00;
  background: #fff4e8;
  color: #ff8c00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.15);
}

html:not([data-theme="dark"]) .nav-close-btn {
  color: #007a33;
}

/* ============================================================
   [GROUP 7] NAVIGATION & SPEED DIAL
   ============================================================ */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  height: 85px;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  transition: background-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.4s;
}

.logo img {
  height: 33px;
  width: auto;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo img:hover {
  transform: scale(1.08);
}

.nav-links {
  display: flex;
  flex-direction: row;
  list-style: none;
  gap: 32px;
  align-items: center;
  margin: 0;
  padding: 0;
  position: static;
  height: auto;
  width: auto;
  background: transparent;
}

.nav-links li a {
  text-decoration: none;
  color: #444;
  font-weight: 500;
  font-size: 1.05rem;
  transition: color 0.3s ease;
  padding: 10px 0;
  position: relative;
}

.nav-links li a:hover {
  color: #007a33;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--ci-orange);
  border-radius: 2px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links li a:hover::after {
  width: 100%;
}

[data-theme="dark"] .nav-links li a::after {
  background: var(--ci-yellow);
}

.hamburger-menu {
  display: none !important;
}

.nav-controls-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-btn,
.theme-btn {
  width: 65px;
  height: 35px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.nav-close-btn {
  display: none !important;
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 10005;
  transition: transform 0.3s ease;
}

.nav-close-btn:active {
  transform: rotate(90deg) scale(0.9);
}

/* Speed Dial */
.speed-dial-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 15px;
}

.speed-dial-main-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #fbce4a !important;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.4s;
}

.speed-dial-main-btn img {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain !important;
  position: absolute !important;
  transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out !important;
}

.speed-dial-main-btn .img-active {
  opacity: 0 !important;
  transform: scale(0.5) !important;
  visibility: hidden !important;
}

.speed-dial-main-btn .img-normal {
  opacity: 1 !important;
  transform: scale(1) !important;
  visibility: visible !important;
}

.speed-dial-container.active .speed-dial-main-btn .img-normal {
  opacity: 0 !important;
  transform: scale(0.5) !important;
  visibility: hidden !important;
}

.speed-dial-container.active .speed-dial-main-btn .img-active {
  opacity: 1 !important;
  transform: scale(1) !important;
  visibility: visible !important;
}

.speed-dial-container.active .speed-dial-main-btn {
  transform: rotate(15deg) scale(1.1) !important;
  background-color: #fbce4a !important;
}

.speed-dial-buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
  margin-bottom: 15px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.5);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease, visibility 0.4s;
  pointer-events: none;
}

.speed-dial-container.active .speed-dial-buttons {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dial-btn {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background-color 0.25s ease !important;
}

.dial-btn:hover {
  transform: scale(1.18) translateY(-4px) !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22) !important;
}

.phone-btn {
  background: #ffd54f;
}

.line-btn {
  background: #66bb6a;
}

.copy-btn {
  background: #ffca28;
}

/* ============================================================
   [GROUP 8] GUIDEBOOK SECTION (The True Fix - Perfect Flexbox)
   ============================================================ */
.book-grid-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
  /* ระยะห่างระหว่างรูปกับการ์ด จะเกาะกลุ่มกันตรงกลางเสมอ */
  max-width: 1150px;
  margin: 0 auto;
  padding: clamp(60px, 8vw, 100px) 20px;
  flex-wrap: wrap;
  /* ถ้าจอเริ่มเล็ก จะปัดตกบรรทัดให้อัตโนมัติ */
}

/* ฝั่งซ้าย (รูปภาพ) */
.book-visual {
  flex: 0 0 auto;
  width: 100%;
  max-width: 380px;
  /* คุมขนาดกล่องฝั่งซ้ายทั้งหมด */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 💥 แก้บั๊ก: บังคับให้หนังสือและ Thumbnails อยู่กึ่งกลางเสมอ */
}

/* ฝั่งขวา (ข้อความ) */
.book-text {
  flex: 1 1 400px;
  /* ยืดหยุ่นได้ แต่ขอพื้นที่ขั้นต่ำ 400px */
  max-width: 580px;
  /* ไม่ให้การ์ดยืดอ้วนเกินไป */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.book-float-wrapper {
  animation: floatBook 6s ease-in-out infinite;
  padding: 15px;
  will-change: transform;
  width: 100%;
  display: flex;
  justify-content: center;
}

@keyframes floatBook {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-12px);
  }
}

.main-img-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.inner-mockup {
  width: 100%;
  max-width: 360px;
  /* ขนาดหนังสือที่สวยกำลังดี ไม่เล็กไม่ใหญ่ */
  aspect-ratio: 1 / 1.414;
  object-fit: cover;
  border-radius: 5px 16px 16px 5px;
  box-shadow:
    -6px 0 15px rgba(0, 0, 0, 0.05) inset,
    -2px 0 5px rgba(0, 0, 0, 0.05) inset,
    15px 25px 40px rgba(0, 0, 0, 0.12),
    5px 10px 15px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
  display: block;
  transform: translateZ(0);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease !important;
}

.inner-mockup:hover {
  transform: scale(1.03) rotate(-1.5deg) !important;
  box-shadow:
    -8px 0 18px rgba(0, 0, 0, 0.08) inset,
    -2px 0 6px rgba(0, 0, 0, 0.08) inset,
    25px 40px 60px rgba(0, 0, 0, 0.15),
    8px 15px 20px rgba(0, 0, 0, 0.1) !important;
}

/* --- ส่วนของ Thumbnails --- */
.book-thumbs {
  display: flex;
  justify-content: center;
  /* กึ่งกลางเป๊ะๆ ตรงกับหนังสือแล้วครับ */
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  width: 100%;
  margin-top: 15px;
}

.thumb-item {
  width: calc((100% - 42px) / 4);
  /* คำนวณแบ่ง 4 รูปพอดีเป๊ะ หักลบ Gap 14px * 3 */
  max-width: 70px;
  aspect-ratio: 1 / 1.414;
  height: auto !important;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  opacity: 0.5;
  transform: translateZ(0);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.thumb-item:hover {
  transform: translateY(-4px) scale(1.08) !important;
  opacity: 1 !important;
  box-shadow: 0 10px 20px rgba(0, 122, 51, 0.15) !important;
}

.thumb-item.active {
  border-color: #007a33;
  transform: translateY(-4px);
  opacity: 1;
  box-shadow: 0 8px 18px rgba(0, 122, 51, 0.25);
}

/* --- ส่วนของการ์ดข้อความ --- */
.book-card {
  background: #ffffff;
  padding: clamp(35px, 5vw, 55px) clamp(30px, 4vw, 50px);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.04);
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 60px rgba(0, 122, 51, 0.08);
}

.book-card .section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem) !important;
  margin-bottom: 20px !important;
  letter-spacing: 2px;
  line-height: 1.2;
}

.book-card .section-title::after {
  margin: 15px auto 0 !important;
  width: 60px !important;
  height: 4px !important;
  border-radius: 4px;
}

.book-badge-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.badge {
  background: #fffdf5;
  color: #007a33;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  font-weight: 700;
  border: 1px solid rgba(251, 206, 74, 0.6);
  white-space: nowrap;
}

.book-spec-detail {
  color: #ff8c00;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 15px;
  text-transform: uppercase;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.book-description {
  color: #555555;
  line-height: 1.8;
  margin-bottom: 30px;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.book-card .btn-group {
  margin-top: auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .book-grid-container {
    flex-direction: column;
    /* เปลี่ยนเป็นเรียงบนลงล่างเมื่อจอแคบ */
    gap: 40px;
  }

  .book-visual {
    max-width: 420px;
  }
}

@media (max-width: 768px) {
  .book-visual {
    max-width: 320px;
  }

  .book-card {
    padding: 35px 25px !important;
    border-radius: 20px;
  }

  .book-thumbs {
    gap: 10px;
  }

  .thumb-item {
    width: calc((100% - 30px) / 4) !important;
  }
}

/* ============================================================
   [GROUP 10] INTERACTIVE FEATURES & AUTHOR
   ============================================================ */
.filter-container {
  text-align: center;
  margin-bottom: 40px;
}

.filter-btn {
  background: transparent;
  border: 2px solid var(--ci-green);
  color: var(--ci-green);
  padding: 8px 25px;
  margin: 0 5px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--ci-green);
  color: #ffffff;
  box-shadow: 0 6px 15px rgba(0, 122, 51, 0.25);
  transform: translateY(-2px);
}

.shop-info,
.shop-info-clickable {
  padding: 22px 25px !important;
  text-align: left !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}

.shop-info-clickable {
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.shop-info-clickable:hover {
  background: rgba(0, 122, 51, 0.04);
}

.click-more-hint {
  color: var(--ci-orange);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateX(-10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.shop-card:hover .click-more-hint {
  opacity: 1;
  transform: translateX(0);
}

.shop-tag {
  font-size: 0.85rem !important;
  margin-bottom: 12px !important;
  display: inline-block !important;
  background: rgba(255, 140, 0, 0.1) !important;
  padding: 5px 14px !important;
  border-radius: 50px !important;
  color: var(--ci-orange) !important;
  font-weight: 700 !important;
}

/* ============================================================
   [GROUP 11 & 12] RESPONSIVE & MEDIA QUERIES (Foldable + Tablet + Mobile)
   ============================================================ */

@media (max-width: 1024px) {
  body {
    padding-top: 65px !important;
  }

  /* Book feature: fluid at tablet — reduce image size slightly */
  .book-visual {
    width: clamp(220px, 38%, 360px);
  }

  .inner-mockup {
    max-width: 280px;
  }

  nav {
    height: 70px !important;
    padding: 0 20px !important;
    display: flex !important;
    justify-content: space-between !important;
  }

  .hamburger-menu {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #007a33;
    z-index: 10002 !important;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    transition: transform 0.2s ease;
  }

  .hamburger-menu:active {
    transform: scale(0.9);
  }

  nav>.nav-right-container>.nav-controls-wrapper {
    display: none !important;
  }

  .nav-links {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    transform: translateX(100%) !important;
    width: min(75%, 320px) !important;
    height: 100dvh !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 35px !important;
    z-index: 10001 !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.45s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    transform: translateX(0) !important;
  }

  .nav-links .nav-controls-wrapper {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 15px !important;
    width: 80% !important;
    margin-top: 20px !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(128, 128, 128, 0.2) !important;
  }

  .nav-links .lang-btn,
  .nav-links .theme-btn {
    width: 110px !important;
    height: 45px !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
  }

  .nav-links .nav-close-btn {
    display: flex !important;
  }

  .filter-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    /* overflow-x: auto !important; */
    justify-content: center;
    gap: 10px !important;
    padding: 8px 0 !important;
    /* no side padding — section handles 15% */
    -webkit-overflow-scrolling: touch;
  }

  .filter-container::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  .shop-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 10px 0 !important;
    /* inherit section 15% horizontal */
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Match desktop horizontal padding exactly (15%) — only reduce vertical */
  .section,
  section {
    padding-top: 70px !important;
    padding-bottom: 70px !important;
    padding-left: 15% !important;
    padding-right: 15% !important;
  }

  /* Hero section: zero ALL padding so search-wrapper 70% = 70% of viewport */
  #home {
    padding-top: 30px !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Search bar: vw units = always 70% of VIEWPORT regardless of parent */
  .search-wrapper {
    width: 70vw !important;
    margin-left: 15vw !important;
    margin-right: 15vw !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .merch-split-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 30px !important;
  }

  .sticker-side,
  .bookmarks-side {
    width: 100% !important;
    flex: none !important;
  }

  .click-more-hint {
    opacity: 1 !important;
    transform: translateX(0) !important;
    margin-top: 5px !important;
    font-size: 0.9rem !important;
  }

  .shop-info,
  .shop-info-clickable {
    padding: 16px 20px !important;
  }

  .shop-name {
    font-size: 1.15rem !important;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: clamp(28px, 4vw, 50px);
  }

  .footer-col--brand {
    grid-column: 1 / -1;
  }

  .scroll-progress-container {
    top: 70px !important;
  }

  .video-wrapper {
    width: 100% !important;
    /* section's 15% padding handles side margins */
    margin: 20px auto !important;
    border-radius: 10px !important;
  }

  .video-content-box {
    max-width: 100% !important;
  }
}

@media (min-width: 1025px) {

  .nav-backdrop,
  .nav-close-btn,
  .nav-links .nav-close-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .hero-content-overlay {
    padding: 80px 40px;
    max-width: 1100px;
  }

  .section-title {
    font-size: clamp(2.4rem, 3vw, 3rem);
    margin-bottom: 70px;
  }

  .shop-grid {
    gap: clamp(32px, 4vw, 60px);
    max-width: 1100px;
  }

  .book-card {
    max-width: 960px !important;
    padding: 60px 80px !important;
  }

  .video-wrapper {
    max-width: 1000px;
    margin: 68px auto !important;
  }
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(5, 1fr) !important;
  }

  .hero-content-overlay {
    padding: 40px 15px;
  }

  .shop-grid {
    grid-template-columns: 1fr !important;
    gap: 32px;
    width: 100% !important;
    /* section's 15% padding handles sides */
  }

  .shop-card {
    max-width: 350px;
  }

  /* Postcard grid → 1 column on mobile */
  #merch>.merch-category {
    grid-template-columns: 1fr !important;
  }

  .merch-grid.bookmark-triple-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Book feature — compact on mobile */
  .book-grid-container {
    flex-direction: column !important;
    gap: 24px !important;
    padding: 0 !important;
  }

  .book-visual {
    width: 100% !important;
    max-width: 240px !important;
    margin: 0 auto !important;
  }

  .inner-mockup {
    max-width: 160px !important;
  }

  .book-thumbs {
    gap: 8px !important;
  }

  .thumb-item {
    width: clamp(36px, 12vw, 52px) !important;
  }

  .book-text {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .book-card {
    padding: 24px 20px !important;
  }

  /* Mobile: maintain same 15% horizontal as desktop, reduce vertical only */
  .section {
    padding: 50px 15% !important;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 40px;
  }

  #home h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .video-content-box {
    padding: 35px 20px !important;
    margin: 0 auto 30px !important;
    /* auto centering, no hardcoded px side margins */
    width: auto !important;
  }

  /* Hero section — vertical space scales with viewport height, matches iPad Pro proportions */
  #home {
    padding-top: clamp(30px, 10vh, 90px) !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Search bar: vw units, vertical margins scale proportionally */
  .search-wrapper {
    width: 70vw !important;
    margin-left: 15vw !important;
    margin-right: 15vw !important;
    margin-top: clamp(10px, 2.5vh, 30px) !important;
    margin-bottom: clamp(10px, 2.5vh, 30px) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .support-glass-card {
    flex-direction: column;
  }

  .support-text-side {
    padding: 40px 30px 20px;
    text-align: center;
    align-items: center;
  }

  .support-qr-side {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 20px;
  }

  .author-container {
    flex-direction: column;
    text-align: center;
    padding: 40px 0;
    gap: 30px;
    margin: 0 auto;
  }

  .author-img {
    width: 160px;
    height: 160px;
  }

  .footer {
    border-radius: 24px 24px 0 0;
    margin-top: 40px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 56px 28px 44px;
    text-align: center;
    align-items: center;
  }

  .footer-col--brand {
    grid-column: auto;
    padding-bottom: 44px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .inner-mockup {
    max-width: 250px;
  }

  .thumb-item {
    width: 55px !important;
  }

  .savor-cta-ring-wrapper {
    width: 100px;
    height: 100px;
    bottom: 20px;
    right: 20px;
  }

  .savor-cta-arrow {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
}

@media (max-width: 600px) {
  .search-input-group {
    padding: 5px 5px 5px 15px !important;
    border-radius: 12px !important;
  }

  #shopSearchInput {
    font-size: 0.9rem !important;
  }

  #searchBtn {
    padding: 8px 15px !important;
    font-size: 0.85rem !important;
  }

  /* Reduce book image on small phones — override ID specificity issue */
  #mainBookImg {
    max-width: 150px !important;
  }

  .thumb-item {
    width: 45px !important;
    height: 45px !important;
  }

  .custom-modal {
    padding: 20px 15px !important;
  }

  .modal-content {
    padding: 25px 15px !important;
  }

  #simpleLightbox .nav-btn {
    width: 45px !important;
    height: 45px !important;
    font-size: 18px !important;
  }
}

@media (max-width: 540px) {

  html,
  body {
    width: 100vw !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .site-header {
    width: 100vw !important;
  }

  nav {
    width: 100% !important;
    padding: 0 5% !important;
    /* proportional to section's 15% — avoid hardcoded px */
  }

  .one-page-container,
  #home {
    width: 100vw !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .hero-grid {
    width: 100vw !important;
  }

  /* Search bar small screens: vw units for reliable viewport sizing */
  .search-wrapper {
    width: 70vw !important;
    margin-left: 15vw !important;
    margin-right: 15vw !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .section:not(#home) {
    width: 100% !important;
    max-width: 100vw !important;
    /* 15% horizontal matches desktop — set by .section rule above */
    padding-left: 15% !important;
    padding-right: 15% !important;
    box-sizing: border-box !important;
  }

  .hamburger-menu {
    left: 15px !important;
  }
}

@media (max-width: 480px) {

  .shop-grid,
  .merch-grid,
  .merch-grid.bookmark-triple-grid,
  .shop-card {
    max-width: 100% !important;
  }

  .book-card {
    padding: 28px 18px !important;
    margin: 16px 0 !important;
    width: 100% !important;
  }

  .btn-primary,
  .btn-support-cta {
    width: 100% !important;
    display: inline-flex !important;
    justify-content: center !important;
  }

  .merch-grid.bookmark-triple-grid {
    grid-template-columns: 1fr !important;
  }

  .inner-mockup {
    max-width: 140px !important;
  }
}

@media (max-width: 359px) {
  .search-input-group {
    flex-direction: column !important;
    gap: 12px !important;
    padding: 15px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }

  #shopSearchInput {
    width: 100% !important;
    text-align: center !important;
    padding: 15px !important;
    border-radius: 50px !important;
    background: #ffffff !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
  }

  #searchBtn {
    width: 100% !important;
    padding: 15px !important;
    border-radius: 50px !important;
  }

  .inner-mockup {
    max-width: 120px !important;
  }
}

/* In-App Browser (Messenger/LINE) Landscape Fix */
@media (max-height: 600px) and (orientation: landscape) {

  body,
  .scroll-progress-container {
    padding-top: 69px !important;
    top: 6px !important;
  }

  .hero-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
  }

  #home {
    min-height: 100dvh !important;
    padding-top: 8px !important;
    /* compact for short landscape screens */
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Landscape phone: compact vertical margins */
  .search-wrapper {
    width: 70vw !important;
    margin-left: 15vw !important;
    margin-right: 15vw !important;
    margin-top: 8px !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================
   [GROUP 13] CTA RING & AMBIENT GLOW EFFECTS
   ============================================================ */
@keyframes savor-glow-pulse {

  0%,
  100% {
    transform: scale(1) translate(-50%, -50%);
    opacity: 0.2;
  }

  50% {
    transform: scale(1.15) translate(-45%, -45%);
    opacity: 0.5;
  }
}

.savor-ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 122, 51, 0.4) 0%, rgba(244, 225, 5, 0.1) 40%, transparent 70%);
  filter: blur(100px);
  mix-blend-mode: screen;
  animation: savor-glow-pulse 6s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
  /* GPU Hint */
}

@keyframes savor-ring-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.savor-cta-ring-wrapper {
  position: absolute;
  bottom: 40px;
  right: 40px;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  text-decoration: none;
  color: var(--ci-green);
}

.savor-cta-ring-wrapper svg {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: savor-ring-spin 16s linear infinite;
  transition: color 0.3s ease;
}

.savor-cta-ring-wrapper:hover svg {
  animation-duration: 5s;
  color: var(--ci-yellow);
}

.savor-cta-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ci-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  background-color: #fff;
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.savor-cta-ring-wrapper:hover .savor-cta-arrow {
  background-color: var(--ci-green);
  color: #fff;
  transform: rotate(-45deg);
  box-shadow: 0 0 15px rgba(0, 122, 51, 0.4);
}

/* Print Guard */
@media print {
  body {
    display: none !important;
  }
}

/* แก้ไขปัญหาสัดส่วนรูปภาพยืดในหมวดหนังสือและของที่ระลึก */
.inner-mockup,
.thumb-item,
.merch-card img,
.author-img {
  height: auto !important;
}

/* Modal Styles สำหรับเปิด PDF */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  /* ให้อยู่บนสุด */
  backdrop-filter: blur(3px);
  /* ทำให้พื้นหลังเบลอนิดๆ สไตล์ทันสมัย */
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 900px;
  height: 85vh;
  /* ความสูงของหน้าต่าง popup */
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: popupFadeIn 0.3s ease-out;
}

.modal-header {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
