/* Category descriptions: readable comparison tables on desktop and mobile. */
.category-description-content table {
  display: table;
  width: 100%;
  max-width: 100%;
  margin: 24px 0 30px;
  border: 1px solid #dedede;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  overflow: hidden;
  background: #fff;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

.category-description-content table th,
.category-description-content table td {
  padding: 14px 16px;
  border-right: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: normal;
}

.category-description-content table th {
  background: #f2f2f2;
  color: #222;
  font-weight: 700;
}

.category-description-content table tbody tr:nth-child(even) td {
  background: #fafafa;
}

.category-description-content table tr:last-child td {
  border-bottom: 0;
}

.category-description-content table th:last-child,
.category-description-content table td:last-child {
  border-right: 0;
}

.category-description-content table th:nth-child(1),
.category-description-content table td:nth-child(1) {
  width: 23%;
}

.category-description-content table th:nth-child(2),
.category-description-content table td:nth-child(2) {
  width: 32%;
}

.category-description-content table th:nth-child(3),
.category-description-content table td:nth-child(3) {
  width: 45%;
}

@media (max-width: 767px) {
  .category-description-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
    -webkit-overflow-scrolling: touch;
  }

  .category-description-content table tbody {
    display: table;
    width: 720px;
    table-layout: fixed;
  }

  .category-description-content table th,
  .category-description-content table td {
    padding: 11px 12px;
  }
}

/* Category descriptions: FAQ sections written as an h2 followed by a dl. */
#products .category-description-content h2:has(+ dl),
#products .category-description-content h2:has(+ p > strong:first-child) {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid #dedede;
  color: #222;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
}

#products .category-description-content h2:has(+ dl)::before,
#products .category-description-content h2:has(+ p > strong:first-child)::before {
  content: "?";
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ff4f1f;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.category-description-content h2 + dl {
  margin: 0 0 34px;
  padding: 0;
  counter-reset: category-faq;
}

.category-description-content h2 + dl dt {
  position: relative;
  margin: 14px 0 0;
  padding: 19px 22px 12px 66px;
  border: 1px solid #dfdfdf;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, #fff7f3 0, #fff 92px);
  color: #222;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.4;
  counter-increment: category-faq;
}

.category-description-content h2 + dl dt::before {
  content: counter(category-faq, decimal-leading-zero);
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ff4f1f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1;
}

.category-description-content h2 + dl dd {
  margin: 0;
  padding: 0 22px 20px 66px;
  border: 1px solid #dfdfdf;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(90deg, #fff7f3 0, #fff 92px);
  color: #666;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}

.category-description-content h2 + dl dt:hover,
.category-description-content h2 + dl dt:hover + dd {
  border-color: #cfcfcf;
}

/* Legacy category FAQs: one paragraph contains a strong question, a br and its answer. */
.category-description-content:has(> h2 + p > strong:first-child) {
  counter-reset: category-faq-legacy;
}

#products .category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child) {
  position: relative;
  margin: 14px 0 0;
  padding: 19px 22px 20px 66px;
  border: 1px solid #dfdfdf;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff7f3 0, #fff 92px);
  color: #666;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  counter-increment: category-faq-legacy;
}

.category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child)::before {
  content: counter(category-faq-legacy, decimal-leading-zero);
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ff4f1f;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1;
}

.category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child) > strong:first-child {
  display: block;
  margin: 0 0 8px;
  color: #222;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.4;
}

.category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child) > strong:first-child + br {
  display: none;
}

.category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child):hover {
  border-color: #cfcfcf;
}

@media (max-width: 767px) {
  #products .category-description-content h2:has(+ dl),
  #products .category-description-content h2:has(+ p > strong:first-child) {
    gap: 10px;
    margin: 32px 0 16px;
    padding-bottom: 13px;
    font-size: 22px;
  }

  #products .category-description-content h2:has(+ dl)::before,
  #products .category-description-content h2:has(+ p > strong:first-child)::before {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 19px;
  }

  .category-description-content h2 + dl dt {
    margin-top: 12px;
    padding: 16px 14px 10px 54px;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(90deg, #fff7f3 0, #fff 72px);
    font-size: 16px;
    line-height: 1.4;
  }

  .category-description-content h2 + dl dt::before {
    top: 15px;
    left: 14px;
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .category-description-content h2 + dl dd {
    padding: 0 14px 16px 54px;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(90deg, #fff7f3 0, #fff 72px);
    font-size: 15px;
    line-height: 1.6;
  }

  #products .category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child) {
    margin-top: 12px;
    padding: 16px 14px 16px 54px;
    border-radius: 10px;
    background: linear-gradient(90deg, #fff7f3 0, #fff 72px);
    font-size: 15px;
    line-height: 1.6;
  }

  .category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child)::before {
    top: 15px;
    left: 14px;
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .category-description-content h2:has(+ p > strong:first-child) ~ p:has(> strong:first-child) > strong:first-child {
    margin-bottom: 7px;
    font-size: 16px;
    line-height: 1.4;
  }
}
