:root {
  --primary-color: #0066cc;
  --primary-hover: #0056b3;
  --shadow-color: #eee;
  --border-color: rgb(199, 226, 254);
  --badge-bg-best: #007bff;
  --badge-bg-value: #ffc0cb;
  --text-dark: rgb(33, 41, 49);
  --text-muted: #444;
}

.body2 {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.leading-20 {
  line-height: 20;
}

.font-400 {
  font-weight: 400;
}

.font-300 {
  font-weight: 300;
}

.font-500 {
  font-weight: 500;
}

.font-600 {
  font-weight: 600;
}

.text-14 {
  font-size: 14px;
}

.text-gray-1100 {
  color: rgb(61, 70, 82) !important;
}

.text-gray-1000 {
  color: rgb(72, 84, 97);
}

.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.text-gray-900 {
  color: #55616e;
}

.text-primary-500 {
  color: rgb(60, 72, 104);
}

.text-error-500 {
  color: rgb(228, 61, 108);
}

.rounded-8 {
  border-radius: 8px;
}

.rounded-12 {
  border-radius: 12px;
}

.bg-gray-100 {
  background-color: #f2f4f7;
}

.sub2 {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.gap-12 {
  gap: 0.75rem;
}

.how-do-we-rank {
  font-weight: 600;
}

.mini2 {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.bg-error-500 {
  background-color: rgb(228, 61, 108);
}

/* Dropdown Styling */
.dropdown-wrapper {
  position: relative;
  max-width: 100%;
  margin: 1rem 0;
}

.dropdown-button {
  width: fit-content;
  background: #fff;
  border: 1px solid rgb(225, 228, 230);
  padding: 0.3125rem 0.5rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dark);
  font-size: 0.875rem;
  border-radius: 12px !important;
  font-weight: 500;
  gap: 0.5rem;
}
/* .dropdown-button .selected-value {
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
} */
.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  white-space: nowrap; /* Ngăn các option bị xuống dòng */
  display: none;
  text-overflow: ellipsis; /* Hiển thị dấu "..." */
  margin-top: 0.25rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.dropdown-options.show {
  display: block;
}

.dropdown-option {
  text-align: left;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-dark);
  font-weight: 300;
  color: rgb(99, 112, 125);
}

.dropdown-option:hover {
  background: #f0f0f0;
}

/* ----------------- */

.max-percentage-saved {
  width: fit-content;
  padding: 0.25rem 0.5rem;
  align-self: center;
  white-space: nowrap; /* Ngăn các option bị xuống dòng */
}

.cegg5-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: "Inter", sans-serif;
}

/* Card Styling */
.card {
  box-shadow: 4px 4px 4px 0 var(--shadow-color);
  border-radius: 20px !important;
  border: 1px solid var(--border-color);
  position: relative;
  min-height: 100%;
  border-bottom: 1px solid #d1d5db;
}

/* Product Title */
.card .product-title {
  margin-top: 16px !important;
  font-weight: 700;
  color: rgb(61, 70, 82) !important;
  font-size: 1.125rem;
  /* color: var(--text-dark); */
}

/* Merchant Logo */
.merchant-logo {
  max-height: 27px;
  object-fit: contain;
}

/* Toggle Button */
.toggle-desc {
  display: inline-block;
  padding: 0.4em 1em;
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-color);
  border: 1px solid rgb(242, 244, 247);
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 16px;
}

.toggle-desc:hover {
  background-color: rgba(0, 123, 255, 0.2);
  color: var(--primary-hover);
}

/* Secondary Toggle Button */
.toggle-desc-secondary {
  display: block;
  margin-top: 0.5rem;
  padding: 0.4em 1em;
  background-color: rgba(0, 123, 255, 0.1);
  color: var(--primary-color);
  border: 1px solid rgb(242, 244, 247);
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
}

.toggle-desc-secondary:hover {
  background-color: rgba(0, 123, 255, 0.2);
  color: var(--primary-hover);
}

