/* ToBePolo checkout / cart / thank-you / mie esperienze. Auth freeze: never login/registrazione. */

html body.woocommerce-checkout:not(.login):not(.registrazione) #main,
html body.woocommerce-cart:not(.login):not(.registrazione) #main,
html body.woocommerce-order-received:not(.login):not(.registrazione) #main,
html body.woocommerce-account.tbp-flow-orders #main,
html body.woocommerce-view-order #main {
  padding: 8px 12px 24px;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #main #content > .row,
html body.woocommerce-cart:not(.login):not(.registrazione) #main #content > .row,
html body.woocommerce-order-received:not(.login):not(.registrazione) #main #content > .row {
  max-width: 480px !important;
  margin: 0 auto 16px !important;
  padding: 8px 12px 16px !important;
  background: #fff;
  border-radius: 16px;
}

html body.woocommerce-checkout .shop_table thead,
html body.woocommerce-checkout .shop_table .variation,
html body.woocommerce-checkout .shop_table .wc-item-meta,
html body.woocommerce-checkout td.product-name dl,
html body.woocommerce-checkout #order_review thead,
html body.woocommerce-checkout #order_review .wc-item-meta,
html body.woocommerce-checkout #order_review dl.variation,
html body.woocommerce-checkout #order_review .cart_item td.product-total {
  display: none !important;
}

html body.woocommerce-checkout .tbp-flow-hero,
html body.woocommerce-checkout .tbp-exp-card-scope,
html body.woocommerce-checkout .tbp-exp-card--checkout,
html body.woocommerce-cart .tbp-flow-hero,
html body.woocommerce-checkout .cart_item td.product-total,
html body.woocommerce-checkout .cart_item .woocommerce-Price-amount {
  display: none !important;
}

html body.woocommerce-checkout .woocommerce-form-login-toggle,
html body.woocommerce-checkout .woocommerce-form-coupon-toggle,
html body.woocommerce-checkout:not(.woocommerce-order-received) form.woocommerce-form-login,
html body.woocommerce-checkout form.checkout_coupon,
html body.woocommerce-checkout .create-account,
html body.woocommerce-checkout .woocommerce-account-fields,
html body.woocommerce-checkout #accettazione_no_recesso_field,
html body.woocommerce-checkout .tbp-checkout-fornitore,
html body.woocommerce-checkout .facebook-login,
html body.woocommerce-checkout .tbp-social-buttons {
  display: none !important;
}

html body.woocommerce-checkout .tbp-flow-address {
  display: none;
}

html body.woocommerce-checkout .tbp-checkout-company {
  display: none;
}

html body.woocommerce-checkout:has([name="tbp_need_invoice"]:checked) .tbp-checkout-company {
  display: block;
}

.tbp-flow-signin {
  margin: 0 0 12px;
  color: var(--tbp-muted, #5d786b);
  font-size: 0.88rem;
  line-height: 1.4;
}

.tbp-flow-signin a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--tbp-green, #084828);
  font-weight: 700;
  text-decoration: underline;
}

/* Steps */
body.tbp-flow--dati .tbp-flow-back {
  display: none;
}

/* Keep the pay panel measurable so Stripe can mount. display:none collapses the card field. */
body.tbp-flow--dati .tbp-flow-panel--paga,
body.tbp-flow--dati form.checkout > .row > .large-5 {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 100%;
  max-width: 480px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

body.tbp-flow--paga .tbp-flow-panel--dati,
body.tbp-flow--paga #customer_details,
body.tbp-flow--paga .tbp-flow-next,
body.tbp-flow--paga .tbp-flow-dati-error,
body.tbp-flow--paga .tbp-flow-panel__lede,
body.tbp-flow--paga form.checkout > .row > .large-7 {
  display: none;
}

.tbp-flow-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}

