:root {
  --rb-green: #527465;
  --rb-green-deep: #30483e;
  --rb-rose: #a36c72;
  --rb-rose-deep: #87565d;
  --rb-rose-soft: #eadbdd;
  --rb-stone: #f0ece5;
  --rb-paper: #faf8f4;
  --rb-muted: #6e7770;
  --rb-line: rgba(82, 116, 101, .2);
}

body.rb-commerce-checkout,
body.rb-commerce-cart,
body.rb-commerce-account {
  background: var(--rb-paper);
  color: var(--rb-green-deep);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rb-commerce-checkout .wp-site-blocks > header,
.rb-commerce-checkout .wp-site-blocks > footer {
  display: none;
}

.rb-checkout-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 18px clamp(22px, 5vw, 74px);
  border-bottom: 1px solid var(--rb-line);
  background: rgba(250, 248, 244, .96);
}

.rb-checkout-logo { display: block; width: clamp(142px, 16vw, 198px); }
.rb-checkout-logo img { display: block; width: 100%; height: auto; }
.rb-checkout-secure { display: flex; align-items: center; gap: 9px; color: var(--rb-green); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.rb-checkout-secure > span:last-child { display: grid; gap: 2px; }
.rb-checkout-secure small { color: var(--rb-muted); font-size: 8px; font-weight: 600; letter-spacing: .06em; }

.rb-commerce-checkout .wp-site-blocks { padding: 0 clamp(18px, 5vw, 72px) 110px; }
.rb-commerce-checkout main[data-block-name="woocommerce/page-content-wrapper"] { max-width: 1240px; margin: 0 auto !important; padding: 0; }
.rb-commerce-checkout .wp-block-post-title { display: none; }
.rb-commerce-checkout .wp-block-woocommerce-checkout { max-width: 1240px !important; margin: 0 auto !important; }

.rb-checkout-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(760px, calc(100% - 36px));
  margin: 34px auto 48px;
}

.rb-checkout-progress::before {
  position: absolute;
  top: 17px;
  right: 12.5%;
  left: 12.5%;
  height: 1px;
  background: var(--rb-line);
  content: "";
}

.rb-checkout-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--rb-muted);
  text-decoration: none;
}

button.rb-checkout-step {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.rb-checkout-step > span {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--rb-line);
  border-radius: 50%;
  background: var(--rb-paper);
  font-size: 11px;
  font-weight: 800;
}

