/*
 * NOWON Band - Checkout page (checkout.html)
 * Steps, summary and the thank-you screen are driven by assets/js/pages/checkout.js.
 *
 * TABLE OF CONTENTS
 *  1. Layout
 *  2. Steps
 *  3. Fields, country and gift
 *  4. Shipping and payment options
 *  5. Order summary
 *  6. Thank you
 *  7. Media queries
 */

/* ==========================================================================
   1. Layout
   ========================================================================== */
.co__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: start;
  gap: 40px clamp(30px, 4vw, 70px);
}

.co[hidden],
.co-done[hidden] {
  display: none;
}

.co__steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

/* ==========================================================================
   2. Steps
   ========================================================================== */
.co-step {
  min-width: 0;
  padding: clamp(20px, 2.4vw, 32px);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1.5px rgba(245, 237, 216, .1);
  transition: background-color .3s ease, opacity .3s ease;
}

.co-step.is-open {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}

.co-step.is-later .co-step__head {
  color: var(--faint);
}

.co-step.is-later .co-step__mark {
  color: var(--faint);
  box-shadow: inset 0 0 0 2px var(--line-3);
}

.co-step__head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.co-step__mark {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--acc);
  box-shadow: inset 0 0 0 2px var(--acc);
  font-weight: 800;
  font-size: 14px;
}

.co-step.is-open .co-step__mark,
.co-step.is-done .co-step__mark {
  background: var(--acc);
  color: var(--ink);
}

.co-step__titles {
  flex: 1;
  min-width: 0;
}

.co-step__title {
  font-weight: 900;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.2;
  letter-spacing: -.03em;
}

.co-step__title:focus {
  outline: none;
}

.co-step.is-open .co-step__title {
  color: var(--acc);
}

.co-step__sum {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.co-step__edit {
  flex: none;
  box-shadow: inset 0 0 0 1.5px var(--line-3);
}

.co-step__edit[hidden] {
  display: none;
}

.co-step__body {
  margin-top: 26px;
}

.co-step__body[hidden] {
  display: none;
}

.co__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 24px;
}

.co__next {
  max-width: 100%;
  height: 58px;
  padding: 0 34px;
  font-size: 12px;
  letter-spacing: .2em;
}

.co__place {
  height: 62px;
  padding: 0 36px;
  font-size: 13px;
}

.co__place-total {
  display: inline-block;
}

.co__err {
  color: var(--error);
  font-size: 13px;
}

.co__demo {
  margin-top: 14px;
  color: var(--faint);
  font-size: 12px;
}

/* ==========================================================================
   3. Fields, country and gift
   ========================================================================== */
.co__fields,
.co__card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.co__card {
  grid-template-columns: 2fr 1fr 1fr;
  margin-top: 18px;
}

.co__card[hidden] {
  display: none;
}

.co__field--full {
  grid-column: 1 / -1;
}

.co__card .co__field:nth-child(2) {
  grid-column: 1 / 3;
}

.co__label {
  font-size: 10px;
}

.co__input {
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px rgba(245, 237, 216, .2);
}

.co__input::placeholder {
  color: var(--faint);
}

.co__input:focus {
  box-shadow: inset 0 0 0 1.5px var(--acc);
}

.co .is-invalid .co__input {
  box-shadow: inset 0 0 0 1.5px var(--error);
}

.co__country {
  margin-top: 18px;
}

.co__chips {
  gap: 8px;
  margin-top: 8px;
}

.co__chip {
  min-height: 44px;
  letter-spacing: .2em;
  box-shadow: inset 0 0 0 1.5px rgba(245, 237, 216, .25);
}

.co-tick {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.co-tick__box {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--acc);
  font-size: 14px;
}

.co-tick[aria-pressed="true"] .co-tick__box {
  background: var(--acc);
}

.co-tick[aria-pressed="true"] .co-tick__box::before {
  content: "✓";
}

.co__note {
  margin-top: 14px;
}

.co__note[hidden] {
  display: none;
}

.co__textarea {
  min-height: 0;
  padding: 14px 18px;
  line-height: 1.5;
}

/* ==========================================================================
   4. Shipping and payment options
   ========================================================================== */
.co__opts {
  display: grid;
  gap: 10px;
}

.co-opt {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 0 0 1.5px rgba(245, 237, 216, .2);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease;
}

