:root {
  --layout-spacing: 1.5rem;
}

@media (min-width: 992px) {
  :root {
    --layout-spacing: 2rem;
  }
}
.checkout {
  background: hsl(220, 13%, 96%);
  padding-block: 1.25rem 3rem;
}
.checkout__inner {
  max-width: 33rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.checkout__section {
  margin: 2rem 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(0, 0%, 4%);
}
.checkout__section:first-child {
  margin-top: 0;
}

.summary {
  margin-top: 1.5rem;
}

.field + .field {
  margin-top: 1.125rem;
}
.field__label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(212, 18%, 28%);
}
.field__req {
  color: hsl(0, 60%, 64%);
  font-weight: 400;
}
.field__info {
  display: inline-flex;
  width: 1.125rem;
  height: 1.125rem;
  color: hsl(210, 12%, 62%);
}
.field__input {
  width: 100%;
  padding: 0.875rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  background: hsl(0, 0%, 100%);
  box-shadow: 0 6px 18px -12px hsla(212, 60%, 25%, 0.16);
  font-size: 1rem;
  font-weight: 400;
  color: hsl(0, 0%, 4%);
  transition: box-shadow 0.15s ease;
}
.field__input:focus {
  outline: none;
  box-shadow: 0 6px 18px -12px hsla(212, 60%, 25%, 0.16), 0 0 0 2px hsl(221, 83%, 53%);
}
.field__input::placeholder {
  color: hsl(210, 12%, 62%);
}
.field__input[readonly] {
  cursor: default;
}
.field__input[readonly]:focus {
  box-shadow: 0 6px 18px -12px hsla(212, 60%, 25%, 0.16);
}
.field--copy .field__control {
  position: relative;
}
.field--copy .field__input {
  padding-inline-end: 3rem;
}
.field__copy {
  position: absolute;
  top: 50%;
  inset-inline-end: 0.75rem;
  transform: translateY(-50%);
  display: inline-flex;
  flex-shrink: 0;
  color: hsl(210, 14%, 45%);
}
.field__copy .c-icon {
  width: 1.375rem;
  height: 1.375rem;
}
.field__copy:hover {
  color: hsl(221, 83%, 53%);
}
.field__copy::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 0.5rem);
  inset-inline-end: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  background: hsl(212, 40%, 18%);
  color: hsl(0, 0%, 100%);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0.25rem);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.field__copy:hover::after, .field__copy:focus-visible::after, .field__copy.is-copied::after {
  opacity: 1;
  transform: translateY(0);
}
.field__phone-fallback {
  display: flex;
  gap: 0.625rem;
}
.field__phone-fallback[hidden] {
  display: none;
}
.field__phone-fallback select {
  flex: 0 0 9.5rem;
  min-width: 0;
}
.field__phone-fallback input {
  flex: 1;
  min-width: 0;
}

.pay {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.pay__method {
  display: block;
  background: hsl(0, 0%, 100%);
  border: 2px solid transparent;
  border-radius: 0.625rem;
  box-shadow: 0 8px 22px -14px hsla(212, 60%, 25%, 0.16);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pay__method.is-active, .pay__method:has(.pay__radio-input:checked) {
  border-color: hsl(221, 83%, 53%);
}
.pay__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.125rem 1.125rem;
}
.pay__radio-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pay__radio {
  position: relative;
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  border: 2px solid hsl(214, 16%, 75%);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pay__radio-input:checked + .pay__radio {
  border-color: hsl(221, 83%, 53%);
  background: hsl(221, 83%, 53%);
}
.pay__radio-input:checked + .pay__radio::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: hsl(0, 0%, 100%);
}
.pay__radio-input:focus-visible + .pay__radio {
  outline: 2px solid hsl(221, 83%, 53%);
  outline-offset: 2px;
}
.pay__icon {
  width: 1.5rem;
  height: 1.5rem;
  color: hsl(212, 20%, 30%);
  flex-shrink: 0;
}
.pay__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(0, 0%, 4%);
  white-space: nowrap;
}
.pay__logos {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  flex-shrink: 0;
}
.pay__body {
  display: none;
  padding: 0 1.25rem 1.25rem;
}
.pay__method.is-active .pay__body, .pay__method:has(.pay__radio-input:checked) .pay__body {
  display: block;
}
.pay__body .field__input {
  background: hsl(220, 16%, 96%);
  box-shadow: none;
}
.pay__body .field__input:focus {
  box-shadow: 0 0 0 2px hsl(221, 83%, 53%);
}
.pay__total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(214, 22%, 92%);
}
.pay__total-label {
  grid-column: 1;
  font-size: 0.875rem;
  color: hsl(212, 14%, 38%);
}
.pay__total-amount {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(0, 0%, 4%);
}
.pay__total-note {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  font-size: 0.8125rem;
  color: hsl(212, 12%, 45%);
}
.pay__coupon-label {
  display: block;
  padding-top: 1rem;
  margin-bottom: 0.625rem;
  font-size: 0.8125rem;
  color: hsl(212, 14%, 40%);
}

.paylogo {
  display: inline-flex;
  align-items: center;
}
.paylogo--visa {
  font-style: italic;
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: -0.02em;
  color: #1a1f71;
}
.paylogo--mc {
  width: 1.875rem;
  height: 1.25rem;
}
.paylogo--apay {
  gap: 0.0625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #000;
}
.paylogo--apay svg {
  width: 0.75rem;
  height: 0.9375rem;
  margin-right: 0.0625rem;
}