html body.woocommerce-checkout .tbp-flow-progress button {
  min-height: 48px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--tbp-line, #e6ede8);
  border-radius: 16px;
  background: #fff !important;
  color: var(--tbp-green, #084828) !important;
  font-size: 0.94rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  transition: transform 160ms cubic-bezier(.22, 1, .36, 1), background-color 160ms;
}

html body.woocommerce-checkout .tbp-flow-progress button[aria-current="step"] {
  background: var(--tbp-green, #084828) !important;
  color: #fff !important;
}

html body.woocommerce-checkout .tbp-flow-progress button:not([aria-current]):hover {
  background: var(--tbp-sage, #f4f7f5) !important;
}

html body.woocommerce-checkout .tbp-flow-progress button:not(.tbp-pressable):active,
html body.woocommerce-checkout .tbp-flow-next:not(.tbp-pressable):active {
  transform: translateY(1px) scale(.97);
}

html body.woocommerce-checkout .tbp-flow-progress button:focus-visible,
html body.woocommerce-checkout #payment input.input-radio:focus-visible + label {
  outline: 2px solid var(--tbp-green, #084828);
  outline-offset: 3px;
}

body.tbp-flow--dati .woocommerce-billing-fields > h3,
body.tbp-flow .tbp-flow-panel--dati .woocommerce-billing-fields > h3 {
  display: none;
}

.tbp-flow-layout {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}

.tbp-flow-panel__title,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-additional-fields h3 {
  margin: 0 0 8px;
  padding: 0;
  color: var(--tbp-green, #084828);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.02em;
}

.tbp-flow-panel__lede,
.tbp-flow-dati-error {
  margin: 0 0 12px;
  color: var(--tbp-muted, #5d786b);
  font-size: 0.88rem;
  line-height: 1.4;
}

.tbp-flow-dati-error:not([hidden]) {
  color: var(--tbp-red, #D0161A);
}

html body.woocommerce-checkout form.checkout .tbp-flow-panel--dati input[data-tbp-field-invalid="true"] {
  border-color: var(--tbp-red, #D0161A) !important;
}

.tbp-flow-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tbp-green, #084828);
  font-weight: 700;
  cursor: pointer;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #customer_details {
  max-width: none;
  margin: 0;
}

@media (max-width: 849px) {
  html body.woocommerce-checkout #customer_details .woocommerce-billing-fields__field-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }

  html body.woocommerce-checkout #customer_details .form-row {
    grid-column: 1 / -1;
    width: 100% !important;
    min-width: 0;
  }

  html body.woocommerce-checkout #customer_details #billing_first_name_field,
  html body.woocommerce-checkout #customer_details #billing_last_name_field {
    grid-column: auto;
  }
}

html body.woocommerce-checkout:not(.login):not(.registrazione) .large-5,
html body.woocommerce-checkout:not(.login):not(.registrazione) .large-7 {
  width: 100%;
  max-width: none;
  flex-basis: 100%;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #checkout-timer {
  max-width: 480px;
  margin: 0 auto 8px;
  padding: 0 4px;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #checkout-timer .box {
  max-width: none;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #checkout-timer .box p {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--tbp-sage, #f4f7f5);
  color: var(--tbp-green, #084828);
  font-size: 0.88rem;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #tbp-timer {
  color: var(--tbp-green, #084828) !important;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) form:not(#adminbarsearch) #customer_details input,
html body.woocommerce-checkout:not(.login):not(.registrazione) form:not(#adminbarsearch) #customer_details select,
html body.woocommerce-checkout:not(.login):not(.registrazione) form:not(#adminbarsearch) #customer_details textarea {
  border: 0 !important;
  border-radius: 16px !important;
  background: var(--tbp-sage, #f4f7f5) !important;
  padding: 12px 16px !important;
}

html body.woocommerce-checkout .woocommerce-additional-fields,
html body.woocommerce-checkout .woocommerce-additional-fields-wrapper,
html body.woocommerce-checkout #order_comments_field {
  display: none !important;
}

html body.woocommerce-checkout .fl-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 0 !important;
  min-height: 0 !important;
}

html body.woocommerce-checkout .fl-wrap .fl-label,
html body.woocommerce-checkout .fl-wrap label {
  position: static !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 4px !important;
  overflow: visible !important;
  font-size: 0.8rem !important;
  font-weight: 700;
  line-height: 1.2 !important;
  color: var(--tbp-green, #084828) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: transparent !important;
}

html body.woocommerce-checkout .fl-wrap .fl-input::placeholder,
html body.woocommerce-checkout .fl-wrap textarea::placeholder,
html body.woocommerce-checkout .fl-wrap .input-text::placeholder {
  color: transparent !important;
}

html body.woocommerce-checkout .tbp-customer-fiscal {
  margin: 8px 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

html body.woocommerce-checkout .tbp-customer-fiscal__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--tbp-green, #084828);
  font-weight: 700;
}

html body.woocommerce-checkout .tbp-customer-fiscal__piva[hidden] {
  display: none !important;
}

html body.woocommerce-checkout .tbp-customer-fiscal__piva {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

html body.woocommerce-checkout .woocommerce-checkout-review-order-table,
html body.woocommerce-checkout .shop_table {
  border: 0;
  margin: 0 0 12px;
}

html body.woocommerce-checkout .shop_table th,
html body.woocommerce-checkout .shop_table td {
  border: 0;
  padding: 8px 0;
  background: transparent;
}

html body.woocommerce-checkout .tbp-checkout-esperienza-item__link,
html body.woocommerce-checkout .tbp-flow-card__link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

html body.woocommerce-checkout .tbp-checkout-esperienza-item__thumb img,
html body.woocommerce-checkout .tbp-flow-card__thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

html body.woocommerce-checkout .tbp-checkout-esperienza-item__title,
html body.woocommerce-checkout .tbp-flow-card__title {
  display: block;
  color: var(--tbp-green, #084828);
  font-size: 1rem;
  font-weight: 800;
}

.tbp-flow-card__facts,
.tbp-checkout-esperienza-item .tbp-flow-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  color: var(--tbp-muted, #5d786b);
  font-size: 0.86rem;
}

html body.woocommerce-checkout .place-order {
  padding: 8px 0 0;
  background: transparent;
}

html body.woocommerce-checkout .tbp-legal-checkbox-row {
  margin: 0 0 4px;
  padding: 4px 0;
}

html body.woocommerce-checkout .tbp-legal-checkbox-row label {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--tbp-muted, #5d786b);
}

html body.woocommerce-checkout .tbp-checkout-fees-note {
  margin: 8px 0 0;
  color: var(--tbp-muted, #5d786b);
  font-size: 0.8rem;
}

/* Optional deliberate swipe; the native Paga button remains the click/keyboard alternative. */
.tbp-swipe-pay {
  --tbp-swipe-x: 0px;
  --tbp-swipe-progress: 0;
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 8px auto 0;
  color: var(--tbp-gold-ink);
}

.tbp-swipe-pay__track[hidden],
.tbp-swipe-pay__status[hidden] { display: none !important; }

.tbp-swipe-pay__track {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 64px;
  box-sizing: border-box;
  padding: 4px;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
  touch-action: pan-y;
  user-select: none;
  pointer-events: none;
}

.tbp-swipe-pay__track::before {
  content: "";
  z-index: -1;
  position: absolute;
  inset: 0;
  background: #b6eacd;
  opacity: var(--tbp-swipe-progress);
  transition: opacity 300ms var(--ease-out);
  pointer-events: none;
}

.tbp-swipe-pay.is-dragging .tbp-swipe-pay__track::before { transition: none; }

/* One surface: the original Woo button remains the native click/keyboard action. */
html body.woocommerce-checkout:not(.login):not(.registrazione) #payment .tbp-swipe-pay.has-swipe #place_order {
  display: block;
  min-height: 64px;
  height: 64px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 20px !important;
  font-size: 0 !important;
  line-height: 1 !important;
  clip-path: none !important;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #payment .tbp-swipe-pay.has-swipe[aria-disabled="true"] #place_order {
  opacity: 1 !important;
  background: #f2e7ba !important;
}

.tbp-swipe-pay.has-swipe:not(.is-ready) #place_order::before,
.tbp-swipe-pay.has-swipe:not(.is-ready) #place_order::after {
  animation: none !important;
  opacity: 0 !important;
}

.tbp-swipe-pay.has-swipe:has(#place_order:active):not(.is-dragging):not([aria-disabled="true"]) .tbp-swipe-pay__track {
  filter: brightness(.94);
}

html body.woocommerce-checkout .tbp-swipe-pay button.tbp-swipe-pay__thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: transparent !important;
  color: var(--tbp-gold-ink) !important;
  font-size: 28px;
  line-height: 1;
  transform: translateX(var(--tbp-swipe-x)) !important;
  transition: transform 300ms var(--ease-out);
  touch-action: pan-y;
  pointer-events: auto;
  cursor: grab;
  opacity: 1 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Only this decorative face invites the gesture. The 56px hitbox stays still. */
.tbp-swipe-pay__face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #fff8df;
  box-shadow: 0 2px 8px rgba(74, 53, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .8);
  pointer-events: none;
}

html body.woocommerce-checkout .tbp-swipe-pay.is-dragging .tbp-swipe-pay__thumb {
  transition: none;
  cursor: grabbing;
}

.tbp-swipe-pay__label,
.tbp-swipe-pay__amount {
  display: block;
  padding: 0 8px 0 64px;
  text-align: center;
  color: var(--tbp-gold-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  pointer-events: none;
}

.tbp-swipe-pay__amount { font-size: 17px; font-weight: 800; }

/* Quando la fascia diventa oro, le scritte del gesto passano al bianco (scelta CTA di Elind). */
.tbp-swipe-pay.has-swipe.is-ready:not(.is-dragging):not(.is-pending):not([aria-disabled="true"]):not([aria-busy="true"]) .tbp-swipe-pay__label,
.tbp-swipe-pay.has-swipe.is-ready:not(.is-dragging):not(.is-pending):not([aria-disabled="true"]):not([aria-busy="true"]) .tbp-swipe-pay__amount,
.tbp-swipe-pay.has-swipe.is-ready:not(.is-dragging):not(.is-pending):not([aria-disabled="true"]):not([aria-busy="true"]) .tbp-swipe-pay__thumb {
  color: var(--tbp-gold-label, #fff);
  text-shadow: var(--tbp-gold-label-shadow, none);
}

.tbp-swipe-pay__arrow { display: block; }
.tbp-swipe-pay.has-swipe.is-ready:not(.is-dragging):not(.is-pending):not([aria-disabled="true"]):not([aria-busy="true"]) .tbp-swipe-pay__face {
  animation: tbp-swipe-invite 1.65s cubic-bezier(.22,1,.36,1) infinite;
}
.tbp-swipe-pay[aria-disabled="true"] .tbp-swipe-pay__thumb { cursor: not-allowed; }
.tbp-swipe-pay.is-pending .tbp-swipe-pay__track { pointer-events: none; }

html body.woocommerce-checkout .tbp-swipe-pay__status {
  margin: 8px 0 0;
  padding: 0;
  color: var(--tbp-ink, #123326);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

@keyframes tbp-swipe-invite {
  0%, 20%, 100% { transform: translateX(0); }
  55% { transform: translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
  html body.woocommerce-checkout .tbp-swipe-pay .tbp-swipe-pay__thumb { transition: none; }
  .tbp-swipe-pay .tbp-swipe-pay__track::before { transition: none; }
  .tbp-swipe-pay .tbp-swipe-pay__face { animation: none !important; transform: none !important; }
}

/* Gold shine ONLY inside gold CTAs */
html body.woocommerce-checkout:not(.login):not(.registrazione) .tbp-btn--premium,
html body.woocommerce-checkout:not(.login):not(.registrazione) #place_order,
html body.woocommerce-checkout:not(.login):not(.registrazione) button#place_order,
html body.woocommerce-checkout:not(.login):not(.registrazione) #payment #place_order,
html body.woocommerce-checkout:not(.login):not(.registrazione) .place-order button#place_order,
html body.woocommerce-cart:not(.login):not(.registrazione) .tbp-btn--premium,
html body.woocommerce-order-received:not(.login):not(.registrazione) .tbp-btn--premium,
html body.woocommerce-account:not(.login):not(.registrazione) .tbp-flow-orders .tbp-btn--premium {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
  contain: paint !important;
  width: 100%;
  max-width: 320px;
  min-height: 48px;
  margin: 8px auto 0;
  border: 0 !important;
  border-radius: 16px !important;
  background: var(--tbp-cta-gold, var(--tbp-gold)) !important;
  color: var(--tbp-gold-label, #fff) !important;
  text-shadow: var(--tbp-gold-label-shadow, none) !important;
  font-weight: 800;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) .tbp-flow-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 320px;
  min-height: 48px;
  margin: 8px 0 0;
  border: 0;
  border-radius: 16px;
  background: var(--tbp-cta-gold, var(--tbp-gold)) !important;
  color: var(--tbp-gold-label, #fff) !important;
  text-shadow: var(--tbp-gold-label-shadow, none) !important;
  font-weight: 800;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) .tbp-flow-next:hover {
  background: var(--tbp-cta-gold, var(--tbp-gold)) !important;
  color: var(--tbp-gold-label, #fff) !important;
  text-shadow: var(--tbp-gold-label-shadow, none) !important;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) #place_order:disabled,
html body.woocommerce-checkout:not(.login):not(.registrazione) .place-order button#place_order:disabled,
html body.woocommerce-checkout:not(.login):not(.registrazione) #place_order.tbp-checkout-submit--blocked {
  opacity: 0.45;
}

html body.woocommerce-checkout .order-total .woocommerce-Price-amount,
html body.woocommerce-checkout .shop_table .woocommerce-Price-amount,
html body.woocommerce-checkout .tbp-flow-card__total,
html body.woocommerce-checkout .tbp-flow-card__total .woocommerce-Price-amount,
html body.woocommerce-checkout .tbp-flow-card__total .woocommerce-Price-amount bdi,
html body.woocommerce-cart .tbp-flow-cart-pay__total,
html body.woocommerce-cart .tbp-flow-cart-pay__total .woocommerce-Price-amount,
html body.woocommerce-cart .tbp-flow-cart-pay__total .woocommerce-Price-amount bdi,
html body.woocommerce-cart .tbp-flow-card__total,
html body.woocommerce-cart .tbp-flow-card__total .woocommerce-Price-amount,
html body.woocommerce-cart .tbp-flow-card__total .woocommerce-Price-amount bdi,
html body.woocommerce-order-received .tbp-flow-card__total .woocommerce-Price-amount,
html body.woocommerce-account .tbp-flow-card__total .woocommerce-Price-amount {
  color: var(--tbp-green, #084828) !important;
  -webkit-text-fill-color: var(--tbp-green, #084828) !important;
  font-size: 1.25rem;
  font-weight: 800;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) .tbp-btn--premium::after,
html body.woocommerce-checkout:not(.login):not(.registrazione) #place_order::after,
html body.woocommerce-checkout:not(.login):not(.registrazione) button#place_order::after,
html body.woocommerce-checkout:not(.login):not(.registrazione) #payment #place_order::after,
html body.woocommerce-checkout:not(.login):not(.registrazione) .place-order button#place_order::after,
html body.woocommerce-cart:not(.login):not(.registrazione) .tbp-btn--premium::after,
html body.woocommerce-order-received:not(.login):not(.registrazione) .tbp-btn--premium::after,
html body.woocommerce-account:not(.login):not(.registrazione) .tbp-flow-orders .tbp-btn--premium::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: inherit;
  background: var(--tbp-cta-light);
  transform: translateX(-160%);
  animation: var(--tbp-cta-animation);
  pointer-events: none;
  z-index: -1;
}

html body.woocommerce-checkout:not(.login):not(.registrazione) .tbp-btn--premium:hover,
html body.woocommerce-checkout:not(.login):not(.registrazione) #place_order:hover,
html body.woocommerce-checkout:not(.login):not(.registrazione) button#place_order:hover,
html body.woocommerce-checkout:not(.login):not(.registrazione) .place-order button#place_order:hover,
html body.woocommerce-cart:not(.login):not(.registrazione) .tbp-btn--premium:hover {
  background: var(--tbp-cta-gold, var(--tbp-gold)) !important;
  color: var(--tbp-gold-label, #fff) !important;
  text-shadow: var(--tbp-gold-label-shadow, none) !important;
}

@media (prefers-reduced-motion: reduce) {
  html body.woocommerce-checkout .tbp-flow-progress button,
  html body.woocommerce-checkout .tbp-flow-next {
    transition: none;
    transform: none;
  }
  html body.woocommerce-checkout .tbp-btn--premium::after,
  html body.woocommerce-checkout #place_order::after,
  html body.woocommerce-cart .tbp-btn--premium::after,
  html body.woocommerce-order-received .tbp-btn--premium::after {
    animation: none;
  }
}

/* Cart */
.tbp-flow-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tbp-flow-cart-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

.tbp-flow-cart-remove {
  color: var(--tbp-red, #D0161A);
  font-weight: 700;
  text-decoration: none;
}

.tbp-flow-cart-pay {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
  padding: 12px;
}

.tbp-flow-cart-pay__total {
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: var(--tbp-green, #084828);
  font-size: 1.25rem;
  font-weight: 800;
}

.tbp-flow-cart-empty,
body.woocommerce-cart .text-center.pt.pb {
  padding: 16px 12px;
  text-align: center;
}

.tbp-flow-cart-empty__cta,
body.woocommerce-cart .return-to-shop {
  margin: 12px 0 0;
}

.tbp-flow-card {
  margin: 0;
}

.tbp-flow-card__link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.tbp-flow-card__thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  flex: 0 0 72px;
}

.tbp-flow-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tbp-flow-card__title {
  color: var(--tbp-green, #084828);
  font-weight: 800;
}

.tbp-flow-card__total {
  color: var(--tbp-green, #084828);
  font-size: 1.25rem;
  font-weight: 800;
}

.tbp-flow-card__status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tbp-sage, #f4f7f5);
  color: var(--tbp-green, #084828);
  font-size: 0.78rem;
  font-weight: 700;
}

.tbp-flow-card__status--cancelled,
.tbp-flow-card__status--failed,
.tbp-flow-card__status--refunded {
  background: #fdecee;
  color: var(--tbp-red, #D0161A);
}

/* Thank-you */
.tbp-flow-thanks-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 0;
}

.tbp-flow-thanks-wrap > .tbp-flow-thanks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.tbp-flow-thanks__check {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tbp-green, #084828);
  color: #fff;
}

html body.woocommerce-order-received #main .tbp-flow-thanks__title,
html body.woocommerce-view-order #main .tbp-flow-thanks__title {
  margin: 0 !important;
  color: var(--tbp-green, #084828);
  font-size: clamp(1.25rem, 3vw, 1.6rem) !important;
  font-weight: 800;
  line-height: 1.2 !important;
  overflow-wrap: anywhere;
}

.tbp-flow-thanks__message {
  margin: 8px 0 12px;
  color: var(--tbp-ink, #123326);
  font-size: 1rem;
  line-height: 1.5;
}

.tbp-flow-order-access { padding: 12px; }

.tbp-flow-thanks__support {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  color: var(--tbp-green, #084828);
  font-weight: 700;
  text-decoration: underline;
}

html body.woocommerce-order-received form.woocommerce-form-login {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--tbp-line, #E6EDE8);
  border-radius: 16px;
}

html body.woocommerce-order-received #main .woocommerce-info {
  margin: 8px 0 !important;
  padding: 12px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: var(--tbp-sage, #F4F7F5) !important;
  color: var(--tbp-ink, #123326) !important;
  line-height: 1.5;
}

.tbp-flow-thanks__order,
.tbp-flow-thanks__email {
  margin: 0;
  color: var(--tbp-muted, #5d786b);
  font-size: 0.92rem;
}

.tbp-flow-thanks__details {
  padding: 0 12px 12px;
}

html body.woocommerce-order-received .woocommerce-order.row > div.grazie,
html body.woocommerce-order-received .woocommerce-order.row > div.dettagli {
  width: 100% !important;
  position: static;
}

/* Orders */
.tbp-flow-orders__title {
  margin: 0 0 12px;
  color: var(--tbp-green, #084828);
  font-size: 1.15rem;
  font-weight: 800;
}

.tbp-flow-orders__tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.tbp-flow-orders__tab {
  flex: 1;
  min-height: 44px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: var(--tbp-sage, #f4f7f5);
  color: var(--tbp-green, #084828);
  font-weight: 700;
  cursor: pointer;
}

.tbp-flow-orders__tab.is-active {
  background: #fff;
}

.tbp-flow-orders__count {
  margin-left: 4px;
  color: var(--tbp-muted, #5d786b);
  font-weight: 600;
}

.tbp-flow-orders__panel {
  display: none;
}

.tbp-flow-orders__panel.is-active {
  display: block;
}

.tbp-flow-orders__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tbp-flow-orders__list li {
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

.tbp-flow-orders__empty {
  margin: 0 0 12px;
  color: var(--tbp-muted, #5d786b);
}

.tbp-flow-view-order {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

.tbp-flow-view-order__facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.tbp-flow-view-order__facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tbp-flow-view-order__facts dt {
  margin: 0;
  color: var(--tbp-muted, #5d786b);
  font-weight: 600;
}

.tbp-flow-view-order__facts dd {
  margin: 0;
  color: var(--tbp-green, #084828);
  font-weight: 800;
  font-size: 1.25rem;
}

@media (min-width: 850px) {
  html body.woocommerce-checkout:not(.login):not(.registrazione) #main #content > .row,
  html body.woocommerce-cart:not(.login):not(.registrazione) #main #content > .row,
  html body.woocommerce-order-received:not(.login):not(.registrazione) #main #content > .row {
    padding: 16px;
  }
}

/* Pay step: beat rebrand green boxes / green pills. Auth freeze: not login/registrazione. */
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #main {
  padding-bottom: calc(var(--tbp-app-bar-h, 118px) + 32px) !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #main #content > .row,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .woocommerce-checkout-review-order,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #order_review,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .checkout-sidebar,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .has-border,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .large-5 .is-sticky-column {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  max-width: 640px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-back,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) button.tbp-flow-back {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px !important;
  width: auto !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--tbp-green, #084828) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-back:hover,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) button.tbp-flow-back:hover {
  background: transparent !important;
  color: var(--tbp-green-dark, #06381f) !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .shop_table.woocommerce-checkout-review-order-table {
  width: 100% !important;
  margin: 0 0 12px !important;
  border: 0 !important;
  background: transparent !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review thead,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review .product-quantity,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review td.product-total {
  display: none !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review th,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review td {
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  vertical-align: top;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review .cart_item td {
  padding: 0 0 12px !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-checkout-esperienza-item {
  padding: 12px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: none !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__link {
  display: grid !important;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__thumb {
  width: 96px !important;
  height: 120px !important;
  object-fit: cover !important;
  border-radius: 14px !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__title {
  display: block;
  margin: 0 0 4px;
  color: var(--tbp-green, #084828) !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  line-height: 1.25;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__host,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__facts,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__when,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__seats {
  display: block;
  margin: 0;
  color: var(--tbp-muted, #5d786b) !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  line-height: 1.35;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review .order-total th,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review .order-total td {
  padding: 12px 4px 4px !important;
  color: var(--tbp-green, #084828) !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review .order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment ul.payment_methods {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  list-style: none !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment .wc_payment_method {
  position: relative;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #wc-stripe-card-element,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .wc-stripe-elements-field,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .StripeElement {
  border: 0 !important;
  border-radius: 16px !important;
  background: var(--tbp-sage, #f4f7f5) !important;
  box-shadow: none !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes {
  display: grid !important;
  gap: 12px !important;
  margin: 12px 0 8px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes .form-row,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-row {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-copy {
  flex: 1 1 auto;
  font-weight: 400 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  color: #084828 !important;
  -webkit-text-fill-color: #084828 !important;
  pointer-events: none;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes a,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-copy a.tbp-auth-link {
  color: #D0161A !important;
  -webkit-text-fill-color: #D0161A !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  pointer-events: auto;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes a:hover,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes a:focus-visible {
  color: #a91e2a !important;
  -webkit-text-fill-color: #a91e2a !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  flex: 0 0 auto;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  margin: 0 !important;
  border: 2px solid #084828 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
  box-sizing: border-box;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes input[type="checkbox"]:checked {
  background: #084828 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' d='M3 8.2 6.4 12 13 4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 16px 16px !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-legal-checkboxes input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(8, 72, 40, 0.22);
  outline-offset: 2px;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .place-order {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0 !important;
  padding: 0 0 8px !important;
  border: 0 !important;
  background: transparent !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #place_order,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) button#place_order {
  width: 100% !important;
  max-width: 320px !important;
  margin: 4px auto 0 !important;
  background: var(--tbp-cta-gold, var(--tbp-gold)) !important;
  color: var(--tbp-gold-label, #fff) !important;
  text-shadow: var(--tbp-gold-label-shadow, none) !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #place_order:hover,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) button#place_order:hover {
  background: var(--tbp-cta-gold, var(--tbp-gold)) !important;
  color: var(--tbp-gold-label, #fff) !important;
  text-shadow: var(--tbp-gold-label-shadow, none) !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-checkout-fees-note,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .woocommerce-privacy-policy-text,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .woocommerce-privacy-policy-text p {
  margin: 0 !important;
  text-align: center;
  color: var(--tbp-muted, #5d786b) !important;
  font-size: 0.78rem !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .woocommerce-privacy-policy-text {
  display: none !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card {
  position: relative;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__body {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-width: 0;
  padding-right: 72px;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-card__total {
  position: absolute !important;
  right: 12px !important;
  bottom: 12px !important;
  margin: 0 !important;
  display: block !important;
  color: var(--tbp-ink, #123326) !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review__subtotal {
  display: flex !important;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 4px 0 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review__subtotal th {
  color: var(--tbp-muted, #5d786b) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review__subtotal td {
  color: var(--tbp-ink, #123326) !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review .order-total {
  margin-top: 8px;
  padding-top: 10px !important;
  border-top: 1px solid var(--tbp-line, #e6ede8) !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-review__vat {
  display: block;
  margin-top: 2px;
  color: var(--tbp-muted, #5d786b) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-pay__title {
  margin: 16px 0 4px;
  color: var(--tbp-green, #084828) !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-pay__lede {
  margin: 0 0 10px;
  color: var(--tbp-muted, #5d786b) !important;
  font-size: 0.88rem !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment .wc_payment_method > label {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0 !important;
  padding: 12px 12px 12px 44px !important;
  border: 1px solid var(--tbp-line, #e6ede8) !important;
  border-radius: 16px !important;
  background: #fff !important;
  color: var(--tbp-green, #084828) !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: border-color 160ms, background-color 160ms;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment .wc_payment_method > input:checked + label {
  border-color: var(--tbp-green, #084828) !important;
  background: var(--tbp-sage, #f4f7f5) !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment .wc_payment_method input.input-radio {
  position: absolute;
  top: 17px;
  left: 14px;
  appearance: auto !important;
  -webkit-appearance: radio !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  accent-color: var(--tbp-green, #084828);
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment .payment_box {
  margin: 4px 0 0 !important;
  padding: 12px !important;
  border: 1px solid var(--tbp-line, #e6ede8) !important;
  border-radius: 16px !important;
  background: #fff !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment .form-row,
html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) #payment label {
  color: var(--tbp-green, #084828) !important;
}

html body.woocommerce-checkout.tbp-flow:not(.login):not(.registrazione) .tbp-flow-pay__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 0 !important;
  color: var(--tbp-muted, #5d786b) !important;
  font-size: 0.8rem !important;
}

/* Nessun metodo scelto: bottone spento finche l'utente non decide. */
html body.woocommerce-checkout.tbp-flow.tbp-pay-unchosen #payment #place_order,
html body.woocommerce-checkout.tbp-flow.tbp-pay-unchosen .place-order button#place_order {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

html body.woocommerce-checkout.tbp-flow.tbp-pay-unchosen .tbp-flow-pay__lede {
  color: var(--tbp-green, #084828) !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   Checkout mobile full-screen ("videogioco"): il form occupa tutto lo
   schermo, toolbar con X/titolo/timer, strip dei due step, contenuto
   scrollabile, CTA appiccicata in basso, slide direzionale. Gate: la classe
   body.tbp-flow-fullscreen la mette il JS solo sotto 850px. Desktop intatto.
   ========================================================================== */
@keyframes tbpFlowSlideIn {
  from { opacity: 0; transform: translate3d(36px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes tbpFlowSlideBack {
  from { opacity: 0; transform: translate3d(-36px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Fuori dal full-screen la toolbar non esiste: il timer resta al suo posto. */
html body.woocommerce-checkout:not(.tbp-flow-fullscreen) .tbp-flow-toolbar__close,
html body.woocommerce-checkout:not(.tbp-flow-fullscreen) .tbp-flow-toolbar__title {
  display: none !important;
}

html body.woocommerce-checkout:not(.tbp-flow-fullscreen) .tbp-flow-toolbar {
  display: block;
  margin: 0 0 8px;
}

@media all {
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen {
    overflow: hidden !important;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen form.checkout.tbp-flow-form {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99500 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  /* Chrome dell'app fuori: si esce con la X. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #masthead,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .header-wrapper,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-app-bar,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-app-bar__backdrop,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-colombo-chat,
  html body.tbp-has-app-bar.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-app-bar {
    display: none !important;
  }

  /* Avvisi Woo (prepended al form): pannello compatto sopra lo scroller. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen form.checkout > .woocommerce-NoticeGroup {
    flex: 0 0 auto;
    max-height: 38dvh;
    overflow-y: auto;
    margin: 0 !important;
    padding: 8px 16px 0 !important;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-layout {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 16px 24px !important;
    gap: 10px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Toolbar: X, titolo, timer. Sticky in testa allo scroller. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas: "close title" "timer timer";
    align-items: center;
    gap: 6px 10px;
    margin: 0 -16px 2px !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px !important;
    background: #fff;
    border-bottom: 1px solid #e3eae5;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-toolbar__close {
    grid-area: close;
    display: grid !important;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tbp-sage, #f4f7f5);
    color: var(--tbp-green, #084828);
    text-decoration: none !important;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-toolbar__title {
    grid-area: title;
    display: block !important;
    min-width: 0;
    overflow: hidden;
    color: var(--tbp-green, #084828);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-toolbar__timer {
    grid-area: timer;
    min-width: 0;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-toolbar__timer[hidden] {
    display: none !important;
  }

  /* Il timer nasce come .row/.col/.box: appiattito in una pillola. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #checkout-timer,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #checkout-timer .row,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #checkout-timer .col,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #checkout-timer .box {
    display: block !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #checkout-timer .box p {
    margin: 0 !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    background: var(--tbp-sage, #f4f7f5) !important;
    color: var(--tbp-green, #084828) !important;
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
  }

  /* Strip dei due step: piu bassa, subito sotto la toolbar. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-progress {
    margin: 0 !important;
    gap: 6px !important;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-progress button {
    min-height: 40px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    font-size: 0.86rem !important;
  }

  /* Slide direzionale del pannello attivo. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen.tbp-flow--dati .tbp-flow-panel--dati,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen.tbp-flow--paga .tbp-flow-panel--paga {
    animation: tbpFlowSlideIn 0.32s cubic-bezier(0.32, 0.72, 0.28, 1) both;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen.tbp-flow-going-back.tbp-flow--dati .tbp-flow-panel--dati {
    animation-name: tbpFlowSlideBack;
  }

  /* CTA appiccicate al fondo dello scroller, con safe-area. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-next {
    position: sticky !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 2;
    width: 100% !important;
    margin: 12px 0 0 !important;
    box-shadow: 0 10px 24px rgba(6, 56, 31, 0.18) !important;
  }

  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #payment .place-order,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen #payment .form-row.place-order {
    /* Consensi e CTA seguono i metodi: un blocco alto non deve coprire Stripe. */
    position: static !important;
    bottom: auto !important;
    z-index: auto;
    margin: 12px -16px 0 !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    background: #fff !important;
    border-top: 1px solid #e3eae5 !important;
    box-shadow: none !important;
  }

  /* Popup che devono galleggiare sopra l'overlay fisso. */
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .select2-container--open,
  html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .ui-datepicker {
    z-index: 99800 !important;
  }

  @media (prefers-reduced-motion: reduce) {
    html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-panel--dati,
    html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen .tbp-flow-panel--paga {
      animation: none !important;
    }
  }
}

/* ==========================================================================
   Riepilogo ordine (order/order-details.php): dettaglio account e pagina grazie.
   ========================================================================== */
html body.woocommerce-view-order .wrapper-dettagli-ordine,
html body.woocommerce-order-received .wrapper-dettagli-ordine {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.tbp-order-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}
html body .tbp-order-summary__title {
  margin: 0 !important;
  color: var(--tbp-green, #084828);
  font-size: 1.05rem !important;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3 !important;
}
.tbp-order-summary__facts { display: grid; gap: 8px; margin: 0; }
.tbp-order-summary__facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--tbp-line, #E6EDE8);
}
.tbp-order-summary__facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
html body .tbp-order-summary__facts dt { margin: 0; flex: 0 0 auto; color: var(--tbp-muted, #5d786b); font-size: .9rem; font-weight: 600; text-transform: none; }
html body .tbp-order-summary__facts dd { margin: 0; flex: 1 1 auto; text-align: right; color: var(--tbp-ink, #123326); font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.tbp-order-summary__item dd { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; }
.tbp-order-summary__qty { color: var(--tbp-muted, #5d786b); font-weight: 600; }
.tbp-order-summary__amount { font-weight: 800; color: var(--tbp-green, #084828); }
html body .tbp-order-summary__total dt { color: var(--tbp-green, #084828); font-weight: 800; }
html body .tbp-order-summary__total dd { color: var(--tbp-green, #084828); font-size: 1.2rem; font-weight: 800; }
.tbp-order-summary__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
html body .tbp-order-summary__cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 52px !important;
  padding: 0 22px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: var(--tbp-gold, #C9A227) !important;
  color: #1d1d1b !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  box-shadow: 0 10px 24px rgba(6, 56, 31, .16) !important;
}
html body .tbp-order-summary__link { color: var(--tbp-green, #084828); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* Indirizzi WooCommerce dentro il riepilogo: compatti. */
.tbp-order-summary .woocommerce-customer-details { margin: 4px 0 0; }
html body .tbp-order-summary .woocommerce-customer-details h2,
html body .tbp-order-summary .woocommerce-customer-details h3 { margin: 0 0 4px !important; color: var(--tbp-green, #084828); font-size: .95rem !important; font-weight: 800; }
.tbp-order-summary .woocommerce-customer-details address { margin: 0; padding: 10px 12px; border: 1px solid var(--tbp-line, #E6EDE8); border-radius: 12px; font-style: normal; font-size: .95rem; line-height: 1.45; }

/* Valori del riepilogo e dei dati prenotazione: testo naturale, non maiuscolo forzato,
   e importi nel verde del marchio (il rosso dei prezzi qui sembrava un errore). */
html body .tbp-order-summary__facts dt,
html body .tbp-order-summary__facts dd,
html body .tbp-order-summary__facts dd *,
html body .tbp-flow-view-order__facts dt,
html body .tbp-flow-view-order__facts dd,
html body .tbp-flow-view-order__facts dd * {
  text-transform: none !important;
  letter-spacing: normal !important;
}
html body .tbp-order-summary .woocommerce-Price-amount,
html body .tbp-order-summary .amount,
html body .tbp-order-summary__amount {
  color: var(--tbp-green, #084828) !important;
  font-weight: 800;
}
html body .tbp-order-summary__total .woocommerce-Price-amount,
html body .tbp-order-summary__total .amount { font-size: 1.2rem; }

/* Telefono: etichetta sopra e valore sotto, allineati a sinistra. Affiancati,
   i valori lunghi (data e ora, nome attivita, carta) si spezzavano in colonne
   strette sul bordo destro. La CTA resta sopra la barra dell'app. */
@media (max-width: 560px) {
  html body .tbp-order-summary__facts > div,
  html body .tbp-flow-view-order__facts > div {
    display: block;
    padding-bottom: 10px;
  }
  html body .tbp-order-summary__facts dt,
  html body .tbp-flow-view-order__facts dt {
    display: block;
    margin-bottom: 2px;
    font-size: .85rem;
  }
  html body .tbp-order-summary__facts dd,
  html body .tbp-flow-view-order__facts dd {
    display: block;
    text-align: left;
    font-size: 1.05rem;
  }
  /* Riquadri piu stretti: il margine dell'area account resta quello del tema. */
  html body .tbp-order-summary,
  html body .tbp-flow-view-order { padding: 14px !important; }
  html body .tbp-flow-view-order__facts dd { font-size: 1.15rem; }
  html body .tbp-order-summary__item dd { justify-content: flex-start; }
  html body .tbp-order-summary__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 8px;
  }
  html body .tbp-order-summary__cta { width: 100%; }
  html body .tbp-order-summary__link { text-align: center; }
}

/* Area account: un riquadro solo. La sezione di benvenuto aveva sfondo, bordo
   arrotondato e margine propri dentro il riquadro bianco della pagina: due
   cornici concentriche, piu quella del contenitore. */
html body.woocommerce-account .woocommerce-MyAccount-content section.benvenuto,
html body.woocommerce-account .woocommerce-MyAccount-content > section:first-child.benvenuto {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Dettaglio ordine: etichetta e valore in due colonne vicine. Con
   space-between su tutta la larghezza della pagina la riga si spezzava agli
   estremi e l'occhio non collegava piu' «Data» al suo valore. */
@media (min-width: 561px) {
  html body .tbp-flow-view-order__facts > div {
    display: grid !important;
    grid-template-columns: minmax(110px, 190px) 1fr;
    align-items: baseline;
    column-gap: 24px;
    max-width: 560px;
  }
  html body .tbp-flow-view-order__facts dd {
    text-align: left !important;
    font-size: 1.1rem;
  }
}

/* Stesso allineamento per il riepilogo nella pagina ordine dell'account: la
   riga «Attività» porta il suo importo a destra, le altre restano appaiate. */
@media (min-width: 561px) {
  html body.woocommerce-view-order .tbp-order-summary__facts > div {
    display: grid !important;
    grid-template-columns: minmax(110px, 190px) 1fr;
    align-items: baseline;
    column-gap: 24px;
    max-width: 560px;
  }
  html body.woocommerce-view-order .tbp-order-summary__facts dd { text-align: left !important; }
  html body.woocommerce-view-order .tbp-order-summary__facts .tbp-order-summary__item dd {
    display: flex;
    justify-content: space-between;
    gap: 16px;
  }
}

/* View switching changes presentation only; the same form controls remain mounted. */
html body .tbp-guided-view-toggle {
 display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
 min-height: 44px; padding: 8px 14px; margin: 8px 0;
 border: 1px solid currentColor; border-radius: 12px;
 background: var(--tbp-surface, #fff); color: var(--tbp-text, #084828);
 font: 700 13px/1.2 var(--tbp-font, sans-serif); cursor: pointer;
}
html body .tbp-guided-view-toggle:focus-visible { outline: 3px solid #c9a227; outline-offset: 3px; }

html body.tbp-flow-fullscreen .tbp-flow-toolbar > .tbp-guided-view-toggle { grid-column: 1 / -1; justify-self: end; margin: 0; }

/* 23/9 notte: come nel flusso di accesso, con la tastiera aperta il modulo sta sopra i tasti
   (--tbp-vista-h / --tbp-vista-top da tbp-auth-flow.js o tbp-app.js) e non scorre di lato. */
html body.woocommerce-checkout.tbp-flow.tbp-flow-fullscreen form.checkout.tbp-flow-form {
  top: var(--tbp-vista-top, 0px) !important;
  bottom: auto !important;
  height: var(--tbp-vista-h, 100dvh) !important;
  overflow-x: clip !important;
}
