/*--------------------------------------------------------------
# General Styling & Shared Classes
--------------------------------------------------------------*/
:root {
  --primary-color: #134983;
  --secondary-color: #FFFCE8;
  --green-color: #8DB783;
  --green-blue-color: #62B8B0;
  --dark-color: #231F20;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}
.no-transition,
.no-transition *,
.no-transition *:after,
.no-transition *:before {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -ms-transition: none !important;
  -o-transition: none !important;
  transition: none !important;
}

body {
  color: var(--primary-color);
  background-color: #ffffff;
  max-width: 100%;
  overflow-x: clip;
  transition: background-color 0.8s ease-in-out, color 0.8s ease-in-out;
}

.scroll-section {
  background-color: transparent !important;
}

/* คลาสเฉพาะสำหรับตัวอักษรที่ต้องการให้เปลี่ยนสีตาม section */
.fade-text {
  /* ดึงค่าตัวแปร --dynamic-text-color มาใช้ ถ้าไม่มีให้ใช้ --primary-color */
  color: var(--dynamic-text-color, var(--primary-color));
  transition: color 0.8s ease-in-out;
}

/* เผื่อกรณีใน content-text มี h1, h2 หรือ p ที่โดน force สีไว้ ให้มันรับค่าจาก .fade-text ไปด้วย */
.fade-text h1,
.fade-text h2,
.fade-text h3,
.fade-text h4,
.fade-text h5,
.fade-text p {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -moz-transition: all .3s ease-in-out;
  -webkit-transition: all .3s ease-in-out;
  transition: all .3s ease-in-out;
}

a:hover {
  color: var(--green-color);
}

h1,h2,h3,h4,h5,h6 {margin-bottom: .8rem;}

.line-clamp {
  display: -webkit-box;
  max-width: 100%;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp.line-1 {-webkit-line-clamp: 1;}
.line-clamp.line-2 {-webkit-line-clamp: 2;}
.line-clamp.line-3 {-webkit-line-clamp: 3;}

img {
  width: 100%;
  height: auto;
}

.img-cover {height: 100%; object-fit: cover;}

.text-pri {color: var(--primary-color);}

.bg-pri {background-color: var(--primary-color);}
.bg-sec {background-color: var(--secondary-color);}
.bg-green {background-color: var(--green-color);}

.p-section {
  padding: 95px 0;
}
.p-section-small {
  padding: 40px 0;
}
.p-section-medium {
  padding: 70px 0;
}
.p-section-top {
  padding-top: 80px;
}
.p-section-bottom {
  padding-bottom: 80px;
}
.pb-detail {
  padding-bottom: 69px;
}

.cursor-pointer {
  cursor: pointer;
}

.btn-main {
  display: inline-block;
  background-color: var(--green-blue-color);
  color: #ffffff;
  border: 1px solid var(--dark-color);
  border-radius: 50px;
  padding: 4px 36px;
  font-weight: 400;
  box-shadow: 0 4px 0 var(--dark-color);
  transition: all 0.2s ease-out;
  text-decoration: none;
}

.btn-main:hover,
.btn-main.active {
  color: #ffffff;
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--dark-color);
}

.push-button {
  background-color: var(--green-blue-color);
  color: #ffffff;
  border: 1px solid var(--dark-color);
  border-radius: 50%;
  box-shadow: 0 4px 0 var(--dark-color);
  transition: all 0.3s ease-out;
  text-decoration: none;
  width: 45px;
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  margin-bottom: 8px;
}

.push-button:last-child {
  margin-right: 0;
}

.push-button img,
.push-button svg {
  width: 22px;
  height: 22px;
}

.push-button:hover,
.push-button.active {
  color: #ffffff;
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--dark-color);
}

.shadow-img::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(31, 57, 109, 1) 0, rgba(31, 57, 109, .7) 0);
  opacity: 1;
  z-index: 1;
}

.lazy {
  opacity: 0;
  transition: opacity .5s;
}

.lazy.loaded {
  opacity: 1;
}

.keep-right {
  width: 100%;
  margin-left: auto !important;
  padding-left: 15px;
}

.text-nowrap {
  white-space: nowrap;
}

.content-no-data {
  min-height: 10vh;
}

.container-fluid {
  padding-left: 120px;
  padding-right: 120px;
}

.swiper-button-prev.related {
  left: 120px !important;
}
.swiper-button-next.related {
  right: 120px !important;
}

.page-mt {
  margin-top: var(--header-height);
}

/*--------------------------------------------------------------
# Global Header
--------------------------------------------------------------*/

/* ตกแต่ง Navbar ตัวหลัก */
.custom-navbar {
  background-color: #ffffff;
  border-bottom: 2px solid var(--primary-color);
  padding: 15px 0;
  transition: all 0.3s ease;
  z-index: 1060;
}

/* ตกแต่งลิงก์เมนู */
.custom-navbar .nav-link {
  color: var(--primary-color);
  margin: 0 8px;
  transition: color 0.3s ease;
}
.navbar-nav-left .nav-item:first-child .nav-link {
  margin-left: 0;
  padding-left: 0;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-item.dropdown:hover .nav-link {
  color: var(--green-color);
}

/* เมนู Products สีเขียว (Active) */
.custom-navbar .nav-link.active,
.custom-navbar .nav-link.show {
  color: var(--green-color);
}

.navbar-toggler:focus,
.offcanvas-header .btn-close:focus {
  box-shadow: none;
}

/* --- Logo Overlap & Curve Border --- */
.navbar-brand-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -35px;
  z-index: 1050;
}