.agree {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.agree__box {
  flex-shrink: 0;
  width: 1.375rem;
  height: 1.375rem;
  margin-top: 0.0625rem;
  border-radius: 0.375rem;
  border: 2px solid hsl(214, 16%, 78%);
  appearance: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.agree__box:checked {
  background: hsl(221, 83%, 53%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4 10-10'/%3E%3C/svg%3E") center/0.875rem no-repeat;
  border-color: hsl(221, 83%, 53%);
}
.agree__text {
  font-size: 0.9375rem;
  line-height: 1.58;
  color: hsl(212, 16%, 30%);
}
.agree__text a {
  color: hsl(221, 83%, 50%);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  font-weight: 500;
}

.checkout__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  height: 3.5rem;
  margin-top: 1.75rem;
  border-radius: 0.5rem;
  background: hsl(221, 83%, 53%);
  color: hsl(0, 0%, 100%);
  font-size: 1rem;
  font-weight: 500;
  transition: filter 0.18s ease, transform 0.18s ease;
}
.checkout__submit:hover {
  filter: brightness(0.96);
}
.checkout__submit:active {
  transform: translateY(1px);
}
.checkout__submit-icon {
  display: inline-flex;
}
.checkout__submit-icon .c-icon {
  width: 1.625rem;
  height: 1.625rem;
}
.checkout__submit-icon--coupon {
  display: none;
  order: -1;
}

.checkout__assurance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.125rem 0 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: hsl(212, 20%, 24%);
}
.checkout__assurance .c-icon {
  width: 1.125rem;
  height: 1.125rem;
  color: hsl(212, 30%, 35%);
}

.checkout__note {
  margin-top: 1.5rem;
  padding: 1.125rem 1rem;
  border-radius: 0.625rem;
  background: #e1eaf4;
}
.checkout__note-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: hsl(221, 83%, 53%);
}
.checkout__note-text {
  margin: 0.625rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.59;
  color: #08417d;
}

.checkout--coupon .checkout__submit-icon--card {
  display: none;
}
.checkout--coupon .checkout__submit-icon--coupon {
  display: inline-flex;
}
.checkout--coupon .checkout__assurance .c-icon {
  display: none;
}

.field__error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(0, 62%, 55%);
}

.iti {
  --iti-hover-color: rgba(35.6745, 98.67565, 234.6255, 0.09);
  --iti-icon-color: hsl(210, 12%, 52%);
  --iti-border-color: hsl(214, 22%, 90%);
  --iti-arrow-size: 6px;
  --iti-arrow-width: 1.6px;
  --iti-spacer-horizontal: 18px;
}

.field--phone .iti {
  display: block;
  width: 100%;
}
.field--phone .iti__tel-input,
.field--phone input {
  width: 100%;
}
.field--phone .iti__selected-country-primary {
  padding-inline: 1.125rem 0.375rem;
  border-start-start-radius: 0.375rem;
  border-end-start-radius: 0.375rem;
  transition: background-color 0.15s ease;
}
.field--phone .iti__arrow {
  transition: transform 0.2s ease;
}
.field--phone .iti__selected-dial-code {
  color: hsl(0, 0%, 4%);
  font-weight: 500;
  font-size: 0.9375rem;
  padding-inline-end: 0.625rem;
  border-inline-end: 1px solid hsl(214, 22%, 90%);
}
.field--phone {
  --iti-strict-reject-flash-color: rgba(219.3, 86.7, 86.7, 0.14);
}
.field--phone.is-invalid .field__input {
  box-shadow: 0 6px 18px -12px hsla(212, 60%, 25%, 0.16), 0 0 0 2px hsl(0, 65%, 62%);
}

.iti__country-selector {
  --iti-country-selector-bg: hsl(0, 0%, 100%);
  border-radius: 1rem;
  overflow: hidden;
}

.iti__search-input-wrapper {
  margin: 0.625rem;
  border-bottom: 0;
  border-radius: 0.75rem;
  background: hsl(220, 16%, 96%);
  transition: box-shadow 0.15s ease;
}
.iti__search-input-wrapper:focus-within {
  box-shadow: 0 0 0 2px rgba(35.6745, 98.67565, 234.6255, 0.45);
}

.iti__search-input {
  font-size: 0.9375rem;
  padding-block: 0.75rem;
  border-radius: 0.75rem;
  color: hsl(0, 0%, 4%);
  background: transparent;
}
.iti__search-input:focus {
  outline: none;
}
.iti__search-input::placeholder {
  color: hsl(210, 12%, 58%);
}

.iti__search-clear {
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.iti__country {
  padding-block: 0.75rem;
  transition: background-color 0.12s ease;
}

.iti__country-name {
  color: hsl(212, 18%, 24%);
}

.iti__country-check {
  color: hsl(221, 83%, 53%);
}

.iti__country-list {
  scrollbar-width: thin;
  scrollbar-color: hsl(214, 14%, 80%) transparent;
}
.iti__country-list::-webkit-scrollbar {
  width: 10px;
}
.iti__country-list::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
  background-color: hsl(214, 14%, 82%);
}

.iti--inline-country-selector .iti__country-selector {
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 18px 44px -14px hsla(212, 55%, 22%, 0.4);
  transform-origin: top;
  animation: iti-pop 0.16s ease-out;
}
.iti--inline-country-selector .iti__country-selector .iti__country-list {
  max-height: 17.5rem;
}

@media (max-width: 500px) {
  .iti__search-input {
    padding-block: 0.9375rem;
  }
  .iti__country {
    padding-block: 0.875rem;
  }
}
@keyframes iti-pop {
  from {
    opacity: 0;
    transform: translateY(-0.375rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .iti--inline-country-selector .iti__country-selector {
    animation: none;
  }
}
