/* Temporary for development stage, recommend to copy these CSS code to frontend.css when production */
section[data-module="service-products"] {}

section[data-module="service-products"] .knm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 30px;
}

/* Wrapper to allow outside accent */
section[data-module="service-products"] .knm-item-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}
section[data-module="service-products"] .knm-item-wrap {
  position: relative;
  display: inline-block;
  z-index: 10;
}
/* Accent image OUTSIDE the knm-item */
section[data-module="service-products"] .knm-item-wrap::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  background-image: url("https://knm.stagings.entertopwp.com/wp-content/uploads/2025/12/green-bg-product-03.jpg");
  background-size: contain;
  background-repeat: no-repeat;
  bottom: -6px;
  left: -6px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

/* Make sure item stays ABOVE the accent */
section[data-module="service-products"] .knm-item {
  position: relative;
  z-index: 5;
  overflow: hidden;
  border-top-right-radius: 60px;
  cursor: pointer;
  height: 450px;
  margin-top: 50px;
}

/* Background Image */
section[data-module="service-products"] .knm-item-bg {
  position: absolute;
  inset: 0;
  z-index: 1; /* IMPORTANT */
  background-size: cover;
  background-position: center;
  transition: transform 0.4s ease;
}

/* Gradient Overlay – fixed */
section[data-module="service-products"] .knm-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient( to bottom, rgba(4, 67, 134, 0) 0%, rgba(4, 67, 134, 0) 45%, rgba(4, 67, 134, 0.4) 70%, rgba(4, 67, 134, 1) 100% );
  z-index: 4;
  pointer-events: none;
}

/* Content layer */
section[data-module="service-products"] .knm-content {
  position: absolute;
  bottom: 25px;
  left: 25px;
  right: 25px;
  color: #fff;
  transition: all 0.4s ease;
  z-index: 5; /* ABOVE gradient */
}

section[data-module="service-products"] .knm-title {
  font-size: 25px !important;
  color: #fff !important;
  margin: 0 !important;
  transition: transform 0.4s ease !important;
}

section[data-module="service-products"] .knm-line {
  width: 85%;
  height: 2px;
  background: #fff;
  margin: 10px 0px -60px 0px;
  transition: transform 0.4s ease;
}

/* Arrow */
section[data-module="service-products"] .knm-arrow img {
  width: 32px;
  position: absolute;
  right: -5px;
  bottom: 10px;
  transform: rotate(-40deg);
  transition: transform 0.4s ease, opacity 0.3s ease;
}


/* Hidden description */
section[data-module="service-products"] .knm-desc {
  opacity: 0;
  margin-top: 15px;
  transition: opacity 0.4s ease;
}

/* HOVER EFFECTS */
section[data-module="service-products"] .knm-item:hover .knm-item-bg {
  transform: scale(1.08);
}

section[data-module="service-products"] .knm-item:hover .knm-title {
  transform: translateY(-55px);
}

section[data-module="service-products"] .knm-item:hover .knm-line {
  transform: translateY(-55px);
  background: #81D30D;
}

section[data-module="service-products"] .knm-item:hover .knm-desc {
  opacity: 1;
  padding: 0px 60px 0px 0px;
}

section[data-module="service-products"] .knm-item:hover .knm-arrow img {
  transform: rotate(40deg);
  content: url("https://knm.stagings.entertopwp.com/wp-content/uploads/2025/09/arrow-red-round-right-2.png");
}

/* Popup */
section[data-module="service-products"] #knm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 999;
}

section[data-module="service-products"] #knm-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 850px;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 0;
  display: none;
  border-radius: 10px;
  z-index: 1000;
}

section[data-module="service-products"] #knm-popup-img {
  width: 100%;
  border-radius: 10px 10px 0 0;
}

section[data-module="service-products"] .knm-popup-inner {
  padding: 25px;
}

section[data-module="service-products"] #knm-popup-cat {
  color: #000;
  font-size: 22px !important;
  margin: 20px 0px 0px 0px !important;
}

section[data-module="service-products"] #knm-popup-title {
  font-size: 32px;
  margin: 10px 0 10px;
}
section[data-module="service-products"] #knm-popup-desc {
  margin: 0px auto 10px;
}

section[data-module="service-products"] #knm-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  width: 45px;
  height: 45px;
}

section[data-module="service-products"] #knm-close img {
  width: 28px;
}

/* Load more button from your code */
section[data-module="service-products"] .know-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background-color: #009900;
  color: #ffffff;
  padding: 1px 1px 1px 25px;
  border-radius: 0 20px 0 20px;
  text-decoration: none;
  font-family: 'Segoe UI', sans-serif;
  font-size: 20px;
  transition: background-color 0.3s ease;
  width: fit-content;
  margin-top: 40px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
}

section[data-module="service-products"] .know-more-btn .btn-text {
  padding-right: 15px;
}

