.checkout-overlay[hidden] {
  display: none;
}

.checkout-overlay,
.checkout-page {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow-y: auto;
  color: var(--text-primary);
  background: #fff;
}

.checkout-page {
  position: relative;
  inset: auto;
  z-index: auto;
  overflow: visible;
  min-height: 100vh;
}

body.checkout-open {
  overflow: hidden;
}

.checkout-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--navbar-height);
  border: 0;
  background: #fff;
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(14px);
  transition: transform 0.3s ease;
}

.checkout-header.checkout-header--hidden {
  transform: translateY(calc(-1 * var(--navbar-height)));
}

.checkout-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: var(--sp-s);
}

.checkout-header__logo {
  display: inline-flex;
  width: 48px;
  height: 48px;
}

.checkout-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.checkout-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
}

.checkout-header__lang {
  border-color: var(--border);
  color: var(--text-primary);
}

.checkout-header__lang .lang-chevron {
  filter: none;
}

.checkout-icon-button {
  position: relative;
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.checkout-icon-button:hover {
  border-color: var(--text-secondary);
  background: var(--bg);
}

.checkout-icon-button img {
  width: 20px;
  height: 20px;
}

.checkout-tooltip {
  position: absolute;
  top: calc(100% + var(--sp-xs));
  right: 0;
  z-index: 1;
  width: max-content;
  max-width: min(240px, calc(100vw - (2 * var(--sp-s))));
  padding: var(--sp-xs) var(--sp-s);
  border-radius: var(--radius-s);
  color: var(--text-on-dark-primary);
  background: var(--surface-inverse);
  font: 500 var(--label-s-size) / var(--label-s-line-height) var(--font-label);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.checkout-icon-button:hover .checkout-tooltip,
.checkout-icon-button:focus-visible .checkout-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.checkout-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1248px;
  margin: 0 auto;
  padding: 30px 0 0;
}

.checkout-progress__step {
  padding: 0;
  color: var(--text-secondary);
  font-family: var(--font-label);
  font-size: var(--label-s-size);
  font-weight: 500;
  line-height: var(--label-s-line-height);
}

.checkout-progress__separator {
  color: var(--text-secondary);
  font: 400 18px/1 var(--font-label);
}

.checkout-progress__step--active {
  color: var(--text-primary);
}

.checkout-progress__step--done {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: var(--sp-xxs);
}

.checkout-progress__step--active {
  color: var(--brand);
  font-weight: 700;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--sp-xl);
  width: min(1248px, calc(100% - 48px));
  margin: 0 auto;
  padding: var(--sp-l) 0;
}

.checkout-main {
  min-width: 0;
}

.checkout-layout--result {
  grid-template-columns: minmax(0, 1fr);
}

.checkout-title {
  margin: 0 0 12px;
  color: var(--text-primary);
  font-family: var(--font-label);
  font-size: var(--label-xl-size);
  font-weight: 600;
  line-height: var(--label-xl-line-height);
}

.checkout-title--payment {
  margin-bottom: 0;
  padding-bottom: 40px;
}

.checkout-lead {
  margin: 0 0 40px;
  color: var(--text-secondary);
  font: 400 16px/1.6 var(--font-label);
}

.checkout-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 160px;
  color: var(--text-secondary);
  font: 500 15px/1.5 var(--font-label);
}

.checkout-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: checkout-spin 0.8s linear infinite;
}

@keyframes checkout-spin {
  to { transform: rotate(360deg); }
}

.checkout-form {
  display: grid;
  gap: var(--sp-l);
}

.checkout-form[hidden],
.checkout-payment[hidden],
.checkout-result[hidden],
.checkout-loading[hidden],
.checkout-company-fields[hidden] {
  display: none;
}

.checkout-section {
  padding: 0 0 var(--sp-l);
  border-bottom: 1px solid var(--border);
}

.checkout-section__title {
  margin: 0 0 var(--sp-m);
  color: var(--text-primary);
  font-family: var(--font-label);
  font-size: var(--label-l-size);
  font-weight: 600;
  line-height: var(--label-l-line-height);
}

.checkout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-m);
}

.checkout-field--wide,
.checkout-company-fields {
  grid-column: 1 / -1;
}

.checkout-company-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-m);
}

.checkout-field {
  display: grid;
  gap: var(--sp-xxs);
}

.checkout-field label {
  color: var(--text-primary);
  font: 600 16px/1.5 var(--font-label);
}

.checkout-field label span {
  color: var(--text-primary);
}

.checkout-field label > span[aria-hidden='true'],
.checkout-check [aria-hidden='true'] {
  color: var(--alert);
}

.checkout-field input,
.checkout-field select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #d8d1ce;
  border-radius: var(--radius-s);
  outline: none;
  color: var(--text-primary);
  background: #fff;
  font: 400 16px/1.4 var(--font-label);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.checkout-field input:focus,