.co-opt:hover {
  box-shadow: inset 0 0 0 1.5px var(--line-3);
}

.co-opt[aria-pressed="true"] {
  background: var(--acc-10);
  box-shadow: inset 0 0 0 1.5px var(--acc);
}

.co-opt__dot {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--acc);
}

.co-opt[aria-pressed="true"] .co-opt__dot {
  background: var(--acc);
}

.co-opt__text {
  display: block;
  min-width: 0;
}

.co-opt__title {
  display: block;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.3;
}

.co-opt__note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.co-opt__price {
  display: block;
  font-weight: 900;
  font-size: 18px;
  white-space: nowrap;
}

.co-opt__price.is-free {
  color: var(--acc);
}

/* ==========================================================================
   5. Order summary
   ========================================================================== */
.co__sum {
  position: sticky;
  top: 124px;
  padding: 28px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.co__sum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.co__editbag {
  flex: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .2em;
  text-decoration: none;
}

.co__editbag:hover {
  color: var(--cream);
}

.co__lines {
  margin: 16px 0 0;
  padding: 0;
  border-top: 2px solid var(--cream);
  list-style: none;
}

.co__line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.co__media {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
}

.co__thumb {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.co__badge {
  position: absolute;
  right: -4px;
  top: -4px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--acc);
  color: var(--ink);
  font-weight: 800;
  font-size: 11px;
}

.co__line-text {
  display: block;
  min-width: 0;
}

.co__line-name {
  display: block;
  font-weight: 800;
  font-size: 15px;
}

.co__line-opt {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.co__line-total {
  display: block;
  font-weight: 800;
}

.co__empty {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.co__empty[hidden] {
  display: none;
}

.co__empty a {
  color: var(--acc);
}

.co__rows {
  margin: 6px 0 0;
}

.co__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
}

.co__row dd {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

.co__row.is-acc {
  color: var(--acc);
}

.co__grand {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 2px solid var(--cream);
}

.co__grand-label {
  display: block;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .25em;
}

.co__grand-value {
  display: block;
  font-weight: 900;
  font-size: clamp(44px, 4vw, 60px);
  line-height: .85;
  letter-spacing: -.05em;
  white-space: nowrap;
}

.co__trust {
  display: grid;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .15em;
  list-style: none;
}

/* ==========================================================================
   6. Thank you
   ========================================================================== */
.co-done__word {
  margin-top: 20px;
  font-size: clamp(90px, 15vw, 260px);
  line-height: .8;
}

.co-done__word:focus {
  outline: none;
}

.co-done__text {
  max-width: 640px;
  margin-top: 30px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.co-done__trip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 50px 0 0;
  padding: 0;
  list-style: none;
}

.co-trip {
  padding: 24px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.co-trip.is-first {
  background: var(--acc);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--acc);
}

.co-trip__when {
  font-family: var(--mono);
  font-size: 12px;
}

.co-trip__title {
  margin-top: 10px;
  font-weight: 900;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.co-trip__note {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  opacity: .8;
}

.co-done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.co-done__btn {
  height: 58px;
  padding: 0 30px;
  font-size: 12px;
  letter-spacing: .2em;
}

.co-done__again {
  height: 58px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .2em;
  white-space: nowrap;
  cursor: pointer;
}

.co-done__again:hover {
  color: var(--cream);
}

/* ==========================================================================
   7. Media queries
   ========================================================================== */
@media (max-width: 1099px) {
  .co__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .co__sum {
    position: static;
  }

  .co-done__trip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  .co__fields,
  .co__card {
    grid-template-columns: minmax(0, 1fr);
  }

  .co__card .co__field:nth-child(2) {
    grid-column: auto;
  }
}

@media (max-width: 599px) {
  .co-done__trip {
    grid-template-columns: minmax(0, 1fr);
  }

  .co-done__word {
    font-size: 25vw;
  }

  .co-done__btn {
    width: 100%;
  }
}

@media (max-width: 479px) {
  .co-step__head {
    gap: 12px;
  }

  .co-step__mark {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .co-opt {
    gap: 12px;
    padding: 14px;
  }

  .co__next,
  .co__place {
    width: 100%;
    padding: 0 18px;
    letter-spacing: .12em;
  }

  .co__sum {
    padding: 22px 18px;
  }
}
