/* Shreenath Kia — Kia Assured Buyback calculator on the pre-owned page (filled in by js/buyback.js).
   Built from the site's own parts: the light panel of the EMI calculator, white boxed fields,
   the tab track for choices and the black button. */

/* The section: the heading on the left in two lines and the intro across the right (the site's .sec--headsplit),
   with the same extra space below the calculator as .sec--headsplit adds above the heading */
.sec--buyback { padding-bottom: clamp(16px, 2.4vw, 40px); }
.sec--buyback .sec__head .h2 { max-width: 28ch; }

.bb { margin-top: clamp(28px, 3vw, 44px); padding: clamp(20px, 2.4vw, 32px); background: var(--tint); border-radius: var(--r-lg); }
.bb__top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); }
.bb__h { font-size: 1.18rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.bb sup { font-size: .62em; font-weight: 600; margin-left: 1px; color: var(--graphite); }
.bb__sub { margin-top: 4px; font-size: .95rem; color: var(--graphite); }
.bb__sub:empty { display: none; }

/* Your car */
.bb__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 16px; margin-top: 18px; }
.bb__f label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; color: var(--graphite); }
.bb .field { min-height: 52px; background: var(--white); border-color: var(--white); }
.bb .field:focus-within { border-color: var(--navy-2); }
.bb .field.is-invalid { border-color: var(--error); }
.bb .field select, .bb .field input { height: 50px; font-size: 1rem; font-weight: 600; color: var(--ink); text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bb__money > span { font-weight: 600; color: var(--graphite); }
.bb__err { margin-top: 6px; font-size: .88rem; color: var(--error); }
.bb__err[hidden] { display: none; }
.bb__net { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #dfe2e5; color: var(--graphite); }
.bb__net b { font-size: clamp(1.45rem, 2vw, 1.75rem); font-weight: 700; letter-spacing: -.015em; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Plan price */
.bb__plan { display: flex; flex-direction: column; padding: clamp(18px, 2vw, 26px); background: var(--white); border-radius: var(--r-lg); }
.bb__rows { display: grid; gap: 12px; margin: 18px 0 22px; }
.bb__rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.bb__rows dt { color: var(--graphite); }
.bb__rows dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bb__total { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 4px 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--rule); }
.bb__total span { font-weight: 600; }
.bb__total small { display: block; font-size: .85rem; font-weight: 400; color: var(--graphite); }
.bb__total b { font-size: clamp(1.9rem, 2.8vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* Buyback value */
.bb__values { margin-top: clamp(16px, 2vw, 28px); padding: clamp(18px, 2vw, 26px); background: var(--white); border-radius: var(--r-lg); }
.bb__vhead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; }
.bb__vhead .bb__sub { margin: 0; }
.bb__grid[hidden], .bb__pick[hidden] { display: none; }

/* Petrol, diesel and CNG: every tenure and kilometre option in one table */
.bb__table { width: calc(100% + 16px); margin: 8px -8px -8px; border-collapse: separate; border-spacing: 8px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.bb__table th { font-weight: 600; text-align: left; }
.bb__table thead th { padding: 0 4px; font-size: .88rem; color: var(--graphite); text-align: center; }
.bb__table thead th:first-child { width: 18%; text-align: left; }
.bb__table tbody th { font-size: 1.02rem; }
.bb__table tbody th small { display: block; font-size: .85rem; font-weight: 400; color: var(--graphite); }
.bb__table td { padding: 14px 8px; text-align: center; border: 1px solid var(--rule); border-radius: var(--r); }
.bb__table td b { display: block; font-size: clamp(1.02rem, 1.5vw, 1.25rem); font-weight: 700; }
.bb__table td small { display: block; margin-top: 2px; font-size: .86rem; color: var(--graphite); }
.bb__km { display: none; }

/* EVs: the buyer picks the tenure and kilometres, and sees the one value */
.bb__choices { display: flex; flex-wrap: wrap; gap: 16px 32px; margin-top: 16px; }
.bb__pl { margin-bottom: 8px; font-size: .88rem; font-weight: 600; color: var(--graphite); }
.bb .tab { min-height: 46px; padding: 0 clamp(14px, 1.6vw, 22px); font-size: .98rem; font-variant-numeric: tabular-nums; }
.bb__one { margin-top: 18px; padding: clamp(16px, 2vw, 22px); background: var(--tint); border-radius: var(--r-lg); }
.bb__one-l { color: var(--graphite); }
.bb__one-v { margin-top: 2px; font-size: clamp(2rem, 3.4vw, 2.7rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.bb__one-s { margin-top: 2px; color: var(--graphite); font-variant-numeric: tabular-nums; }
.bb__fixed { margin-top: 12px; font-size: .92rem; color: var(--graphite); }

.bb__cover { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; padding: 12px 16px; background: var(--tint); border-radius: var(--r); }
.bb__cover .ico { margin-top: 3px; }
.bb__cover small { display: block; font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--graphite); }
.bb__cover b { font-weight: 600; }

.bb__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin-top: clamp(18px, 2vw, 26px); }
.bb__foot .note { flex: 1 1 340px; font-size: .88rem; }

@media (max-width: 1099px) {
  .bb__top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 859px) {
  .bb { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 24px var(--gutter); border-radius: 0; }
}
@media (max-width: 599px) {
  .bb__fields > :nth-child(-n+2) { grid-column: 1 / -1; }
  .bb__plan, .bb__values { padding: 18px 16px; }
  /* The table becomes one block per tenure, its three values side by side */
  .bb__table, .bb__table tbody, .bb__table tr { display: block; width: auto; margin: 0; }
  .bb__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .bb__table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
  .bb__table tbody th { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; }
  .bb__table td { padding: 10px 4px; }
  .bb__table td b { font-size: 1rem; }
  .bb__table td small { font-size: .8rem; }
  .bb__km { display: block; margin-bottom: 4px; font-size: .74rem; font-weight: 600; color: var(--graphite); }
  .bb__choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .bb .tab { padding: 0 6px; }
  .bb__foot .btn { flex: 1 1 100%; }
}