.checkout-field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(111, 66, 63, 0.12);
}

.checkout-field select {
  min-height: 48px;
  height: 48px;
  padding: 12px 48px 12px var(--sp-s);
  border-color: var(--border);
  appearance: none;
  cursor: pointer;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M8.02051 10.0104C8.91239 11.7941 9.80427 12.7783 11.413 13.6797C11.7772 13.8838 12.2224 13.8838 12.5866 13.6797C14.1953 12.7783 15.0872 11.7941 15.9791 10.0104' stroke='%23332E2C' stroke-width='1.43' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-s) center;
  background-size: 20px 20px;
  font: 400 16px/22px var(--font-label);
}

.checkout-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-primary);
  font: 400 16px/1.5 var(--font-label);
}

.checkout-check input {
  flex: 0 0 auto;
  display: grid;
  width: 24px;
  height: 24px;
  margin: 0;
  appearance: none;
  place-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.checkout-check input:checked {
  border-color: var(--brand);
  background: var(--brand);
}

.checkout-check input:checked::after {
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  content: '';
  transform: rotate(-45deg);
}

.checkout-check input:focus-visible {
  outline: 3px solid rgba(111, 66, 63, 0.18);
  outline-offset: 2px;
}

.checkout-check a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.checkout-consent {
  display: grid;
  gap: 14px;
}

.checkout-alert {
  padding: 14px 16px;
  border: 1px solid #e2bbb6;
  border-radius: var(--radius-s);
  color: #7f2e25;
  background: #fff5f3;
  font: 500 14px/1.5 var(--font-label);
}

.checkout-alert[hidden] {
  display: none;
}

.checkout-submit.btn-primary {
  display: inline-flex;
  width: auto;
  min-height: 52px;
  gap: 10px;
  justify-self: start;
  padding: 14px 24px;
}

.checkout-submit-bar {
  display: flex;
  justify-content: flex-start;
}

.checkout-submit__price {
  display: none;
}

.checkout-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.checkout-summary {
  position: sticky;
  top: var(--sp-m);
  align-self: start;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-m);
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  transition: top 0.3s ease;
}

.checkout-header:not(.checkout-header--hidden) ~ .checkout-layout .checkout-summary {
  top: calc(var(--navbar-height) + var(--sp-m));
}

.checkout-summary__image {
  display: block;
  width: 92px;
  height: 92px;
  border-radius: var(--radius-s);
  object-fit: cover;
  background: var(--bg);
}

.checkout-summary__body {
  display: grid;
  gap: 0;
  padding: var(--sp-m) var(--sp-m) 0;
}

.checkout-summary__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: var(--sp-s);
  padding-bottom: var(--sp-m);
  border-bottom: 1px solid var(--border);
}

.checkout-summary__title {
  margin: 0;
  font: 700 20px/28px var(--font-label);
}

.checkout-summary__location,
.checkout-summary__meta {
  margin: var(--sp-xxs) 0 0;
  color: var(--text-secondary);
  font: 400 14px/1.5 var(--font-label);
}

.checkout-summary__stay {
  display: grid;
  gap: 0;
  padding: var(--sp-m) 0;
}

.checkout-summary__stay .checkout-summary__row,
.checkout-summary__prices .checkout-summary__row {
  font: 400 16px/1.5 var(--font-label);
}

.checkout-summary__stay .checkout-summary__row > span,
.checkout-summary__prices .checkout-summary__row > span {
  color: var(--text-secondary);
}

.checkout-summary__stay .checkout-summary__row strong,
.checkout-summary__prices .checkout-summary__row strong {
  font-weight: 400;
}

.checkout-summary__row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-s);
  font: 500 14px/1.5 var(--font-label);
}

.checkout-summary__row[hidden] {
  display: none;
}

.checkout-summary__row strong {
  font-weight: 700;
  text-align: right;
}

.checkout-summary__costs {
  margin: 0 calc(-1 * var(--sp-m));
  background: var(--bg);
}

.checkout-summary__prices {
  position: relative;
  display: grid;
  gap: 0;
  padding: var(--sp-m);
}

.checkout-summary__prices::after {
  position: absolute;
  right: var(--sp-m);
  bottom: 0;
  left: var(--sp-m);
  height: 1px;
  background: var(--border);
  content: '';
}

.checkout-summary__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-s);
  padding: var(--sp-m);
  border-top: 0;
  color: var(--text-primary);
  font: 700 20px/28px var(--font-label);
  transition: color 160ms ease, opacity 160ms ease;
}

.checkout-summary__total strong {
  font-weight: inherit;
}

.checkout-summary__total--disabled {
  opacity: 1;
}

.checkout-payment {
  display: grid;
  gap: var(--sp-m);
}