.badge-top-number {
  position: relative;
  top: -17px;
  left: -8px;
  z-index: 10;
}

.badge-top-number svg.part1 {
  position: absolute;
  left: 0px;
}

.badge-top-number svg.part2 {
  position: absolute;
  top: 30px;
  left: 0.7px;
}

.badge-top-number svg.part3 {
  position: absolute;
  left: 29px;
}

/* Product Number Badge */
.product-number-badge {
  position: absolute;
  top: 60px;
  left: -20px;
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  color: rgb(114, 125, 135);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 11;
}

/* Image and Rating Row */
.image-and-rating {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  position: relative;
  justify-content: space-evenly;
}

.image-column {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #d1d5db;
  height: 220px;
  padding: 16px 0 16px 24px;
}

.product-image {
  max-height: 160px;
  max-width: 160px;
}

/* Manufacturer */
.manufacturer {
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 0.875rem;
}

.percentage-saved {
  display: inline-block;
  background-color: rgb(228, 61, 108);
  color: white;
  padding: 0px 8px 0px 8px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.pick-by {
  margin-top: 16px;
  display: flex;
  gap: 0.5rem;
  background-color: #f5f9ff;
  border-radius: 4px;
  width: fit-content;
  padding: 0 8px 0 8px;
}

.pick-by-mobile {
  margin-bottom: 10px !important;
  display: flex;
  gap: 0.5rem;
  border-radius: 4px;
  width: fit-content;
  padding: 0 8px 0 8px;
  justify-content: center;
}

.rating-column {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border-width: 1px;
}

.rating-number {
  color: var(--text-dark);
  font-weight: bold;
  font-size: 1.5rem;
}

/* Show More Content */
.show-more-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s ease, padding 0.6s ease, box-shadow 1s ease;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0px 1px 0px 0px #ccc inset;
}

.show-more-content.is-visible {
  max-height: 1000px;
  padding-top: 10px;
}

/* List Styling */
.text-muted ul li {
  list-style: none;
  color: var(--text-muted);
  position: relative;
  padding-left: 1.5em;
  font-size: 1rem;
  margin-bottom: 0.5em;
  text-align: left;
  word-break: break-word;
  text-transform: capitalize;
}

.why-love-list li::before,
.highlight-list li::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  left: 0;
  top: 0.3em;
  background-image: url("https://d1ttb1lnpo2lvz.cloudfront.net/b5c10142/img/checked1.svg");
}

.highlight-list li:nth-child(1)::before {
  background-image: url("https://d1ttb1lnpo2lvz.cloudfront.net/b5c10142/img/highlight-img-0.svg");
}

.highlight-list li:nth-child(2)::before {
  background-image: url("https://d1ttb1lnpo2lvz.cloudfront.net/b5c10142/img/highlight-img-2.svg");
}

.highlight-list li:nth-child(3)::before {
  background-image: url("http://d1ttb1lnpo2lvz.cloudfront.net/b5c10142/img/highlight-img-1.svg");
}

/* Headings */
.why-love-heading,
.highlight-heading {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: left;
}

.show-more-content .why-love-heading,
.show-more-content .highlight-heading {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 700;
  color: rgb(33, 41, 49);
  text-align: left;
}

.title-column {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid #d1d5db;
  height: 220px;
  justify-content: space-between;
}