.rb-checkout-step > small { font-size: 9px; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.rb-checkout-step.is-complete { color: var(--rb-green-deep); }
.rb-checkout-step.is-active { color: var(--rb-rose-deep); }
.rb-checkout-step.is-complete > span { border-color: var(--rb-green); background: var(--rb-green); color: var(--rb-paper); }
.rb-checkout-step.is-active > span { border-color: var(--rb-rose); background: var(--rb-rose); color: var(--rb-paper); box-shadow: 0 0 0 5px rgba(163, 108, 114, .13); }
.rb-checkout-step:focus-visible { outline: 2px solid var(--rb-rose); outline-offset: 7px; }

.rb-commerce-checkout .wc-block-checkout__main { padding-right: clamp(20px, 4vw, 58px); }
.rb-commerce-checkout .wc-block-checkout__sidebar { top: 28px; }
.rb-commerce-checkout .wc-block-components-title.wc-block-components-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 2.5vw, 34px); font-weight: 400; letter-spacing: -.02em; }
.rb-commerce-checkout .wc-block-components-checkout-step { margin-bottom: 26px; padding: 24px; border: 1px solid var(--rb-line); background: #fff; }
.rb-commerce-checkout .wc-block-components-checkout-step__heading { margin-bottom: 20px; }
.rb-commerce-checkout .wc-block-components-checkout-step__description { color: var(--rb-muted); font-size: 12px; }
.rb-commerce-checkout .wc-block-components-text-input input,
.rb-commerce-checkout .wc-block-components-combobox .components-combobox-control__input,
.rb-commerce-checkout .wc-block-components-textarea {
  min-height: 54px;
  border: 1px solid rgba(82, 116, 101, .34) !important;
  border-radius: 0 !important;
  background: var(--rb-paper) !important;
  color: var(--rb-green-deep) !important;
}
.rb-commerce-checkout input:focus,
.rb-commerce-checkout select:focus,
.rb-commerce-checkout textarea:focus { outline: 2px solid var(--rb-rose) !important; outline-offset: 1px; }
.rb-commerce-checkout .wc-block-components-radio-control__option { border-color: var(--rb-line); }
.rb-commerce-checkout .wc-block-components-radio-control__option-checked { background: rgba(82, 116, 101, .06); }
.rb-commerce-checkout .wc-block-components-order-summary,
.rb-commerce-checkout .wp-block-woocommerce-checkout-order-summary-block { border: 1px solid var(--rb-line); background: #fff; }
.rb-commerce-checkout .wc-block-components-order-summary__button-text,
.rb-commerce-checkout .wc-block-components-totals-item__label { color: var(--rb-green-deep); }
.rb-commerce-checkout .wc-block-components-button,
.rb-commerce-checkout .wc-block-components-checkout-place-order-button {
  min-height: 58px;
  border: 0;
  border-radius: 0;
  background: var(--rb-rose) !important;
  color: var(--rb-paper) !important;
  font-weight: 750;
}
.rb-commerce-checkout .wc-block-components-button:hover,
.rb-commerce-checkout .wc-block-components-checkout-place-order-button:hover { background: var(--rb-rose-deep) !important; }
.rb-commerce-checkout .wc-block-components-notice-banner { border-radius: 0; }

.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__billing-fields,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__shipping-option,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__payment-method,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__order-notes,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__terms,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__actions,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__contact-fields,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__payment-method,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__order-notes,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__terms,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__actions { display: none !important; }

.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__contact-fields {
  margin-bottom: 0;
  padding-bottom: 12px;
  border-bottom: 0;
}

.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__shipping-fields {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__shipping-fields .wc-block-components-checkout-step__heading,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__shipping-fields .wc-block-components-address-card,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__shipping-fields .wc-block-checkout__use-address-for-billing,
.rb-checkout-ready.rb-checkout-contact #shipping > :not(.wc-block-components-address-form__first_name):not(.wc-block-components-address-form__last_name):not(.wc-block-components-address-form__phone):not(:has(#shipping-first_name)):not(:has(#shipping-last_name)):not(:has(#shipping-phone)),
.rb-checkout-ready.rb-checkout-delivery #shipping > .wc-block-components-address-form__first_name,
.rb-checkout-ready.rb-checkout-delivery #shipping > .wc-block-components-address-form__last_name,
.rb-checkout-ready.rb-checkout-delivery #shipping > .wc-block-components-address-form__phone,
.rb-checkout-ready.rb-checkout-delivery #shipping > :has(#shipping-first_name),
.rb-checkout-ready.rb-checkout-delivery #shipping > :has(#shipping-last_name),
.rb-checkout-ready.rb-checkout-delivery #shipping > :has(#shipping-phone) { display: none !important; }

/* Woo can briefly collapse this animated wrapper while an address field gains
   focus. The stepper owns visibility, so keep the mounted form interactive. */
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__shipping-fields .wc-block-components-address-form-wrapper,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__shipping-fields .wc-block-components-address-form-wrapper {
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__contact-fields,
.rb-checkout-ready.rb-checkout-contact .wc-block-checkout__shipping-fields,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__shipping-fields,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__billing-fields,
.rb-checkout-ready.rb-checkout-delivery .wc-block-checkout__shipping-option,
.rb-checkout-ready.rb-checkout-payment .wc-block-checkout__payment-method {
  animation: none;
}

.rb-checkout-ready.rb-checkout-payment .wc-block-checkout__contact-fields,
.rb-checkout-ready.rb-checkout-payment .wc-block-checkout__shipping-fields,
.rb-checkout-ready.rb-checkout-payment .wc-block-checkout__billing-fields,
.rb-checkout-ready.rb-checkout-payment .wc-block-checkout__shipping-option { display: none !important; }

.rb-checkout-navigation {
  display: flex;
  width: min(1240px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 28px auto 0;
  padding: 22px 0;
  border-top: 1px solid var(--rb-line);
}
.rb-checkout-navigation button,
.rb-checkout-navigation a { min-height: 52px; padding: 0 24px; border: 0; background: transparent; color: var(--rb-green-deep); font: inherit; font-size: 12px; font-weight: 750; text-decoration: none; cursor: pointer; }
.rb-checkout-navigation .rb-checkout-next { display: inline-flex; min-width: min(340px, 100%); align-items: center; justify-content: space-between; gap: 28px; background: var(--rb-rose); color: var(--rb-paper); }
.rb-checkout-navigation .rb-checkout-next:hover { background: var(--rb-rose-deep); }
.rb-checkout-navigation .rb-checkout-back { padding-inline: 0; }
.rb-checkout-navigation .rb-checkout-back:hover { color: var(--rb-rose); }
.rb-checkout-navigation .rb-checkout-error { flex: 1 1 100%; margin: 0; color: #963d46; font-size: 12px; text-align: right; }
.rb-checkout-payment .rb-checkout-next { display: none; }

@keyframes rb-checkout-step-in {
  from { opacity: .35; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rb-commerce-cart .woocommerce,
.rb-commerce-account .woocommerce { width: min(1100px, 100%); margin: 40px auto 100px; }
.rb-commerce-cart .woocommerce form,
.rb-commerce-cart .woocommerce-cart-form,
.rb-commerce-cart .cart_totals,
.rb-commerce-account .woocommerce form,
.rb-commerce-account .woocommerce-MyAccount-content { padding: 24px; border: 1px solid var(--rb-line); background: #fff; }
.rb-commerce-cart .button,
.rb-commerce-account .button { border-radius: 0 !important; background: var(--rb-green) !important; color: var(--rb-paper) !important; }

@media (max-width: 780px) {
  .rb-checkout-header { min-height: 76px; padding: 14px 18px; }
  .rb-checkout-logo { width: 142px; }
  .rb-checkout-secure small { display: none; }
  .rb-commerce-checkout .wp-site-blocks { padding: 0 14px 80px; }
  .rb-checkout-progress { margin: 26px auto 36px; }
  .rb-checkout-step > small { max-width: 80px; line-height: 1.25; }
  .rb-commerce-checkout .wc-block-checkout__main { padding-right: 0; }
  .rb-commerce-checkout .wc-block-components-checkout-step { padding: 20px 16px; }
  .rb-checkout-navigation { display: grid; }
  .rb-checkout-navigation .rb-checkout-next { width: 100%; order: -1; }
  .rb-checkout-navigation .rb-checkout-error { order: -2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .rb-commerce-checkout *, .rb-checkout-navigation * { scroll-behavior: auto !important; transition: none !important; }
}