.checkout-payment__loading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-s);
  min-height: 240px;
  color: var(--text-secondary);
  font: 500 var(--body-m-size) / var(--body-m-line-height) var(--font-label);
}

.checkout-payment__skeleton {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--sp-s);
  width: 100%;
  padding: var(--sp-m);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: #fff;
}

.checkout-payment__skeleton i {
  display: block;
  height: var(--sp-m);
  border-radius: var(--radius-s);
  background: linear-gradient(90deg, var(--bg) 20%, #fff 50%, var(--bg) 80%);
  background-size: 200% 100%;
  animation: checkout-skeleton 1.4s ease-in-out infinite;
}

.checkout-payment__skeleton i:nth-child(2) {
  width: 72%;
}

.checkout-payment__skeleton i:nth-child(3) {
  width: 48%;
}

@keyframes checkout-skeleton {
  to { background-position: -200% 0; }
}

.checkout-payment__notice {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg);
  font: 500 14px/1.55 var(--font-label);
}

.checkout-payment rw-booking-payment {
  display: block;
  width: 100%;
  color: var(--text-primary);
  font-family: var(--font-label);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line-height);
}

#checkout-payment-widget rw-booking-payment .rw-payment-method {
  padding: var(--sp-m);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: #fff;
}

#checkout-payment-widget rw-booking-payment .rw-payment-method > label {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-label);
  font-size: var(--body-m-size);
  font-weight: 600;
  line-height: var(--body-m-line-height);
}

#checkout-payment-widget rw-booking-payment .rw-payment-method input[type='radio'] {
  flex: 0 0 auto;
  width: var(--sp-m);
  height: var(--sp-m);
  margin: 0;
  accent-color: var(--brand);
}

#checkout-payment-widget rw-booking-payment .rw-payment-method > label > img {
  width: auto;
  max-width: 112px;
  height: var(--sp-l);
  max-height: var(--sp-l);
  margin-left: auto;
  object-fit: contain;
}

#checkout-payment-widget rw-booking-payment .rw-payment-form-container {
  margin-top: var(--sp-m);
  padding-top: var(--sp-m);
  border-top: 1px solid var(--border);
}

#checkout-payment-widget rw-booking-payment #paypal-button-container {
  width: 100%;
}

.checkout-payment__error {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--alert);
  border-radius: var(--radius-s);
  color: var(--alert);
  background: #fff5f3;
  font: 400 16px/1.5 var(--font-label);
}

.checkout-result {
  display: grid;
  width: 100%;
  gap: var(--sp-s);
  padding: var(--sp-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: transparent;
  justify-items: center;
  text-align: center;
}

.checkout-result__mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
}

.checkout-result__mark--success {
  background: var(--success);
}

.checkout-result__mark--alert {
  background: var(--alert);
}

.checkout-result__mark img {
  width: var(--sp-m);
  height: var(--sp-m);
  filter: brightness(0) invert(1);
}

.checkout-result__content {
  display: grid;
  width: 100%;
  gap: var(--sp-xs);
  justify-items: center;
}

.checkout-result h2,
.checkout-result p {
  margin: 0;
}

.checkout-result__reference {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
}

.checkout-result__email {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
}

.checkout-result h2 {
  color: var(--text-primary);
  font-family: var(--font-label);
  font-size: var(--label-l-size);
  font-weight: 600;
  line-height: var(--label-l-line-height);
}

.checkout-result p {
  color: var(--text-secondary);
  font-family: var(--font-label);
  font-size: var(--body-m-size);
  font-weight: 400;
  line-height: var(--body-m-line-height);
}

@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .checkout-summary {
    position: static;
    grid-row: 1;
  }

  .checkout-main {
    grid-row: 2;
  }
}

@media (max-width: 600px) {
  .checkout-header {
    height: var(--navbar-height);
  }

  .checkout-progress {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px var(--sp-s) 0;
  }

  .checkout-layout {
    width: calc(100% - 32px);
    padding: 30px 0 120px;
  }

  .checkout-main {
    grid-row: 1;
  }

  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-field--wide,
  .checkout-company-fields {
    grid-column: auto;
  }

  .checkout-company-fields {
    grid-template-columns: 1fr;
  }

  .checkout-lead {
    margin-bottom: 30px;
  }

  .checkout-summary {
    display: none;
  }

  .checkout-submit-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 150;
    align-items: center;
    justify-content: stretch;
    padding: var(--sp-m) var(--sp-m) max(var(--sp-m), env(safe-area-inset-bottom));
    background: transparent;
    border: 0;
  }

  .checkout-submit.btn-primary {
    width: 100%;
    max-width: none;
    min-height: 48px;
    justify-self: stretch;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(51, 46, 44, 0.18);
  }

  .checkout-submit__price:not([hidden]) {
    display: inline;
  }
}
