/*
 * basket-panel: "Added to your basket" drawer.
 * tcc-basket.js sets .is-loading while adding, .is-error if adding failed,
 * and .is-saving while an option choice is being saved.
 */
.tcc-bp {
  --size: 440px;
}
.tcc-bp::part(dialog) {
  background: var(--tcc-bg);
  color: var(--tcc-ink);
}
.tcc-bp::part(body) {
  padding: 0;
}
.tcc-bp::part(footer) {
  display: block;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--tcc-line);
}
.tcc-bp[placement="bottom"] {
  --size: auto;
}
.tcc-bp[placement="bottom"]::part(dialog) {
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
}

/* plain buttons: undo Web Awesome's native button style */
.tcc-bp button {
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* header */
.tcc-bp__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--tcc-strip-bg);
  color: var(--tcc-strip-text);
}
.tcc-bp__tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2e8b57;
  color: #fff;
}
.tcc-bp__spinner {
  display: none;
  font-size: 1.6rem;
  --indicator-color: var(--tcc-strip-text);
}
.tcc-bp.is-loading .tcc-bp__spinner {
  display: block;
}
.tcc-bp.is-loading .tcc-bp__tick,
.tcc-bp.is-error .tcc-bp__tick {
  display: none;
}
.tcc-bp__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: inherit;
}
.tcc-bp .tcc-bp__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, .6);
}

/* error */
.tcc-bp__error {
  display: none;
  margin: 20px;
  padding: 16px;
  border-radius: 12px;
  border: 1.5px solid var(--tcc-line);
}
.tcc-bp.is-error .tcc-bp__error {
  display: block;
}
.tcc-bp__error p {
  margin: 4px 0 8px;
  color: var(--tcc-muted);
}
.tcc-bp__error a {
  font-weight: 700;
  color: var(--tcc-link);
}
.tcc-bp.is-error .tcc-bp__head {
  background: var(--tcc-surface);
  color: var(--tcc-ink);
}
.tcc-bp.is-error .tcc-bp__body,
.tcc-bp.is-error .tcc-bp__total,
.tcc-bp.is-error .tcc-bp__note,
.tcc-bp.is-error .tcc-bp__checkout {
  display: none;
}

/* course card */
.tcc-bp__body {
  padding: 20px;
}
.tcc-bp__item {
  padding: 16px;
  border: 1px solid var(--tcc-line);
  border-radius: 12px;
}
.tcc-bp__item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.tcc-bp__item h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}
.tcc-bp__price {
  flex: none;
  text-align: right;
}
.tcc-bp__price s {
  font-size: .85rem;
  color: var(--tcc-muted);
}
.tcc-bp__price s:empty {
  display: none;
}
.tcc-bp__price b {
  display: block;
  font-family: var(--wa-font-family-heading);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}
.tcc-bp__price small {
  display: block;
  font-size: .8rem;
  color: var(--tcc-muted);
}
.tcc-bp__meta {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--tcc-line);
  list-style: none;
  font-size: .92rem;
  color: var(--tcc-muted);
}
.tcc-bp__meta li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.tcc-bp__meta li:has(span:empty) {
  display: none;
}
.tcc-bp__meta wa-icon {
  flex: none;
  color: var(--tcc-accent);
}
.tcc-bp__save {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--tcc-sage);
  color: var(--tcc-navy);
  font-size: .78rem;
  font-weight: 700;
}
.tcc-bp__save:empty {
  display: none;
}

/* waiting for the server: placeholders where the options and total will go,
   and the figures that are about to change are dimmed */
.tcc-bp.is-loading .tcc-bp__price b,
.tcc-bp.is-saving .tcc-bp__price b {
  opacity: .45;
  transition: opacity .2s;
}
.tcc-bp.is-loading .tcc-bp__options::before,
.tcc-bp.is-loading .tcc-bp__options::after,
.tcc-bp.is-loading .tcc-bp__total b::before {
  content: "";
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--tcc-line) 25%, var(--tcc-surface) 50%, var(--tcc-line) 75%) 0 0 / 200% 100%;
  animation: tcc-bp-shimmer 1.2s linear infinite;
}
.tcc-bp.is-loading .tcc-bp__options::before {
  width: 45%;
  height: 16px;
  margin-top: 22px;
}
.tcc-bp.is-loading .tcc-bp__options::after {
  height: 92px;
  margin-top: 10px;
}
.tcc-bp.is-loading .tcc-bp__total b::before {
  width: 80px;
  height: 24px;
  border-radius: 6px;
}
@keyframes tcc-bp-shimmer {
  to { background-position: -200% 0; }
}

/* options */
.tcc-bp__options fieldset {
  display: block; /* Web Awesome's native styles make fieldsets shrink their contents */
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.tcc-bp__options legend {
  padding: 0;
  font-weight: 700;
}
.tcc-bp__options legend span {
  font-weight: 400;
  color: var(--tcc-muted);
}
.tcc-bp__options fieldset > p {
  margin: 2px 0 0;
  font-size: .85rem;
  color: var(--tcc-muted);
}
.tcc-bp__choice {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--tcc-line);
  border-radius: 10px;
  cursor: pointer;
}
.tcc-bp__choice:hover {
  border-color: var(--tcc-accent-blue);
}
.tcc-bp__choice:has(input:checked) {
  border-color: var(--tcc-link);
  background: var(--tcc-surface);
}
.tcc-bp__choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--tcc-link);
}
.tcc-bp__choice span {
  font-weight: 600;
}
/* the choice being saved gets a small spinner at the end */
.tcc-bp__choice.is-pending::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: auto;
  border: 2px solid var(--tcc-line);
  border-top-color: var(--tcc-link);
  border-radius: 50%;
  animation: tcc-bp-spin .7s linear infinite;
}
@keyframes tcc-bp-spin {
  to { rotate: 360deg; }
}
@media (prefers-reduced-motion: reduce) {
  .tcc-bp *,
  .tcc-bp *::before,
  .tcc-bp *::after {
    animation-duration: 2s;
  }
}
.tcc-bp__save-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--tcc-surface);
  color: var(--tcc-ink);
  font-size: .88rem;
}

/* footer */
.tcc-bp__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.tcc-bp__total > span {
  font-size: .92rem;
  color: var(--tcc-muted);
}
.tcc-bp__total b {
  font-family: var(--wa-font-family-heading);
  font-size: 1.5rem;
  font-weight: 800;
}
.tcc-bp.is-saving .tcc-bp__total b {
  font-size: 1rem;
  font-weight: 600;
  color: var(--tcc-muted);
}
.tcc-bp__note {
  margin: 2px 0 0;
  font-size: .8rem;
  color: var(--tcc-muted);
}
.tcc-bp__actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.tcc-bp__actions wa-button::part(base) {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
}
.tcc-bp__links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 0;
  font-size: .88rem;
}
.tcc-bp__links a {
  font-weight: 700;
  color: var(--tcc-link);
}
.tcc-bp__links span {
  color: var(--tcc-muted);
}
