/* Tesla Tint LA simulator — scoped to #tesla-sim so site.css cannot restyle
   the rest of the page, and site cards/buttons cannot restyle the preview. */

#tesla-sim {
  --sim-ink: #171a20;
  --sim-muted: #5c5e62;
  --sim-line: #e3e3e3;
  --sim-bg: #ffffff;
  --sim-chip: #f4f4f4;
  --sim-radius: 8px;
  --sim-wrap: 720px;
  background: var(--sim-bg);
  color: var(--sim-ink);
  font-family: var(--font-body, Inter, system-ui, sans-serif);
  border-top: 1px solid var(--sim-line);
}

#tesla-sim * { box-sizing: border-box; }

#tesla-sim .sim-wrap {
  width: 100%;
  max-width: var(--sim-wrap);
  margin: 0 auto;
  padding: 0 22px;
}

#tesla-sim .sim-stagewrap { padding: 28px 0 18px; }

#tesla-sim .sim-stage {
  position: relative;
  width: 100%;
  max-width: var(--sim-wrap);
  margin: 0 auto;
  line-height: 0;
}

#tesla-sim .sim-stage img {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
}

#tesla-sim .sim-stage.is-loading { opacity: 0.55; transition: opacity 0.15s; }

#tesla-sim .sim-film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#tesla-sim .sim-slogan {
  text-align: center;
  font-family: var(--font-head, Outfit, sans-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--sim-ink);
  margin: 16px 0 0;
}

#tesla-sim .sim-hint,
#tesla-sim .sim-warn {
  max-width: var(--sim-wrap);
  margin: 8px auto 0;
  text-align: center;
  font-size: 13px;
  border-radius: 6px;
  padding: 9px 14px;
  width: calc(100% - 44px);
}

#tesla-sim .sim-hint { color: var(--sim-ink); background: #fff8e5; }
#tesla-sim .sim-warn { color: #8a1c1c; background: #fdecec; }
#tesla-sim .sim-hint[hidden],
#tesla-sim .sim-warn[hidden] { display: none; }

#tesla-sim .sim-disclaimer {
  max-width: var(--sim-wrap);
  margin: 8px auto 0;
  padding: 0 30px;
  text-align: center;
  color: var(--sim-muted);
  font-size: 12px;
  line-height: 1.45;
}

#tesla-sim .sim-modelrow {
  border-top: 1px solid var(--sim-line);
  border-bottom: 1px solid var(--sim-line);
}

#tesla-sim .sim-modelrow-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
}

#tesla-sim .sim-modelname {
  font-family: var(--font-head, Outfit, sans-serif);
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  min-width: 0;
}

#tesla-sim .sim-changelink {
  appearance: none;
  flex: 0 0 auto;
  background: #fff;
  border: 1.5px solid var(--sim-ink);
  border-radius: 4px;
  padding: 12px 18px;
  min-height: 48px;
  min-width: 44px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--sim-ink);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

#tesla-sim .sim-picker {
  border-bottom: 1px solid var(--sim-line);
  padding: 16px 0;
  background: #fafafa;
}

#tesla-sim .sim-chips { display: flex; flex-wrap: wrap; gap: 8px; }

#tesla-sim .sim-chip {
  appearance: none;
  border: 1px solid var(--sim-line);
  background: #fff;
  color: var(--sim-ink);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
}

#tesla-sim .sim-chip[aria-pressed="true"] {
  background: var(--sim-ink);
  color: #fff;
  border-color: var(--sim-ink);
}

#tesla-sim .sim-chips.small .sim-chip {
  padding: 11px 14px;
  font-size: 13px;
  min-width: 56px;
  text-align: center;
}

#tesla-sim .sim-panel { padding: 24px 0 16px; }

#tesla-sim .sim-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#tesla-sim .sim-panel-head h2 {
  font-family: var(--font-head, Outfit, sans-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

#tesla-sim .sim-dash { color: var(--sim-muted); font-size: 20px; line-height: 1; }

#tesla-sim .sim-panel-sub {
  color: var(--sim-muted);
  font-size: 14px;
  margin: 8px 0 20px;
}

