/* Tokens are store.com.hr's own (its :root), so the iframe reads as part of the page. Its SF Pro
   files can't be loaded from here (no CORS), so Apple devices get SF from the system and the rest
   fall back to Arial, as the site's own stack does. The site picks weights by family ("SF Pro
   Semibold"); those fallbacks need them as font-weight instead. */
:root {
  --font: "SF Pro", -apple-system, BlinkMacSystemFont, Arial, Helvetica, sans-serif;
  --medium: 500;
  --semibold: 600;
  --black: #1d1d1d;
  --black70: rgba(29, 29, 29, 0.7);
  --black50: #909090;
  --blue: #0072e5;
  --blueHover: #0067ce;
  --grayBg: #f5f5f7;
  --white: #fff;
  --borderColor: #e3e3e3;
  --separator: #eee;
  --activeGray: #d1d1d1;
  --inputOverlay: #e5f0fc;
  --red: #cc4a4a;
  --borderRadius: 20px;
  --transition: 300ms;
  --shadowHover: 0 12px 24px rgba(0, 0, 0, 0.08);
}

@view-transition {
  navigation: auto;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--grayBg);
  color: var(--black);
  font: 17px/24px var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blueHover); }

ul { margin: 0; padding: 0; list-style: none; }

.wizard {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* Header: back, step count, progress, picks so far */

.wizard__header {
  margin-bottom: 32px;
  view-transition-name: wizard-header;
}

.wizard__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 24px;
  margin-bottom: 12px;
}

.back {
  font-weight: var(--medium);
  font-size: 15px;
  padding-left: 14px;
  position: relative;
}

.back::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  transition: left var(--transition);
}

.back:hover::before { left: -1px; }

.wizard__count {
  margin-left: auto;
  font-size: 13px;
  color: var(--black70);
}

.progress {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress__segment {
  height: 4px;
  border-radius: 2px;
  background: var(--activeGray);
}

.progress__segment--done,
.progress__segment--current {
  background: var(--blue);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.crumb {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--borderColor);
  border-radius: 999px;
  background: var(--white);
  color: var(--black);
  font-weight: var(--medium);
  font-size: 14px;
  line-height: 20px;
  transition: border-color var(--transition);
}

.crumb:hover {
  color: var(--black);
  border-color: var(--blue);
}

.crumb__label {
  font-weight: normal;
  font-size: 12px;
  color: var(--black70);
}

/* Headings, as the site sets its section titles */

.heading {
  margin: 0 0 8px;
  font-weight: var(--semibold);
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -0.01em;
  text-align: center;
}

.lede {
  margin: 0 auto;
  max-width: 560px;
  color: var(--black70);
  text-align: center;
}

.heading + .tiles,
.heading + .panel,
.lede + .tiles,
.lede + .panel,
.lede + .questions {
  margin-top: 32px;
}

.panel {
  background: var(--white);
  border-radius: var(--borderRadius);
}

/* Tiles: devices, models, variants, colors */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.tiles--devices {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.tiles--options {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 20px 12px 18px;
  background: var(--white);
  border-radius: var(--borderRadius);
  color: var(--black);
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.tile:hover {
  color: var(--black);
  box-shadow: var(--shadowHover);
  transform: translateY(-2px);
}

.tile--picked,
.tile--picked:hover {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.tile__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  margin-bottom: 12px;
}

.tile__media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tiles--devices .tile { padding: 28px 16px 24px; }
.tiles--devices .tile__media { height: 160px; }
.tiles--devices .tile__name { font-size: 19px; }

.tile__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--semibold);
  font-size: 17px;
  line-height: 22px;
}

.tile__note {
  font-size: 13px;
  line-height: 18px;
  color: var(--black70);
}

.tile--option {
  justify-content: center;
  padding: 24px 12px;
  min-height: 96px;
}

.tile__value {
  font-weight: var(--semibold);
  font-size: 21px;
  line-height: 26px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  flex: none;
}

/* Qualities: a list in one panel, as the site's payment options */

.grades {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}

.grades > li + li { border-top: 1px solid var(--separator); }

.grade {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 24px;
  color: var(--black);
  transition: background var(--transition);
}

.grade:hover {
  color: var(--black);
  background: #fafafa;
}

.grade__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grayBg);
  font-weight: var(--semibold);
  font-size: 19px;
}

.grade--picked .grade__letter {
  background: var(--blue);
  color: var(--white);
}

.grade__name {
  display: block;
  font-weight: var(--semibold);
  line-height: 40px;
}

.grade__criteria {
  font-size: 15px;
  line-height: 21px;
  color: var(--black70);
}

.grade__criteria li {
  position: relative;
  padding-left: 14px;
}