.buy-column {
  border-radius: 14px;
  width: 100%;
  border: 1px solid #ddd;
  display: inline-flex;
  align-items: center;
  justify-content: space-around !important;
  cursor: pointer;
  background: linear-gradient(to right, #fff 50%, #0d6efd 50%);
  overflow: hidden;
  margin: 0 1rem 0 0;
}

.buy-column .merchant-logo {
  padding: 4px 12px 4px 12px;
}

.buy-column .check-price-button {
  color: white;
  padding: 5px 0 5px 0;
}

.product-row {
  gap: 1rem;
}

.description-container {
  width: 100%;
}

/* Desktop Media Query (min-width: 761px) */
@media (min-width: 761px) {
  .toggle-desc-secondary {
    display: none;
  }

  .pick-by-mobile {
    display: none;
  }
}

/* Mobile Media Query */
@media (max-width: 760px) {
  .card .product-row {
    display: flex !important;
    flex-direction: column !important;
  }

  .product-row {
    padding: 24px 24px 0 24px;
  }

  .card a.btn {
    margin: 1rem 0;
  }

  .card .position-absolute {
    position: static;
    margin: 0;
    padding: 0;
  }

  .title-column {
    /* align-items: left; */
    text-align: left !important;
    border-right: 0px;
    padding: 16px 0 0 0;
  }

  .product-number-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    left: -16px;
    top: 100px;
  }

  .image-and-rating {
    flex-direction: row;
    justify-content: space-around;
    gap: 2.0625rem;
    padding-top: 0.875rem;
  }

  .image-column {
    justify-content: center;
    border-left: 0px;
    padding: 0 0 0 9px;
    flex: 1;
    max-width: 145px;
    max-height: 164px;
  }

  .product-image {
    max-width: 136px;
    max-height: 136px;
  }

  .rating-column {
    max-width: 130px;
    padding: 0;
    flex: 1;
  }

  .rating-column::after {
    content: "";
    position: absolute;
    left: 60%;
    transform: translateX(-20%);
    top: 0%;
    height: 164px;
    width: 1px;
    background-color: #ccc;
  }

  .percentage-saved {
    margin-bottom: 20px;
  }

  .show-more-content .highlight-heading,
  .show-more-content .highlight-list {
    display: none;
  }

  .show-more-content {
    box-shadow: 0 0 0 0;
  }

  .buy-column {
    padding: 0 15px 0 15px !important;
    border-width: 1px !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-direction: row;
    display: flex;
    margin: 0 0 5px 0;
  }

  .toggle-desc {
    display: none;
  }

  .toggle-desc-secondary {
    margin: 0.5rem 24px;
  }

  .description-container {
    margin-top: 0;
  }

  .pick-by {
    display: none;
  }

  .product-row {
    gap: 0.3rem;
  }

  /* Thêm đoạn này vào cuối */
  /* .dropdown-button {
    border: none; 
    background: transparent; 
    padding-left: 0; 
    padding-right: 0;
  } */

  .percentage-dropdown {
    gap: 0.5rem; /* (Tùy chọn) Giảm khoảng cách giữa 2 mục trên mobile */
  }
}

.percentage-dropdown {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 2rem;
}

.tooltip-container {
  position: relative;
  margin: 2rem auto;
  padding: 1rem;
  background: #f0f7ff;
  border: 1px solid #99c8ff;
  border-radius: 10px;
  text-align: center;
  /* width: fit-content; */
  cursor: pointer;
  margin-bottom: 50px;
}

.tooltip-container .how-do-we-rank-1 {
  text-underline-offset: 4px;
  font-weight: 500;
}

.tooltip-link {
  font-weight: bold;
  color: #1a1a1a;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  text-underline-offset: 4px;
}

.bulb {
  vertical-align: text-top;
}

.tooltip-arrow {
  position: absolute;
  top: -5px;
  left: 11rem;
}

.tooltip-box {
  /* display: none; */
  position: absolute;
  max-width: 360px;
  transform: translateX(-50%);
  left: 50%;
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 999;
  display: none;
  text-align: left;
  padding-right: 2.75rem !important;
  padding: 1rem;
  z-index: 999;
  background-color: white;
}

.tooltip-box .description {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 400;
  color: rgb(72, 84, 97);
}

.tooltip-box h4 {
  margin: 0 0 0.5rem;
}

.tooltip-box p {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
}

.tooltip-close {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  top: 20px;
}