#tesla-sim .sim-sect {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 28px 0 6px;
}

#tesla-sim .sim-sect-sub {
  color: var(--sim-muted);
  font-size: 14px;
  margin: 0 0 12px;
}

#tesla-sim .sim-cards { display: grid; gap: 10px; }

#tesla-sim .sim-card {
  position: relative;
  appearance: none;
  text-align: left;
  width: 100%;
  border: 1px solid var(--sim-line);
  background: #fff;
  border-radius: var(--sim-radius);
  padding: 16px 18px;
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  color: inherit;
}

#tesla-sim .sim-card[aria-pressed="true"] {
  border-color: var(--sim-ink);
  box-shadow: inset 0 0 0 1px var(--sim-ink);
}

#tesla-sim .sim-card[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  border-style: solid;
  border-width: 0 0 30px 30px;
  border-color: transparent transparent var(--sim-ink) transparent;
}

#tesla-sim .sim-card[aria-pressed="true"]::before {
  content: "✓";
  position: absolute;
  right: 4px;
  bottom: 0;
  z-index: 1;
  color: #fff;
  font-size: 12px;
  line-height: 1.1;
}

#tesla-sim .sim-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

#tesla-sim .sim-card-name { font-size: 16px; font-weight: 700; }
#tesla-sim .sim-card-from { font-size: 14px; font-weight: 500; white-space: nowrap; }
#tesla-sim .sim-card-desc {
  color: var(--sim-muted);
  font-size: 13px;
  margin: 5px 0 0;
  line-height: 1.45;
}

#tesla-sim .sim-rows { display: grid; gap: 10px; }

#tesla-sim .sim-row {
  appearance: none;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--sim-line);
  background: #fff;
  border-radius: var(--sim-radius);
  padding: 15px 18px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 44px;
}

#tesla-sim .sim-row[aria-pressed="true"] {
  border-color: var(--sim-ink);
  box-shadow: inset 0 0 0 1px var(--sim-ink);
}

#tesla-sim .sim-dot {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid #c4c4c4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
}

#tesla-sim .sim-row[aria-pressed="true"] .sim-dot {
  background: var(--sim-ink);
  border-color: var(--sim-ink);
}

#tesla-sim .sim-row-body { flex: 1 1 auto; min-width: 0; }
#tesla-sim .sim-row-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
#tesla-sim .sim-row-sub { display: block; color: var(--sim-muted); font-size: 13px; margin-top: 2px; }
#tesla-sim .sim-row-price {
  flex: 0 0 auto;
  align-self: center;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
#tesla-sim .sim-row-price.is-quote { font-size: 13px; color: var(--sim-muted); }

#tesla-sim .sim-shade { margin: 0 0 14px; }
#tesla-sim .sim-shade[hidden] { display: none; }
#tesla-sim .sim-shade-lbl { display: block; font-size: 13px; color: var(--sim-muted); margin: 0 0 8px; }
#tesla-sim .sim-note { color: var(--sim-muted); font-size: 13px; margin: 14px 0 0; }

#tesla-sim .sim-pricebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: #f7f7f7;
  border-top: 1px solid var(--sim-line);
  padding-bottom: env(safe-area-inset-bottom);
}

#tesla-sim .sim-pricebar[hidden] { display: none; }

#tesla-sim .sim-pricebar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 82px;
}

#tesla-sim .sim-total { display: flex; flex-direction: column; min-width: 0; }

#tesla-sim .sim-price-num {
  font-family: var(--font-head, Outfit, sans-serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#tesla-sim .sim-price-sub { font-size: 12px; color: var(--sim-muted); }

#tesla-sim .sim-next {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 15px 34px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  background: #171a20;
  color: #fff;
}

@media (max-width: 980px) {
  #tesla-sim .sim-pricebar { bottom: 72px; }
  body.sim-pricebar-on { padding-bottom: 154px; }
}

@media (min-width: 981px) {
  body.sim-pricebar-on { padding-bottom: 82px; }
}
