/* =========================================================================
   Homepage — Solutions carousel section
   ========================================================================= */

.hp-solutions {
  padding: 0 0 96px 0;
}

/* Desktop: hp-solutions section full chieu cao viewport */
@media screen and (min-width: 1025px) {
  .hp-solutions {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 48px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
  }

  body.admin-bar .hp-solutions {
    min-height: calc(100vh - 32px);
    min-height: calc(100dvh - 32px);
  }
}

/* --- Head: title + view-all ------------------------------------------------ */
.hp-solutions__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
}

.hp-solutions__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hp-solutions__title-section {
  margin: 0;
  color: #293948;
  font-family: var(--font-hn);
  font-weight: 700;
  font-size: 30px;
  line-height: 136%;
  letter-spacing: 0.01em;
}

.hp-solutions__desc-section {
  margin: 0;
  color: #616161;
  font-family: var(--font-hn);
  font-weight: 300;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.01em;
}

.hp-solutions__view-all {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: #9E9E9E;
  font-family: var(--font-hn);
  font-weight: 500;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.hp-solutions__view-all svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: color 0.25s ease;
}

.hp-solutions__view-all:hover,
.hp-solutions__view-all:focus {
  color: #D85401;
}

/* --- Service page variant --------------------------------------------------- */
.hp-solutions--service {
  padding-top: 96px;
}

/* --- Centered head (service page) ------------------------------------------ */
.hp-solutions__head--center {
  justify-content: center;
  text-align: center;
}

.hp-solutions__head--center .hp-solutions__text {
  align-items: center;
}

/* --- Carousel wrapper ------------------------------------------------------ */
.hp-solutions__carousel {
  position: relative;
}

.hp-solutions__swiper {
  overflow: hidden;
}

/* --- Card ------------------------------------------------------------------ */
.hp-solutions__card {
  position: relative;
  display: block;
  aspect-ratio: 320 / 500;
  overflow: hidden;
  border-radius: 20px;
  background: #293948;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
}

.hp-solutions__image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 40%;
  z-index: 1;
  transition: opacity 0.4s ease;
}

.hp-solutions__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hp-solutions__info {
  position: absolute;
  left: 0;
  right: 0;
  top: 60%;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  height: auto;
  padding: 20px;
  box-sizing: border-box;
  background: #293948;
  transition:
    top 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.5s ease 0.15s,
    gap 0.5s ease;
}

.hp-solutions__card-title {
  margin: 0;
  color: #FFFFFF;
  font-family: var(--font-hn);
  font-weight: 500;
  font-size: 20px;
  line-height: 138%;
  letter-spacing: 0.01em;
  min-height: calc(20px * 1.38 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hp-solutions__card-desc {
  margin: 0;
  color: #FFFFFF;
  font-family: var(--font-hn);
  font-weight: 300;
  font-size: 14px;
  line-height: 145%;
  letter-spacing: 0.01em;
  min-height: calc(14px * 1.45 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

/* --- Hover state ----------------------------------------------------------- */
.hp-solutions__card:hover .hp-solutions__image,
.hp-solutions__card:focus-visible .hp-solutions__image {
  opacity: 0;
}

.hp-solutions__card:hover .hp-solutions__info,
.hp-solutions__card:focus-visible .hp-solutions__info {
  top: 0;
  height: auto;
  gap: 16px;
  background: #293948;
  /* The panel uses the whole card when it is being read. Long copy remains
     available by scrolling inside the card instead of being truncated. */
  overflow-x: hidden;
  overflow-y: auto;
  justify-content: flex-start;
}

.hp-solutions__card:hover .hp-solutions__card-title,
.hp-solutions__card:focus-visible .hp-solutions__card-title,
.hp-solutions__card:hover .hp-solutions__card-desc,
.hp-solutions__card:focus-visible .hp-solutions__card-desc {
  min-height: 0;
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
  overflow: visible;
}

/* --- Nav buttons (bottom center) ------------------------------------------- */
.hp-solutions__nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.hp-solutions__prev,
.hp-solutions__next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.25s ease;
}

.hp-solutions__prev:hover,
.hp-solutions__next:hover {
  opacity: 0.7;
}

.hp-solutions__prev.swiper-button-disabled,
.hp-solutions__next.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.hp-solutions__prev svg,
.hp-solutions__next svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

/* --- Responsive ------------------------------------------------------------ */
@media screen and (max-width: 900px) {
  .hp-solutions {
    padding: 0 0 72px 0;
  }
}

@media screen and (max-width: 640px) {
  .hp-solutions {
    padding: 0 0 56px 0;
  }

  .hp-solutions__head {
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
  }

  .hp-solutions__info {
    height: 132px;
    padding: 14px;
    gap: 8px;
  }

  .hp-solutions__card-title {
    font-size: 15px;
    min-height: calc(15px * 1.38 * 2);
    -webkit-line-clamp: 2;
  }

  .hp-solutions__card-desc {
    font-size: 12px;
    min-height: calc(12px * 1.45 * 2);
  }

  .hp-solutions__title-section {
    font-size: 24px;
  }

  .hp-solutions__nav {
    margin-top: 24px;
  }

  .hp-solutions__prev,
  .hp-solutions__next {
    width: 40px;
    height: 40px;
  }
}