.logo-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-wrapper::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  /* ตัดขอบครึ่งบนทิ้ง เพื่อให้เนียนไปกับเส้นตรงของ Navbar */
  clip-path: inset(70% -5px -5px -5px);
  z-index: 1;
}

.logo-img {
  position: relative;
  z-index: 2;
  width: 80px;
}

@media all and (min-width: 992px) {
  /* สำหรับหน้าจอ Desktop ขึ้นไป (แบ่ง 5 คอลัมน์) */
  .col-mega {
    flex: 0 0 auto;
    width: 20%;
  }

  /* Mega Menu (Desktop) */
  .custom-navbar .dropdown-toggle::after {
    display: none;
  }
  .mega-dropdown {
    position: static !important;
  }

  .mega-menu {
    position: absolute;
    /* ดันเมนูให้เริ่มกางพ้นเส้นขอบ 2px พอดี */
    top: calc(100% + 1px);
    left: 0;
    width: 100%;
    /* เราจะย้ายสีพื้นหลังและเงาออกไปไว้ใน ::after แทน เพื่อจัดลำดับชั้น Z-index */
    background-color: transparent;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
    z-index: 999;
  }

  .mega-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* 1. สีพื้นหลังของเมนู (สีเหลืองอ่อน) ให้มุดลงไปอยู่ชั้นที่ 1 */
  .mega-menu::after {
    content: "";
    position: absolute;
    inset: 0;
    /* กางเต็มกรอบเนื้อหาของเมนู */
    background-color: var(--secondary-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    z-index: -1;
  }

  /* 2. สร้าง Backdrop (สีทึบคลุมจอ) ให้มุดลงไปอยู่ชั้นที่ 2 (ใต้สีเหลือง) */
  .mega-menu::before {
    content: "";
    position: absolute;
    /* สำคัญมาก: เริ่มต้นที่ top: 0 ของ mega-menu (ซึ่งมันคือขอบล่างของ Navbar พอดี) */
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* ปล่อยความยาวทิ้งตัวลงไปคลุมจอด้านล่าง */
    background-color: color-mix(in srgb, var(--primary-color), transparent 20%);
    z-index: -2;
    pointer-events: none;
    /* กันไม่ให้ไปบล็อกการคลิกของหน้าเว็บข้างล่าง */
  }

  /* เพื่อความชัวร์ ให้เนื้อหา (รูป/ปุ่ม) ลอยอยู่บนสุดเสมอ */
  .mega-menu .container {
    position: relative;
    z-index: 1;
  }
}

/* ตกแต่งเนื้อหาใน Mega Menu */
.product-title {
  color: var(--primary-color);
  margin-top: 10px;
  transition: all 0.3s ease;
}

.product-item:hover .product-title,
.product-item.active .product-title {
  color: var(--green-color);
}

.product-img {
  border-radius: 0;
  transition: transform 0.3s ease;
}

/* จัด Layout สองฝั่งซ้าย-ขวาบน Desktop */
/* Layout ซ้าย-ขวา */
.navbar-nav-left { flex: 1; justify-content: flex-start; padding-right: 60px; }
.navbar-nav-right { flex: 1; justify-content: flex-end; padding-left: 60px; }

/* =========================================
  ส่วนปรับแต่งสำหรับ Mobile (Responsive)
  ========================================= */
@media (max-width: 991px) {
  .custom-navbar { padding: 10px 0; }
  .offcanvas-body { padding: 20px; }
  .custom-navbar .nav-link { margin: 0; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
  .navbar-nav-left { margin-bottom: 0 !important; }
  .navbar-nav-left, .navbar-nav-right { flex: initial; padding: 0; }
  .search-desktop { display: none !important; }
  .navbar-brand-center {
    z-index: 999;
    bottom: -35px;
  }
  .logo-wrapper {
    width: 90px;
    height: 90px;
  }
  .logo-wrapper::after {
    clip-path: inset(67% -5px -5px -5px);
  }
  .logo-img {
    width: 70px;
  }
  .custom-navbar .dropdown-menu {
    background-color: var(--secondary-color);
    border: none;
    padding: 10px 0;
    margin-top: 0;
    box-shadow: inset 0 3px 5px rgba(0,0,0,0.03); /* เพิ่มเงาด้านในนิดๆ ให้ดูมีมิติ */
  }

  .custom-navbar .dropdown-item {
    color: var(--primary-color);
    padding: 10px 20px;
    transition: all 0.2s;
  }

  .custom-navbar .dropdown-item:hover,
  .custom-navbar .dropdown-item:focus,
  .custom-navbar .dropdown-item.active {
    background-color: transparent;
    color: var(--green-color);
  }
  .menu-p-mobile {white-space: initial;}
  .drop-p-mobile.show {display: flex; flex-wrap: wrap;}
  .drop-p-mobile.show li.p-list {width: 50%;}
}

@media all and (min-width: 992px) {
  /* 1. เป็น relative เพื่อให้กล่องเมนูเกาะติดกับตัวอักษร EN เสมอ */
  .lang-dropdown {
    position: relative !important;
  }

  /* 2. ตัวกล่องเมนูภาษา */
  .lang-menu {
    position: absolute;
    /* เริ่มกางใต้เส้น Navbar */
    top: calc(100% + 17px);
    /* ปรับตำแหน่งให้ตรงกับปุ่ม EN (สมมติว่าอยู่ทางขวา) */
    left: 0;
    right: auto;
    transform: translateY(10px);

    background-color: var(--secondary-color);
    min-width: 90px;
    border-radius: 14px; /* มนเฉพาะขอบล่างเพื่อให้ชนเส้น Navbar สวยๆ */
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 1050; /* ให้อยู่เหนือ Backdrop แต่ใต้ Navbar (ถ้า Navbar คือ 1060 ให้ตัวนี้เป็นสูงกว่านิดหน่อยแต่เริ่มที่ขอบล่าง) */
    overflow: hidden;
  }

  .lang-dropdown:hover .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* 3. Backdrop แบบเต็มจอ เริ่มใต้เส้น Navbar */
  .lang-dropdown::before {
    content: "";
    position: fixed;
    top: 73px; /* เริ่มที่ขอบล่างของ Navbar */
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: color-mix(in srgb, var(--primary-color), transparent 20%);
    z-index: 999; /* อยู่ใต้กล่องเมนูภาษา */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
  }

  .lang-dropdown:hover::before {
    opacity: 1;
    visibility: visible;
  }
}

/* -------------------------------------
   สไตล์ข้างในกล่อง (EN/TH)
   ------------------------------------- */
.lang-item {
  display: block;
  padding: 5px 14px;
  color: var(--primary-color);
  font-weight: 400;
  text-decoration: none;
  transition: all 0.2s ease;
}

.lang-divider {
  height: 1px;
  background-color: rgba(0,0,0,0.05);
}

/* Hover แล้วเป็นสีเขียวตามที่ต้องการ */
.lang-item:hover {
  background-color: var(--green-color);
  color: #ffffff !important;
}

/* ไอคอนค้นหา */
.search-icon {
  width: 22px;
  height: 22px;
  fill: var(--primary-color);
  cursor: pointer;
  transition: fill 0.3s ease;
}

.search-icon:hover,
.search-active .search-icon {
  fill: var(--green-color);
}

/* -------------------------------------
   กล่องค้นหา (Search Bar Toggle)
   ------------------------------------- */
.search-collapse-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  padding-top: 200px;
  z-index: 1040;
  transition: opacity 0.3s ease-in-out !important;
}

.search-collapse-area.collapsing {
  height: auto !important;
  opacity: 0;
}
.search-collapse-area.show {
  opacity: 1;
}

.search {
  position: relative;
}

.search .search-icon {
  width: 16px;
  height: 16px;
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translate(0, -50%);
  z-index: 1;
}

.search #search-input {
  width: 100%;
  background: var(--secondary-color);
  border: 1px solid var(--primary-color);
  font-weight: 400;
  padding: 8px 40px 8px 20px;
  -webkit-border-radius: 51px;
  -moz-border-radius: 51px;
  border-radius: 51px;
  color: var(--primary-color);
  outline: none;
}