section[data-module="service-products"] .know-more-btn .btn-arrow {
  background-color: #ffffff;
  padding: 14px;
  border-radius: 0 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

section[data-module="service-products"] .know-more-btn .btn-arrow img {
  width: 20px;
  height: 20px;
  transform: rotate(35deg);
  transition: transform 0.4s ease, opacity 0.3s ease;
}

section[data-module="service-products"] .know-more-btn:hover {
  background-color: #01458C;
}

section[data-module="service-products"] .know-more-btn:hover .btn-arrow {
  background-color: #01458C;
}

section[data-module="service-products"] .know-more-btn:hover .btn-arrow img {
  transform: rotate(90deg);
  content: url("https://knm.stagings.entertopwp.com/wp-content/uploads/2025/08/knm-arrow-2.png");
}

section[data-module="service-products"] .load-less-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background-color: #009900;
  color: #ffffff;
  padding: 1px 1px 1px 25px;
  border-radius: 0 20px 0 20px;
  text-decoration: none;
  font-family: 'Segoe UI', sans-serif;
  font-size: 20px;
  transition: background-color 0.3s ease;
  width: fit-content;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
}

section[data-module="service-products"] .load-less-btn .btn-text {
  padding-right: 15px;
}

section[data-module="service-products"] .load-less-btn .btn-arrow {
  background-color: #ffffff;
  padding: 14px;
  border-radius: 0 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

section[data-module="service-products"] .load-less-btn .btn-arrow img {
  width: 20px;
  height: 20px;
  transform: rotate(35deg);
  transition: transform 0.4s ease, opacity 0.3s ease;
}

section[data-module="service-products"] .load-less-btn:hover {
  background-color: #01458C;
}

section[data-module="service-products"] .load-less-btn:hover .btn-arrow {
  background-color: #01458C;
}
section[data-module="service-products"] .btn-text:hover {
  color: #fff;
}
section[data-module="service-products"] .load-less-btn:hover .btn-arrow img {
  transform: rotate(90deg);
  content: url("https://knm.stagings.entertopwp.com/wp-content/uploads/2025/08/knm-arrow-2.png");
}
/* Hidden but clickable disabled only when actually hidden */
section[data-module="service-products"] .knm-item-wrap.hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Show state – clickable */
section[data-module="service-products"] .knm-item-wrap.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Fully hide only AFTER animation */
section[data-module="service-products"] .knm-item-wrap.fully-hide {
  display: none;
}

/* Typical laptop screen size*/
@media (max-width: 1400px) {
section[data-module="service-products"] .knm-title {
  font-size: 22px !important;
}
section[data-module="service-products"] .knm-desc {
  font-size: 16px;
}
section[data-module="service-products"] #knm-popup-title {
  font-size: 26px;
}
section[data-module="service-products"] #knm-popup-desc {
  font-size: 16px;
}
section[data-module="service-products"] #knm-popup-cat {
  font-size: 20px !important;
}
}

@media (max-width: 1080px) {
section[data-module="service-products"] .knm-item {
  height: 325px;
  margin-top: 16px;
}
}

@media (max-width: 810px) {
section[data-module="service-products"] .knm-item {
    height: 250px;
  }
section[data-module="service-products"] .knm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 30px;
}
}


/* Mobile screen size */
@media (max-width: 480px) {

  /* Grid becomes 1 column */
  section[data-module="service-products"] .knm-grid {
    grid-template-columns: 1fr;
    grid-gap: 0px;
    margin: -40px 0px 0px 0px;
  }

  /* Item wrapper */
  section[data-module="service-products"] .knm-item-wrap {
    margin-top: 20px;
  }

  /* Accent image behind the card */
  section[data-module="service-products"] .knm-item-wrap::after {
    width: 110px;
    height: 110px;
    bottom: -4px;
    left: -4px;
  }

  /* Card size */
  section[data-module="service-products"] .knm-item {
    height: 230px;
    border-top-right-radius: 40px;
    margin-top: 0px;
  }

  /* Title */
  section[data-module="service-products"] .knm-title {
    font-size: 20px !important;
  }

  /* Line under title */
  section[data-module="service-products"] .knm-line {
    width: 70%;
    margin: 8px 0px -45px 0px;
  }

  /* Desc */
  section[data-module="service-products"] .knm-desc {
    font-size: 14px;
    padding-right: 35px;
    margin-top: 10px;
	margin-bottom: -10px;
  }
  section[data-module="service-products"] .knm-arrow img {
  bottom: -10px;
}
  /* Popup */
  section[data-module="service-products"] #knm-popup {
    width: 92%;
  }
  section[data-module="service-products"] #knm-popup-title {
    font-size: 22px;
	text-align: center;
  }
  section[data-module="service-products"] #knm-popup-desc {
    font-size: 14px;
  }
  section[data-module="service-products"] #knm-popup-cat {
    font-size: 18px !important;
	text-align: center !important;
  }
section[data-module="service-products"] .knm-popup-inner {
  padding: 10px;
}
section[data-module="service-products"] #knm-close {
  top: 0px;
  right: 0px;
  width: 35px;
  height: 35px;
}

}

