/* Dark Theme Inner Pages Styling */
.farm-inner.theme-dark,
.theme-dark .farm-inner,
body.theme-dark {
  background-color: var(--dark-bg, #0b140f) !important;
  color: var(--dark-text-primary, #f3f7f4) !important;
  --background: #0b140f;
  --foreground: #f3f7f4;
  --forest: #4ade80;
  --deep: #11221a;
  --orange: #f59e0b;
  --border: rgba(82, 225, 159, 0.16);
  --font-sans: 'Noto Sans Thai', 'Plus Jakarta Sans', sans-serif;
}

.theme-dark .header {
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.theme-dark .header nav a {
  color: var(--dark-text-secondary, #a3b8ab);
}
.theme-dark .header nav a:hover {
  color: #ffffff;
}

.theme-dark .section {
  max-width: 1280px;
  width: calc(100% - 64px);
  padding: 60px 0;
  margin-inline: auto;
}

.theme-dark .detail h1 {
  color: #ffffff !important;
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 20px;
}

.theme-dark .section h1,
.theme-dark .section h2,
.theme-dark .section h3,
.theme-dark .section .eyebrow {
  color: #ffffff !important;
}

.theme-dark .section p {
  color: var(--dark-text-secondary, #a3b8ab) !important;
  line-height: 1.8;
}

/* Category Filter Tabs */
.theme-dark .product-category-filter,
.theme-dark .farm-category-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.theme-dark .product-category-filter a,
.theme-dark .farm-category-links a {
  background: var(--dark-surface, #11221a);
  color: var(--dark-text-primary, #f3f7f4);
  border: 1px solid var(--dark-border, rgba(82, 225, 159, 0.16));
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}
.theme-dark .product-category-filter a:hover,
.theme-dark .farm-category-links a:hover,
.theme-dark .product-category-filter a.active,
.theme-dark .farm-category-links a.active {
  background: var(--dark-emerald, #4ade80) !important;
  color: #0b140f !important;
  border-color: var(--dark-emerald, #4ade80) !important;
  box-shadow: 0 0 16px rgba(74, 222, 128, 0.4);
}
.theme-dark .product-category-filter a.active span,
.theme-dark .farm-category-links a.active span {
  color: #0b140f !important;
}

.theme-dark .farm-category-card {
  text-decoration: none !important;
}
.theme-dark .farm-category-card .farm-category-card-title {
  color: #ffffff !important;
}
.theme-dark .farm-category-card:hover .farm-category-card-title {
  color: var(--dark-mint, #52e19f) !important;
}

/* Product & News Cards */
.theme-dark .product-card,
.theme-dark .news-card,
.theme-dark .products-empty,
.theme-dark .policy-item-row {
  background: var(--dark-surface-card, #14281f) !important;
  color: var(--dark-text-primary, #f3f7f4) !important;
  border: 1px solid var(--dark-border, rgba(82, 225, 159, 0.16)) !important;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}
.theme-dark .product-card:hover,
.theme-dark .news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(74, 222, 128, 0.15);
  border-color: var(--dark-emerald, #4ade80) !important;
}

.theme-dark .product-img {
  background: #0d1e15 !important;
  border-radius: 0;
  height: 250px;
  overflow: hidden;
}
.theme-dark .product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.theme-dark .product-card:hover .product-img img {
  transform: scale(1.05);
}

.theme-dark .product-info {
  display: block;
  padding: 24px;
}
.theme-dark .product-info h3,
.theme-dark .card-kicker {
  color: #ffffff !important;
  font-weight: 700;
}
.theme-dark .card-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dark-gold, #fbbf24) !important;
}

.theme-dark .product-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dark-mint, #52e19f);
  font-weight: 600;
  font-size: 13px;
  margin-top: 14px;
}
.theme-dark .product-more:hover {
  color: var(--dark-gold, #fbbf24);
}

/* Detail & Rich Text */
.theme-dark .detail,
.theme-dark .body-text {
  color: var(--dark-text-secondary, #a3b8ab);
  line-height: 1.45;
  font-size: 15.5px;
}
.theme-dark .detail iframe {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--dark-border);
}
.theme-dark .body-text img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin-block: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--dark-border);
}

.theme-dark .red-button {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #042114;
  border-radius: 9999px;
  padding: 12px 24px;
  font-weight: 700;
  border: none;
}

.theme-dark .global-site-section {
  background: var(--dark-surface, #11221a);
  color: var(--dark-text-primary, #f3f7f4);
  border-color: var(--dark-border);
}

/* Slideshow on Inner Pages (Dark) */
.theme-dark .farm-inner-slides {
  background: radial-gradient(circle at 80% 20%, #163325 0%, var(--dark-bg) 65%);
  color: var(--dark-text-primary, #f3f7f4);
}
.theme-dark .farm-inner-slides .hero {
  background: transparent;
  color: var(--dark-text-primary, #f3f7f4);
}
.theme-dark .farm-inner-slides .hero h1 {
  color: #ffffff;
}
.theme-dark .farm-inner-slides .hero .lead {
  color: var(--dark-text-secondary, #a3b8ab);
}
.theme-dark .farm-inner-slides .hero .text-link {
  color: var(--dark-mint, #52e19f);
}
.theme-dark .farm-inner-slides .hero-note {
  color: var(--dark-text-primary, #f3f7f4);
  border-color: var(--dark-border-subtle);
}
.theme-dark .farm-inner-slides .hero-note small {
  color: var(--dark-text-dim, #687f71);
}
.theme-dark .farm-inner-slides .photo-card {
  color: var(--dark-text-primary, #f3f7f4);
}

@media (max-width: 768px) {
  .theme-dark .header nav {
    background: var(--dark-surface-elevated, #162c22);
  }
  .theme-dark .section {
    width: calc(100% - 32px);
    padding: 40px 0 !important;
  }
  .theme-dark .detail h1 {
    font-size: 28px;
  }
}

/* Floating Scroll To Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--dark-emerald, #10b981) !important;
  color: #0b140f !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(16, 185, 129, 0.35) !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 999 !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, box-shadow 0.2s ease !important;
}

.scroll-top-btn.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) scale(1) !important;
}

.scroll-top-btn:hover {
  background: #34d399 !important;
  color: #07100b !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(52, 211, 153, 0.55) !important;
  transform: translateY(-4px) scale(1.08) !important;
}

.scroll-top-btn:active {
  transform: translateY(0) scale(0.96) !important;
}