.search #search-input::placeholder {
  color: var(--primary-color);
}

/*--------------------------------------------------------------
# Global Footer
--------------------------------------------------------------*/
.footer {
  background: var(--primary-color);
  color: #ffffff;
  padding: 40px 0;
  font-weight: 300;
}

.footer .menu li {
  margin-bottom: 12px;
}

.footer .menu.about li {
  font-weight: 400;
}

.vertical-line {
  width: 1px;
  height: 17px;
  background-color: #ffffff;
  margin: 0 10px;
}

.logo-footer {
  width: 130px;
}

.logo-avery {
  width: 70px;
  margin-bottom: 2px;
}

/*--------------------------------------------------------------
# Pagination
--------------------------------------------------------------*/
.custom-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  list-style: none;
  padding: 0;
}

.custom-pagination li.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.custom-pagination li.active .push-button,
.custom-pagination li.disabled .push-button {
  color: #ffffff;
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--dark-color);
}

.custom-pagination .dots .item {
  background: transparent;
  cursor: default;
  color: var(--dark-color);
  transform: translateY(0);
  box-shadow: 0 4px 0 var(--dark-color);
}

/*--------------------------------------------------------------
# Preloader
--------------------------------------------------------------*/
#preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  background: #ffffff;
  transition: all 0.6s ease-out;
}

#preloader:before {
  content: "";
  position: fixed;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  border: 6px solid #ffffff;
  border-color: var(--primary-color) transparent var(--primary-color) transparent;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: animate-preloader 1.5s linear infinite;
}

@keyframes animate-preloader {
  0% {
    transform: rotate(0deg);
  }

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

/*--------------------------------------------------------------
# Disable aos animation delay on mobile devices
--------------------------------------------------------------*/
@media screen and (max-width: 768px) {
  [data-aos-delay] {
    transition-delay: 0 !important;
  }
}

/*--------------------------------------------------------------
# Figure
--------------------------------------------------------------*/
figure {
  overflow: hidden;
  margin: 0;
}

.on-hover-img figure img {
	-webkit-transform: scale(1);
	transform: scale(1);
	-webkit-transition: .3s ease-out !important;
	transition: .3s ease-out !important;
}

.on-hover-img:hover figure img{
	-webkit-transform: scale(1.13);
	transform: scale(1.13);
}

/*--------------------------------------------------------------
# Hero
--------------------------------------------------------------*/
.hero {
  width: 100%;
  min-height: 100vh;
  position: relative;
  padding: 70px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Container สำหรับคุมวิดีโอ */
.hero .video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  /* ป้องกันการคลิกบนวิดีโอ */
}

/* ทำให้ Iframe ใหญ่กว่าจอเพื่อซ่อนขอบดำ (Scale เล็กน้อย) */
.hero .video-background iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* อัตราส่วน 16:9 */
  min-height: 100vh;
  min-width: 177.77vh; /* อัตราส่วน 16:9 */
  transform: translate(-50%, -50%);
}