.grade__criteria li + li { margin-top: 4px; }

.grade__criteria li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--black50);
}

.grade__price {
  font-weight: var(--semibold);
  line-height: 40px;
  white-space: nowrap;
  text-align: right;
}

.grade__up-to {
  font-weight: normal;
  font-size: 13px;
  color: var(--black70);
}

/* Defects: a panel per question, answers as rows to tap */

.questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.question {
  margin: 0;
  padding: 24px;
  border: 0;
  min-width: 0;
}

.question__text {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  font-weight: var(--semibold);
  font-size: 19px;
  line-height: 24px;
}

.question__hint {
  clear: both;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 21px;
}

.question__hint summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: var(--medium);
}

.question__hint p {
  margin: 8px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--grayBg);
  color: var(--black70);
}

.answers {
  clear: both;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--borderColor);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.answer:hover { border-color: var(--blue); }

.answer:has(input:checked) {
  border-color: var(--blue);
  background: var(--inputOverlay);
}

.answer input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue);
  flex: none;
}

/* Buttons, as the site's .btn */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  min-width: 250px;
  padding: 0 32px;
  border: 0;
  border-radius: 25px;
  background: var(--blue);
  color: var(--white);
  font: var(--semibold) 17px/20px var(--font);
  box-shadow: 0 12px 20px 0 rgba(0, 114, 229, 0.2);
  cursor: pointer;
  transition: background var(--transition);
}

.button:hover {
  background: var(--blueHover);
  color: var(--white);
}

.button--secondary {
  background: var(--white);
  color: var(--black);
  box-shadow: inset 0 0 0 1px var(--black);
}

.button--secondary:hover {
  background: var(--black);
  color: var(--white);
}

.questions .button {
  align-self: center;
  margin-top: 20px;
}

/* The estimate */

.offer {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  overflow: hidden;
}

.offer__device {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 24px;
  border-right: 1px solid var(--separator);
}

.offer__device img {
  width: 100%;
  max-width: 220px;
  max-height: 260px;
  object-fit: contain;
}

.offer__name {
  margin: 0;
  font-weight: var(--semibold);
  text-align: center;
}

.offer__value {
  padding: 40px 40px 32px;
}

.offer__label {
  margin: 0;
  font-weight: var(--medium);
  font-size: 17px;
  color: var(--black70);
}

.offer__price {
  margin: 4px 0 16px;
  font-weight: var(--semibold);
  font-size: 56px;
  line-height: 62px;
  letter-spacing: -0.02em;
  color: var(--blue);
}

.offer__refused {
  margin: 0 0 8px;
  font-weight: var(--semibold);
  font-size: 28px;
  line-height: 34px;
}

.offer__moved {
  margin: 0 0 16px;
  font-size: 15px;
}

.offer__moved strong {
  font-weight: var(--semibold);
}

.breakdown {
  margin: 0 0 16px;
  font-size: 15px;
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--separator);
}

.breakdown dd {
  margin: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.offer__disclaimer {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--black70);
}

.checks {
  margin-top: 12px;
  padding: 28px 32px;
}

.checks__heading {
  margin: 0 0 16px;
  font-weight: var(--semibold);
  font-size: 21px;
  line-height: 26px;
}

.checks li {
  position: relative;
  padding-left: 32px;
  font-size: 15px;
  line-height: 21px;
}

.checks li + li { margin-top: 12px; }

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--inputOverlay);
}

.checks li::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(45deg);
}

.actions {
  margin: 32px 0 0;
  text-align: center;
}

/* When the visitor has to start over */

.problem {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 40px 24px;
  text-align: center;
}

.problem__heading {
  margin: 0 0 8px;
  font-weight: var(--semibold);
  font-size: 24px;
  line-height: 30px;
}

.problem .button { margin-top: 24px; }

@media (min-width: 734px) {
  .wizard { padding: 48px 30px 64px; }
  .heading { font-size: 40px; line-height: 48px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .tiles--options { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .tile__media { height: 160px; }
  .tiles--devices .tile__media { height: 200px; }
}

@media (max-width: 733px) {
  .offer { grid-template-columns: 1fr; }
  .offer__device {
    flex-direction: row;
    justify-content: flex-start;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--separator);
  }
  .offer__device img { width: 64px; height: 64px; }
  .offer__name { text-align: left; }
  .offer__value { padding: 24px 20px; }
  .offer__price { font-size: 44px; line-height: 50px; }
  .grade { grid-template-columns: auto 1fr; padding: 20px; }
  .grade__price { grid-column: 2; text-align: left; line-height: 24px; }
  .question, .checks { padding: 20px; }
  .button { width: 100%; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .tile, .tile:hover { transition: none; transform: none; }
}
