/* AONE review: catalog controls and textbook detail layout. */
body.textbook-catalog-review .catalog-page .aone-catalog-sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.textbook-catalog-review .catalog-page .aone-catalog-apply {
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--rd-gray-20);
  border-radius: 999px;
  background: #fff;
  white-space: nowrap;
}

body.textbook-catalog-review .catalog-page .aone-catalog-apply[hidden] {
  display: none;
}

body.textbook-catalog-review .catalog-series-heading h2 {
  scroll-margin-top: calc(var(--rd-header-height, 76px) + 24px);
}

body.textbook-catalog-review .catalog-page .catalog-grid .product-card {
  grid-template-columns: minmax(0, 122px) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

body.textbook-catalog-review .catalog-page .catalog-grid .product-card img {
  width: 100%;
  height: auto;
  max-height: 184px;
  object-fit: contain;
}

body.textbook-detail-redesign {
  --a1-detail-header-offset: 0px;
  --a1-detail-tabs-height: 64px;
}

body.textbook-detail-redesign .a1-detail-page .product-detail {
  grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
}

body.textbook-detail-redesign .a1-detail-page .product-visual {
  width: 100%;
  min-height: 0;
  padding: 40px 32px 32px;
  gap: 28px;
}

body.textbook-detail-redesign .a1-detail-page .a1-detail-cover-wrap {
  width: 100%;
}

body.textbook-detail-redesign .a1-detail-page .product-visual img {
  width: min(100%, 358px);
  height: auto;
  max-width: 100%;
  max-height: 505px;
  object-fit: contain;
}

body.textbook-detail-redesign .a1-detail-page .purchase-details > div {
  min-height: 0;
  padding: 14px 0;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

body.textbook-detail-redesign .a1-detail-page .purchase-details dt {
  padding-top: 8px;
}

body.textbook-detail-redesign .a1-detail-page .purchase-details dd {
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  line-height: 1.6;
}

body.textbook-detail-redesign .a1-detail-page .format-options .format-choice {
  min-width: 112px;
  width: auto;
  min-height: 48px;
  padding: 8px 18px;
}

body.textbook-detail-redesign .a1-detail-page .format-unavailable {
  margin: 0;
  text-align: left;
}

body.textbook-detail-redesign .a1-detail-page .quantity-help {
  flex-basis: 100%;
  margin: 0;
}

body.textbook-detail-redesign .a1-detail-page .purchase-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 56px;
  margin-top: 0;
}

body.textbook-detail-redesign .a1-detail-page .purchase-actions .button {
  min-width: 0;
  min-height: 56px;
  padding-inline: 12px;
  font-size: 16px;
}

body.textbook-detail-redesign .a1-detail-page .detail-tabs {
  position: sticky;
  top: var(--a1-detail-header-offset);
  z-index: 30;
  min-height: 56px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  background: #fff;
  -webkit-mask-image: none;
  mask-image: none;
}

body.textbook-detail-redesign .a1-detail-page .detail-tabs a {
  min-height: 56px;
  padding: 16px 18px;
  line-height: 24px;
}

body.textbook-detail-redesign .a1-detail-page .a1-detail-section {
  scroll-margin-top: calc(var(--a1-detail-header-offset) + var(--a1-detail-tabs-height) + 24px);
  border-bottom: 1px solid var(--a1-detail-gray-20);
}

body.textbook-detail-redesign .a1-detail-page .a1-detail-section > h2 {
  font-weight: 700;
  line-height: 1.5;
  word-break: keep-all;
}

body.textbook-detail-redesign .a1-detail-page .a1-detail-section-body > h3,
body.textbook-detail-redesign .a1-detail-page .a1-book-features h3 {
  margin: 0 0 16px;
  font-weight: 600;
  line-height: 1.5;
  word-break: keep-all;
}

body.textbook-detail-redesign .a1-detail-page .a1-detail-section-body > p {
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

body.textbook-detail-redesign .a1-detail-page .a1-toc-list {
  grid-template-columns: minmax(0, 1fr);
  padding: 12px 0;
  row-gap: 0;
}

body.textbook-detail-redesign .a1-detail-page .a1-toc-list li {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--a1-detail-gray-20);
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

body.textbook-detail-redesign .a1-detail-page .a1-toc-list li:last-child {
  border-bottom: 0;
}

body.textbook-detail-redesign .a1-detail-page .linked-resource-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

body.textbook-detail-redesign .a1-detail-page .linked-resource-pills a {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  padding: 12px 16px;
  justify-content: center;
  gap: 12px;
  font-size: 16px;
  text-align: center;
  line-height: 1.5;
}

body.textbook-detail-redesign .a1-detail-page .purchase-actions .wish,
body.textbook-detail-redesign .a1-detail-page .a1-mobile-wish {
  color: var(--a1-detail-blue-dark);
}

body.textbook-detail-redesign .a1-detail-page .purchase-actions .wish {
  font-size: 28px;
}

body.textbook-detail-redesign .a1-detail-page .purchase-actions .wish.active,
body.textbook-detail-redesign .a1-detail-page .a1-mobile-wish.active {
  color: var(--a1-detail-blue);
}

@media (max-width: 767px) {
  body.textbook-detail-redesign {
    --a1-detail-header-offset: var(--rd-header-height, 54px);
  }

  body.textbook-catalog-review .catalog-page .aone-catalog-sort-group {
    width: 100%;
  }

  body.textbook-catalog-review .catalog-page .catalog-grid .product-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 16px;
  }

  body.textbook-detail-redesign .a1-detail-page .product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  body.textbook-detail-redesign .a1-detail-page .product-visual {
    padding: 32px 24px 24px;
    gap: 24px;
  }

  body.textbook-detail-redesign .a1-detail-page .product-visual img {
    width: min(100%, 260px);
    max-height: 380px;
  }

  body.textbook-detail-redesign .a1-detail-page .purchase-details > div {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 12px 0;
    gap: 12px;
  }

  body.textbook-detail-redesign .a1-detail-page .purchase-details dd {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  body.textbook-detail-redesign .a1-detail-page .purchase-actions {
    display: none;
  }

  body.textbook-detail-redesign .a1-detail-page .detail-tabs a {
    min-height: 48px;
    padding: 12px 18px;
  }

  body.textbook-detail-redesign .a1-detail-page .detail-tabs {
    min-height: 48px;
  }

  body.textbook-detail-redesign .a1-detail-page .a1-toc-list li {
    padding: 10px 4px;
  }

  body.textbook-detail-redesign .a1-detail-page .linked-resource-pills {
    grid-template-columns: minmax(0, 1fr);
  }

  body.textbook-detail-redesign .a1-detail-page .a1-mobile-purchase-bar {
    z-index: 40;
    min-height: 80px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 8px;
  }

  body.textbook-detail-redesign .a1-detail-page .a1-mobile-purchase-bar .button,
  body.textbook-detail-redesign .a1-detail-page .a1-mobile-wish {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding-inline: 8px;
    font-size: 14px;
    white-space: nowrap;
  }

  body.textbook-detail-redesign .a1-detail-page .a1-mobile-wish {
    font-size: 26px;
  }

  body.textbook-detail-redesign .a1-detail-page .a1-mobile-wish:disabled {
    color: var(--a1-detail-gray-50);
  }

  body.textbook-detail-redesign:has(.a1-mobile-purchase-bar) .site-footer {
    margin-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  body.summary-detail-redesign .site-footer {
    margin-bottom: 24px;
  }
}