.hero .img-banner {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.img-banner.pc {
  display: block;
}
.img-banner.mb {
  display: none;
}

.hero .content {
  position: relative;
  z-index: 3;
}

.bannerSwiper {
  --swiper-parallax-opacity: 0;
}

.bannerSwiper .swiper-pagination-bullets {
  bottom: 3%;
}

@media (max-width: 991px) {
  .hero {
    min-height: 60vh !important;
    padding: 60px 0;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 600px !important;
  }
  .img-banner.pc {
    display: none;
  }
  .img-banner.mb {
    display: block;
  }
}

@media (max-width: 575px) {
  .hero h1,
  .hero h5 {
    width: 80%;
  }
  .hero h1 br,
  .hero h5 br {
    display: none;
  }
}

/*--------------------------------------------------------------
# Swiper
--------------------------------------------------------------*/
.swiper-container {
  position: relative;
}

.swiper-button-next,
.swiper-button-prev {
  background-color: var(--green-blue-color);
  color: #ffffff;
  border: 1px solid var(--dark-color);
  border-radius: 50%;
  box-shadow: 0 4px 0 var(--dark-color);
  transition: all 0.3s ease-out;
  text-decoration: none;
  display: inline-block;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.swiper-button-next svg,
.swiper-button-prev svg {
  width: 26px;
  height: 26px;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  color: #ffffff;
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--dark-color);
}

.swiper-button-prev.category {
  left: -20px !important;
}
.swiper-button-next.category {
  right: -20px !important;
}

.swiper-button-prev.swiper-button-lock,
.swiper-button-next.swiper-button-lock {
  display: none !important;
}

.swiper-pagination-bullet {
  width: 18px;
  height: 7px;
  border: 1px solid var(--dark-color);
  border-radius: 5px;
  background: #ffffff;
  opacity: 1;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.swiper-pagination-bullet-active {
  width: 30px;
  background: var(--green-blue-color);
}

.swiper-pagination-bullets-dynamic {
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: auto !important;
}

.has-bullet .swiper-pagination-bullets {
  bottom: 0;
}

.swiper.has-bullet {
  padding-bottom: 42px;
}

/*--------------------------------------------------------------
# Home
--------------------------------------------------------------*/
.green-section {
  background-color: #8CBA8B;
  position: relative;
  padding: 80px 0 0 0;
}

.green-content {
  position: relative;
  z-index: 4;
}

.a.arc {
  position: absolute;
  width: 100%;
  height: 100px;
  bottom: 2px;
  left: 0;
  transform-origin: 0 100%;
  transform: translate3d(0, 0, 0) rotateX(180deg) scaleY(0);
  will-change: transform;
  z-index: 2;
  /* ให้อยู่เหนือพื้นหลังสีขาว */
}

.home-our-product {
  padding: 150px 0 100px;
  position: relative;
}

.home-our-product .content {
  position: relative;
  z-index: 4;
}

.home-our-product .coconut-tree {
  position: absolute;
  top: -485px;
  left: 3%;
  width: 400px;
  height: auto;
  z-index: 3;
}

.max-w-content {
  max-width: 810px;
}

.home-our-product {
  background-image: url("/images/home-coconut-collector.png");
  background-repeat: no-repeat;
  background-size: 220px;
  background-position: right bottom;
}

.home-category-content {
  position: relative;
  z-index: 4;
}

.home-boat {
  position: absolute;
  top: -200px;
  left: -100px;
  width: 320px;
  z-index: 1;
  transform: rotate(130deg);
}
.home-flower-large {
  position: absolute;
  top: -180px;
  left: 9%;
  width: 80px;
  z-index: 1;
  transform: rotate(45deg);
}
.home-flower-small {
  position: absolute;
  top: -140px;
  left: 14%;
  width: 50px;
  z-index: 1;
  transform: rotate(45deg);
}

.home-coconut {
  position: absolute;
  top: -155px;
  right: -70px;
  width: 320px;
  z-index: 3;
}

.home-leaf-1 {
  position: absolute;
  top: -250px;
  right: -115px;
  width: 390px;
  z-index: 2;
  transform: rotate(-55deg);
}

.home-leaf-2 {
  position: absolute;
  top: -165px;
  right: -175px;
  width: 330px;
  z-index: 1;
  transform: rotate(-75deg);
}

.coconut-seller {
  position: absolute;
  top: -175px;
  left: -50px;
  width: 370px;
  z-index: 1;
}

/*--------------------------------------------------------------
# Community
--------------------------------------------------------------*/
.commu-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.commu-card .main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.commu-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* ใช้ color-mix เพื่อเอา --dark-color มาทำโปร่งแสง 50% */
  background-color: color-mix(in srgb, var(--dark-color) 50%, transparent);

  /* จัดไอคอนให้อยู่กึ่งกลาง */
  display: flex;
  justify-content: center;
  align-items: center;

  /* ตั้งค่าซ่อนไว้ก่อน (Fade in) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.commu-overlay .ig-icon {
  width: 30px;
  height: 30px;
  transform: scale(0.8); /* เล็กลงนิดนึงก่อนโชว์ */
  transition: transform 0.3s ease;
}

/* ============================
   ตอน Hover
   ============================ */
.commu-card:hover .commu-overlay {
  opacity: 1;
  visibility: visible;
}

/* ทำให้ไอคอนเด้งขึ้นมาให้มีมิติ */
.commu-card:hover .commu-overlay .ig-icon {
  transform: scale(1);
}

/*--------------------------------------------------------------
# Our Global Markets
--------------------------------------------------------------*/
/* ============================
   1. สไตล์ของปุ่ม Filter (อิงจากปุ่ม .btn ของ Bootstrap)
   ============================ */
.btn-filter {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border-radius: 51px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

/* ============================
   2. สไตล์ตอน Hover และ Active
   ============================ */
.btn-filter:hover,
.btn-filter:focus,
.btn-filter.active,
.custom-hover-dropdown:hover .btn-filter {
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 400;
  box-shadow: none;
}

/* เอาเส้นขอบ outline ของ Bootstrap ออกเวลาคลิก */
.btn-filter:focus-visible {
  outline: none;
}

/* ============================
   3. สร้าง Hover + Fade In ให้ Bootstrap Dropdown
   ============================ */
/* ต้องเปลี่ยนจาก display: none (ค่าเริ่มต้นของ Bootstrap) เป็น display: block ตลอดเวลา
   เพื่อให้ transition ทำงานได้ แล้วซ่อนด้วย opacity แทน */
.custom-hover-dropdown .dropdown-menu-custom {
  display: block;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;

  /* ตกแต่งกล่อง Dropdown */
  background-color: var(--primary-color);
  border: none;
  border-radius: 12px;
  margin-top: 8px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

  /* --- ส่วนที่เพิ่มเข้ามาจัดการ Scroll --- */
  max-height: 283px;  /* กำหนดความสูงสูงสุด (ปรับตัวเลขได้ตามต้องการ) */
  overflow-y: auto;   /* แสดง Scrollbar แนวตั้งเมื่อเนื้อหาเกิน */
  overflow-x: hidden; /* ซ่อนแนวแกน X เพื่อคงความโค้งของ border-radius */
}

/* แสดงผลเมื่อ Hover */
.custom-hover-dropdown:hover .dropdown-menu-custom {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   Custom Scrollbar สำหรับ Dropdown
   ============================ */
/* ความกว้างของ Scrollbar */
.custom-hover-dropdown .dropdown-menu-custom::-webkit-scrollbar {
  width: 6px;
}

/* พื้นหลังของ Track (ราง Scrollbar) */
.custom-hover-dropdown .dropdown-menu-custom::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 12px;
}

/* ตัวจับ Scrollbar */
.custom-hover-dropdown .dropdown-menu-custom::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--green-color), transparent 50%); /* สีขาวโปร่งแสง */
  border-radius: 12px;
}

