/* TBI financing button - from "TBI Financing Button - Design Guidelines".
   Tokens are scoped to the component so nothing leaks into the shop's CSS. */

.tbi-fp-wrap {
  /* the card reflows on the width of THIS box, not of the browser window */
  container-name: tbi-fp;
  container-type: inline-size;
  margin: 12px 0;
  max-width: 495px;
  width: 100%;

  --tbi-color-card-bg: #ffffff;
  --tbi-color-card-border: #ebebeb;
  --tbi-color-card-shadow: rgb(0 0 0 / 12%);
  --tbi-color-text-primary: #1c1e24;
  --tbi-color-brand-orange: #ff5f20;
  --tbi-font-family: 'Inter', 'Open Sans', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.tbi-fp-wrap *,
.tbi-fp-wrap *::before,
.tbi-fp-wrap *::after {
  box-sizing: border-box;
}

.tbi-fp-card {
  align-items: center;
  background: var(--tbi-color-card-bg);
  border: 1px solid var(--tbi-color-card-border);
  border-radius: 20px;
  box-shadow: 0 6px 12px var(--tbi-color-card-shadow);
  color: var(--tbi-color-text-primary);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  font-family: var(--tbi-font-family);
  gap: 12px;
  justify-content: space-between;
  min-height: 70px;
  padding: 12px;
  transition: box-shadow 0.2s ease;
  width: 100%;
}

.tbi-fp-card:hover,
.tbi-fp-card:focus-within {
  box-shadow: none;
}

.tbi-fp-card:focus-visible {
  outline: 2px solid var(--tbi-color-brand-orange);
  outline-offset: 2px;
}

.tbi-fp-info {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  gap: 12px;
  min-width: 0;
}

.tbi-fp-brand {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
}

.tbi-fp-logo {
  display: block;
  height: 44px;
  margin: 0;
  max-width: 100%;
  width: auto;
}

.tbi-fp-divider {
  background: var(--tbi-color-card-border);
  border: 0;
  display: block;
  flex: 0 0 1px;
  height: 44px;
  width: 1px;
}

.tbi-fp-copy {
  align-items: flex-start;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.tbi-fp-viewport {
  align-items: center;
  display: flex;
  height: 44px;
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.tbi-fp-track {
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(0);
  transition: transform 0.24s ease;
  width: 100%;
}

.tbi-fp-track.tbi-fp-sliding {
  transform: translateY(-100%);
}

.tbi-fp-track.tbi-fp-instant {
  transition: none;
}

.tbi-fp-state {
  align-items: flex-start;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 44px;
  width: 100%;
}

.tbi-fp-state--next {
  left: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
}

.tbi-fp-title {
  color: var(--tbi-color-brand-orange);
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 16px;
  margin: 0;
  text-align: left;
  white-space: nowrap;
}

.tbi-fp-amount {
  color: var(--tbi-color-text-primary);
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 24px;
  margin: 0;
  text-align: left;
  white-space: nowrap;
}

/* "Detalii" is a quiet text link under the amount, with the same values as
   Leanpay's link (.leanpay-trigger in leanpay-calculator.css). */
.tbi-fp-link {
  color: #007bff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  margin-top: 2px;
  text-decoration: underline;
  white-space: nowrap;
}

.tbi-fp-card:hover .tbi-fp-link {
  color: #0056b3;
}

@media (prefers-reduced-motion: reduce) {
  .tbi-fp-track { transition: none; }
}

/* the calculator window opened by "Detalii" */
.tbi-fp-modal {
  align-items: center;
  background: rgb(0 0 0 / 55%);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 16px;
  position: fixed;
  z-index: 100000;
}

.tbi-fp-modal-box {
  background: #ffffff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  height: min(760px, 100%);
  max-width: 980px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.tbi-fp-modal-close {
  align-items: center;
  background: #ffffff;
  border: 0;
  color: #1c1e24;
  cursor: pointer;
  display: flex;
  font: 400 34px/1 Arial, sans-serif;
  height: 62px;
  justify-content: center;
  padding: 0 0 4px;
  position: absolute;
  right: 0;
  top: 0;
  width: 72px;
}

.tbi-fp-modal-close:hover,
.tbi-fp-modal-close:focus-visible {
  color: #ff5f20;
}

.tbi-fp-modal iframe {
  border: 0;
  flex: 1 1 auto;
  width: 100%;
}