/* ตัวจับ Scrollbar ตอน Hover */
.custom-hover-dropdown .dropdown-menu-custom::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--green-color), transparent 0%);
}

/* ============================
   4. ตกแต่งลิสต์ด้านใน Dropdown (.dropdown-item)
   ============================ */
.dropdown-menu-custom .dropdown-item {
  color: #ffffff;
  font-weight: 300;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  transition: background-color 0.2s ease;
}

/* เปลี่ยนสีตอน Hover ลิสต์รายการประเทศ */
.dropdown-menu-custom .dropdown-item:hover,
.dropdown-menu-custom .dropdown-item:focus {
  background-color: var(--green-color);
  color: #ffffff;
}

/* ============================
   1. จัดการ Layout แบบ Grid
   ============================ */
.country-card-grid {
  display: grid;
  /* กำหนดให้การ์ดมีความกว้างอย่างน้อย 140px และขยายได้ตามพื้นที่ว่าง */
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 28px; /* ระยะห่างระหว่างการ์ด */
  padding: 16px 0;
}

/* ============================
   2. สไตล์ของการ์ดแต่ละใบ
   ============================ */
.country-card {
  background-color: #ffffff;
  border: 1px solid var(--primary-color);
  border-radius: 8px; /* ความโค้งของมุมการ์ด */
  overflow: hidden; /* เพื่อให้เนื้อหาไม่ล้นมุมโค้งออกมา */
  display: flex;
  flex-direction: column;
}

/* ============================
   3. ส่วน Header (ชื่อประเทศ)
   ============================ */
.country-card-header {
  background-color: var(--green-blue-color);
  color: #ffffff;
  text-align: center;
  padding: 10px 8px;
  font-weight: 400;
  /* ทำเส้นขอบล่างหนาๆ เป็นสีกรมท่าเพื่อให้ดูมีมิติเหมือนในรูป */
  border-bottom: 4px solid var(--primary-color);
  border-radius: 0 0 8px 8px;
}

/* ============================
   4. ส่วน Body (พื้นที่ใส่ไอคอน)
   ============================ */
.country-card-body {
  padding: 14px 12px;
  display: flex;
  flex-wrap: wrap; /* ถ้าไอคอนเยอะเกินให้ปัดลงบรรทัดใหม่ */
  justify-content: center; /* จัดให้อยู่กึ่งกลางแนวนอน */
  gap: 8px; /* ระยะห่างระหว่างไอคอน */
  flex-grow: 1; /* ให้กล่องขยายเต็มพื้นที่ที่เหลือถ้าความสูงการ์ดไม่เท่ากัน */
  min-height: 80px; /* กำหนดความสูงขั้นต่ำกันกล่องแฟบ */
}

/* ============================
   5. สไตล์ของรูปไอคอน
   ============================ */
.social-icon {
  width: 40px;  /* ขนาดความกว้างของไอคอน */
  height: 40px; /* ขนาดความสูงของไอคอน */
  object-fit: contain; /* ป้องกันการบิดเบี้ยวของรูป */
}

/*--------------------------------------------------------------
# About Us
--------------------------------------------------------------*/
.about1-img {
  max-width: 240px;
}

.no-mb h4 {
  margin-bottom: 0;
}

.img-journey {
  border-radius: 10px;
}

/* ตกแต่งรูปภาพเบื้องต้น */
.img-journey {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ทำให้การเคลื่อนไหวสมูทขึ้น */
.journey-step {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* สร้างขั้นบันไดเฉพาะหน้าจอ Desktop (ขนาดจอ 992px ขึ้นไปตามไซส์ lg ของ Bootstrap) */
@media (min-width: 992px) {
  .step-2 {
    margin-top: 150px !important;
  }

  .step-3 {
    margin-top: 300px !important;
  }

  .journey-parallax-row {
    /* ใช้ตัวแปร --pull-up เพื่อดึงพื้นที่ด้านล่างขึ้นมา (3rem คือระยะเดิมของคลาส my-5) */
    margin-bottom: calc(3rem + var(--pull-up, 0px)) !important;
  }
}

.about-boat {
  position: absolute;
  bottom: -55px;
  right: 1%;
  width: 500px;
  z-index: 10;
  transition: transform 0.3s ease-out;
}

.about-tree-left {
  position: absolute;
  bottom: -100px;
  left: 2%;
  width: 350px;
  z-index: 1;
}

.about-tree-right {
  position: absolute;
  bottom: -30px;
  right: -110px;
  width: 380px;
  z-index: 1;
}

.about-collector {
  position: absolute;
  bottom: -55px;
  right: 48px;
  width: 170px;
  z-index: 2;
  transform-origin: bottom center;
}

.about-collector.harvesting {
  animation: pickCoconut 1.5s ease-in-out infinite;
  /* infinite เพื่อให้ขยับต่อเนื่อง หรือเอาออกถ้าอยากให้ขยับแค่รอบเดียว */
}

@keyframes pickCoconut {
  0% { transform: rotate(5deg); }
  50% { transform: rotate(0deg); } /* เอียงตัวไปด้านหลังเล็กน้อยเหมือนออกแรงดึง */
  100% { transform: rotate(5deg); }
}

.about-intro {
  position: relative;
  z-index: 3;
}

@media (max-width: 1299px) {
  .about-tree-left {
    width: 200px;
    bottom: -50px;
    left: -20px;
  }

  .about-tree-right {
    width: 220px;
    bottom: -20px;
    right: -64px;
  }

  .about-collector {
    width: 100px;
    bottom: -35px;
    right: 25px;
  }
}

@media (max-width: 768px) {
  .about-tree-left,
  .about-tree-right,
  .about-collector {
    display: none; /* ซ่อนองค์ประกอบทั้งหมด */
  }
}

/*--------------------------------------------------------------
# Product
--------------------------------------------------------------*/
.product-card {
  padding: 40px;
  border: 1px solid transparent;
  transition: all 0.3s ease-out;
}

.product-card:hover {
  border: 1px solid var(--primary-color);
  color: inherit;
}

.product-card img {
  width: 90%;
}

.product-card p {
  max-width: 300px;
}

#product-category hr {
  background: var(--green-blue-color);
  margin: 50px 0;
}

.cat-card .title{
  transition: all 0.3s ease-out;
}
.cat-card:hover .title,
.cat-card.active .title {
  color: var(--green-color);
}

.img-detail2 { max-width: 180px; }
.coconut-tree-icon {
  width: 30px;
  height: 30px;
}

.push-button.product {
  padding-top: 14px;
  background-color: var(--green-color);
  align-self: flex-start;
  overflow: hidden;
  transition: all 0.2s ease-out;
}

.push-button.product img {
  width: 55px;
  height: auto;
}

.btn-main.white {
  color: var(--primary-color);
  background-color: #ffffff;
  padding: 6px 12px;
}

.marquee-wrapper {
  display: flex;
  overflow: hidden;
  background-color: #6eb6b2;
  padding: 14px 0;
}

.marquee-track {
  display: flex;
  flex-shrink: 0;
  width: max-content; /* สำคัญมาก: ให้กล่องยาวตามเนื้อหาข้างใน */
  list-style: none;
  margin: 0;
  padding: 0;
  animation: slide-ring 20s linear infinite;
}

.marquee-track li {
  color: white;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ใส่จุดคั่น */
.marquee-track li::after {
  content: "";
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  margin: 0 10px 0 20px;
}

/* Animation เลื่อนไปทางซ้าย */
@keyframes slide-ring {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* --- Gallery --- */
/* รูปแบบสำหรับ Thumbnail ที่ถูกเลือก (Active) */
.thumbGallerySwiper .swiper-slide {
  border: 1px solid var(--dark-color);
  transition: all 0.3s;
  cursor: pointer;
}

.thumbGallerySwiper .swiper-slide-thumb-active {
  border: 3px solid var(--green-blue-color);
}

/* บังคับขนาดสูงสุดของรูปใน Thumbnail */
.thumbGallerySwiper .swiper-slide img {
  max-height: 80px;
  width: 100%;
  object-fit: cover;
  opacity: 0;
  /* ซ่อนไว้ก่อน */
  transition: opacity 0.3s ease-in-out;
}

/* เมื่อ Swiper พร้อมทำงาน ค่อยโชว์รูป */
.thumbGallerySwiper.swiper-initialized .swiper-slide img {
  opacity: 1;
}


/* พื้นหลัง Popup */
.image-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: color-mix(in srgb, var(--primary-color), transparent 10%);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* คลาสสำหรับเปิด Popup (Fade In) */
.image-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ปุ่มกากบาทปิด */
.popup-close-btn {
  position: absolute;
  top: 30px;
  right: 30px;
  cursor: pointer;
  z-index: 10000;
}

.popupGallerySwiper {
  max-width: 600px;
  padding: 40px 0;
}

/* ให้รูปใน Popup ขยายใหญ่ได้เต็มที่ */
.popupGallerySwiper .swiper-slide img {
  max-height: 70vh;
  /* สูงสุด 80% ของหน้าจอ */
  max-width: 90vw;
  object-fit: contain;
}

/* คลาสสำหรับซ่อน Main Gallery ชั่วคราว */
.hide-temporary {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.popupGallerySwiper .swiper-pagination {
  bottom: 0;
}

/*--------------------------------------------------------------
# FAQS
--------------------------------------------------------------*/
.accordion-item {
  border: none;
  background-color: transparent;
  border-bottom: 1px solid var(--dynamic-text-color, var(--primary-color));
  transition: border-color 0.8s ease-in-out;
}

.accordion-button {
  background-color: transparent;
  color: var(--dynamic-text-color, var(--primary-color)) !important;
  font-weight: 500;
  padding: 26px 0;
  transition: color 0.8s ease-in-out;
}

.accordion-button:not(.collapsed) {
  background-color: transparent;
  color: var(--dynamic-text-color, var(--primary-color)) !important;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
}

.accordion-button::after {
  width: 40px;
  height: 40px;
  border: 1px solid var(--dark-color);
  border-radius: 50%;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath fill='%23231F20' d='M30 16.5H0v-3h30v3z'/%3E%3Cpath fill='%23231F20' d='M13.5 30V0h3v30h-3z'/%3E%3C/svg%3E") !important;
  background-size: 24px;
  background-position: center;
  background-color: #ffffff;
  box-shadow: 0 2px 0 var(--dark-color);
  transition: transform 0.3s ease-in-out, box-shadow 0.2s ease-in-out;
}

.accordion-button:not(.collapsed)::after {
  transform: translateY(2px) rotate(45deg);
  box-shadow: 0 0 0 var(--dark-color);
}

.accordion-body {
  color: var(--dynamic-text-color, var(--primary-color)) !important;
  padding: 0 0 30px 0;
  transition: color 0.8s ease-in-out;
}

.accordion-body p {
  font-weight: 400;
  letter-spacing: .02em;
}

.accordion-body p:last-child {
  margin-bottom: 0;
}

/*--------------------------------------------------------------
# Contact Us
--------------------------------------------------------------*/
#contactSection {
  position: relative;
  z-index: 2;
}

.moving-vehicle {
  position: absolute;
  bottom: 0;
  right: 40px;
  width: 250px;
  z-index: 1;
  transition: transform 0.3s ease-out;
}

.grecaptcha-badge { z-index: 2; }

/*--------------------------------------------------------------
# Form
--------------------------------------------------------------*/
.form-control {
  padding: 8px 0;
  font-weight: 500;
  background: transparent;
  color: var(--primary-color);
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--primary-color);
}

.form-control:focus {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 1px 0 0 color-mix(in srgb, var(--primary-color), transparent 50%);
}

.form-control::placeholder {
  color: var(--primary-color);
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin-top: .15em;
  cursor: pointer;
}

.form-check-input[type=checkbox] {
  border-radius: 50%;
  border-color: var(--dark-color);
}

.form-check-label {
  font-weight: 400;
}

.form-check-input:checked[type=checkbox] {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/*--------------------------------------------------------------
# CKEDITOR5
--------------------------------------------------------------*/

figure.image {
  margin: 1.5rem auto;
}
figure.image img,
img.image_resized {
  height: auto !important;
}

.image-style-align-left {
  float: left;
  margin-right: 1.5em !important;
}

.image-style-align-right {
  float: right;
  margin-left: 1.5em !important;
}

.image_resized {
  margin-left: auto;
  margin-right: auto;
}

.image-style-block-align-right {
  margin-left: auto;
  margin-right: unset;
}

.image-style-block-align-left {
  margin-right: auto;
  margin-left: unset;
}

.marker-yellow {
  background-color: #b9b924;
  color: #fff;
}

.marker-green {
  background-color: #17c117;
  color: #fff;
}

.marker-pink {
  background-color: #f63666;
  color: #fff;
}

.marker-blue {
  background-color: #2B5597;
  color: #fff;
}

.pen-red {
  color: #e91313;
}

.pen-green,
.pen-red {
  background-color: transparent;
}

.pen-green {
  color: #180;
}

figure.media {
  display: block;
  background: transparent;
  width: auto;
  padding: 10px;
}

blockquote {
  border-left: 5px solid #ccc;
  font-style: italic;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
  padding-left: 1.5em;
  padding-right: 1.5em;
  margin: 0 0 1rem;
}

figure.table {
  width: 100% !important;
  overflow-x: auto;
}

/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/
@media (min-width: 992px) {
  .gx-lg-custom {
    --bs-gutter-x: 2rem;
  }
  h5 { line-height: 1.4; }
}

@media (max-width: 1440px) {
  .container-fluid {
    padding-left: 70px;
    padding-right: 70px;
  }
  .swiper-button-prev.related {
    left: 70px !important;
  }
  .swiper-button-next.related {
    right: 70px !important;
  }
  .home-our-product .coconut-tree {
    left: 0;
  }
}

@media (max-width: 1399px) {
  .home-our-product .coconut-tree {
    top: -160px;
    width: 200px;
  }
  .about-boat {
    bottom: -42px;
    width: 400px;
  }
  .img-detail2 {max-width: 150px;}
}

@media (max-width: 1199px) {
  .home-our-product {
    background-size: 150px;
  }
  .moving-vehicle {
    width: 170px;
  }
}

@media (max-width: 991px) {
  .p-section { padding: 80px 0; }
  .container-fluid {
    padding-left: 50px;
    padding-right: 50px;
  }
  .swiper-button-prev.related {
    left: 50px !important;
  }
  .swiper-button-next.related {
    right: 50px !important;
  }
  .about-boat {
    bottom: -22px;
    width: 200px;
  }
  .home-our-product {
    background-size: 110px;
  }
  .home-boat {
    top: -145px;
    left: -70px;
    width: 250px;
  }
  .home-flower-large {
    top: -135px;
    left: 120px;
    width: 65px;
  }
  .home-flower-small {
    top: -100px;
    left: 175px;
    width: 40px;
  }

  .home-coconut {
    top: -155px;
    right: -70px;
    width: 250px;
  }

  .home-leaf-1 {
    top: -250px;
    right: -115px;
    width: 320px;
  }

  .home-leaf-2 {
    top: -185px;
    right: -175px;
    width: 250px;
  }

  .coconut-seller {
    top: -130px;
    left: -50px;
    width: 300px;
  }
  .thumbGallerySwiper .swiper-slide img {
    max-height: 130px;
  }
}

@media (max-width: 767px) {
  .container-fluid {
    padding-left: 18px;
    padding-right: 18px;
  }
  .swiper-button-prev.related {
    left: 18px !important;
  }
  .swiper-button-next.related {
    right: 18px !important;
  }
  .p-section {padding: 60px 0;}
  .footer .footer-title {
    margin-top: 0;
    margin-bottom: 15px;
  }
  .about-journey {
    padding-bottom: 80px !important;
  }
  .home-our-product {
    background-size: 100px;
  }
  .home-our-product .coconut-tree {
    width: 170px;
  }
  .home-boat {
    top: -70px;
    left: -35px;
    width: 150px;
  }
  .home-flower-large {
    top: -75px;
    left: 75px;
    width: 50px;
  }
  .home-flower-small {
    top: -48px;
    left: 120px;
    width: 30px;
  }

  .home-coconut {
    top: -75px;
    right: -35px;
    width: 150px;
  }

  .home-leaf-1 {
    top: -170px;
    right: -115px;
    width: 255px;
  }

  .home-leaf-2 {
    top: -155px;
    right: -175px;
    width: 220px;
  }

  .coconut-seller {
    top: -70px;
    left: -30px;
    width: 200px;
  }
  .img-detail2 {max-width: 120px;}
  .moving-vehicle {
    width: 160px;
  }
}

@media (max-width: 575px) {
  .p-section {
    padding: 50px 0;
  }
  .content-text h1 br, .content-text h2 br, .content-text h3 br, .content-text h4 br, .content-text h5 br, .content-text h6 br, .content-text p br, .content-text ul br{
    display: none;
  }
  .btn-main { padding: 4px 18px; }
  .product-card {
    padding: 20px;
  }
  .home-our-product {
    padding: 100px 0;
  }
  .home-our-product .coconut-tree {
    top: -140px;
    width: 135px;
  }
  .a.arc {
    height: 70px;
  }
  .home-boat {
    top: -85px;
    left: -25px;
    width: 120px;
  }
  .home-flower-large {
    top: -85px;
    left: 61px;
    width: 40px;
  }
  .home-flower-small {
    top: -64px;
    left: 95px;
    width: 25px;
  }

  .home-coconut {
    top: -80px;
    right: -25px;
    width: 110px;
  }

  .home-leaf-1 {
    top: -160px;
    right: -100px;
    width: 200px;
  }

  .home-leaf-2 {
    top: -155px;
    right: -150px;
    width: 180px;
  }

  .coconut-seller {
    top: -80px;
    left: -20px;
    width: 140px;
  }
  .img-detail2 {max-width: 95px;}
  #contactSection {
    padding-bottom: 150px;
  }
  .moving-vehicle {
    width: 190px;
    right: 0;
  }
}

@media (max-width: 480px) {
  .a.arc {
    height: 40px;
  }
}
