/* The finish picker (.fp): compact toggles, about five options per row.
   Shared by the visualiser and the example kitchen. Tokens from site.css. */

.fp { display: grid; gap: var(--space-3); min-width: 0; }

.fp-group {
  border-radius: var(--radius-lg); background: #fff; min-width: 0;
  box-shadow: var(--glow, 0 0 0 1px var(--c-line));
  transition: box-shadow .2s ease;
}
.fp-group[open] { box-shadow: var(--glow-strong, 0 0 0 2px var(--c-teal)); }

/* The toggle's head: label, the current choice's thumbnail and name, a chevron. */
.fp-sum {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); min-height: 4.25rem; cursor: pointer; list-style: none;
  border-radius: var(--radius-lg);
}
.fp-sum::-webkit-details-marker { display: none; }
.fp-sum::marker { content: ''; }
.fp-sum:hover { background: var(--c-grey-50); }
.fp-sum:focus-visible { outline: none; box-shadow: var(--focus); }
.fp-group[open] > .fp-sum { border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--c-teal-soft); }
.fp-sum__text { display: grid; gap: 2px; min-width: 0; }
.fp-sum__label { font-weight: 750; font-size: 1.0625rem; color: var(--c-ink); line-height: 1.2; }
.fp-sum__hint { font-size: .8125rem; color: var(--c-muted); line-height: 1.3; }
.fp-sum__pick { display: flex; align-items: center; gap: var(--space-2); min-width: 0; max-width: 15rem; justify-self: end; }
.fp-sum__img {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 8px; object-fit: cover;
  background: var(--c-grey-100); box-shadow: 0 0 0 1px var(--c-line);
}
.fp-sum__img[hidden] { display: none; }
.fp-sum__name {
  font-size: .875rem; font-weight: 650; color: var(--c-ink-2); line-height: 1.25; text-align: right;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.fp-sum__chev {
  flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--c-teal-soft);
  display: grid; place-items: center; transition: transform .2s ease, background-color .2s ease;
}
.fp-sum__chev::before {
  content: ''; width: .5rem; height: .5rem; margin-top: -.2rem;
  border-right: 2px solid var(--c-teal-deep); border-bottom: 2px solid var(--c-teal-deep); transform: rotate(45deg);
}
.fp-group[open] .fp-sum__chev { transform: rotate(180deg); background: #fff; }

/* Inside an open toggle */
.fp-body { display: grid; gap: var(--space-4); padding: var(--space-4); border-top: 1px solid var(--c-line); }
.fp-set { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: var(--space-2); }
.fp-set[hidden], .fp-top[hidden], .fp-colours[hidden] { display: none; }
.fp-legend { padding: 0; margin-bottom: var(--space-2); font-weight: 750; font-size: .9375rem; color: var(--c-ink); }
.fp-legend__note { font-weight: 500; color: var(--c-muted); font-size: .8125rem; margin-left: var(--space-2); }
.fp-colours { display: grid; gap: var(--space-2); }
.fp-colours + .fp-colours { margin-top: var(--space-3); }
.fp-colours__design { margin: 0; font-size: .8125rem; font-weight: 700; color: var(--c-ink-2); }
.fp--js .fp-colours__design { display: none; }
.fp--js .fp-colours + .fp-colours { margin-top: 0; }
.fp-top { display: grid; gap: var(--space-4); }
/* The likes form (contact page). */
.fp--likes .fp-likes-designs { padding-bottom: var(--space-3); border-bottom: 1px dashed var(--c-line); }
.fp--likes .fp-colours__design { padding: 0; margin-bottom: var(--space-2); }
/* The design row only chooses which colours show, so it carries no tick: ticks mean a liked colour. */
.fp--likes .fp-likes-designs .fp-opt__input:checked + .fp-opt__frame::after { display: none; }

/* Options: about five to a row, four on a narrow phone. */
.fp-grid { display: grid; gap: var(--space-3) var(--space-2); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 480px) { .fp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.fp-opt {
  position: relative; display: grid; gap: 4px; align-content: start; min-width: 0; cursor: pointer;
  font-size: .75rem; line-height: 1.25; color: var(--c-ink); text-align: center;
}
.fp-opt__input { position: absolute; top: 0; left: 0; opacity: 0; width: 1px; height: 1px; margin: 0; }
.fp-opt__frame {
  position: relative; display: block; border-radius: 10px; overflow: hidden; background: var(--c-grey-100);
  box-shadow: var(--glow, 0 0 0 1px var(--c-line)); transition: box-shadow .15s ease, transform .15s ease;
}
.fp-opt__img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.fp-opt:hover .fp-opt__frame { box-shadow: var(--glow-strong, 0 0 0 2px var(--c-teal)); }
.fp-opt__input:checked + .fp-opt__frame { box-shadow: 0 0 0 3px var(--c-teal), 0 0 18px -2px var(--c-teal); }
.fp-opt__input:checked + .fp-opt__frame::after {
  content: ''; position: absolute; top: 4px; right: 4px; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: var(--c-teal-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 70% no-repeat;
  box-shadow: 0 0 0 2px #fff;
}
.fp-opt__input:focus-visible + .fp-opt__frame { box-shadow: var(--focus); }
.fp-opt__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; overflow-wrap: anywhere; }
.fp-opt__input:checked ~ .fp-opt__name { font-weight: 750; color: var(--c-teal-deep); }
.fp-opt__meta { font-size: .6875rem; color: var(--c-muted); }

/* Top doors: same as bottom, or different */
.fp-modes { display: grid; gap: var(--space-2); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) { .fp-modes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.fp-mode { position: relative; display: block; cursor: pointer; }
.fp-mode__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.fp-mode__text {
  display: flex; align-items: center; gap: var(--space-2); min-height: 3rem; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius); background: #fff; font-weight: 650; font-size: .9375rem; color: var(--c-ink);
  box-shadow: var(--glow, 0 0 0 1px var(--c-line)); transition: box-shadow .15s ease, background-color .15s ease;
}
.fp-mode__text::before {
  content: ''; flex: none; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid var(--c-grey-400); background: #fff;
}
.fp-mode:hover .fp-mode__text { box-shadow: var(--glow-strong, 0 0 0 2px var(--c-teal)); }
.fp-mode__input:checked + .fp-mode__text { background: var(--c-teal-soft); box-shadow: var(--glow-strong, 0 0 0 2px var(--c-teal)); }
.fp-mode__input:checked + .fp-mode__text::before { border-color: var(--c-teal-deep); background: radial-gradient(circle, var(--c-teal-deep) 0 45%, #fff 50%); }
.fp-mode__input:focus-visible + .fp-mode__text { box-shadow: var(--focus); }

@media (max-width: 420px) {
  .fp-sum { padding: var(--space-3); gap: var(--space-2); }
  .fp-sum__hint { display: none; }
  .fp-sum__pick { max-width: 10.5rem; }
  .fp-sum__name { font-size: .8125rem; }
  .fp-body { padding: var(--space-3); }
}

@media (prefers-reduced-motion: reduce) {
  .fp-group, .fp-sum__chev, .fp-opt__frame, .fp-mode__text { transition: none; }
}

/* V2.1: keep the next step visible, with its reason, until it unlocks. */
.fp [hidden] { display: none; }
.fp-group[data-fp-disabled] { box-shadow: 0 0 0 1px var(--c-line); background: var(--c-grey-50); }
.fp-group[data-fp-disabled] > .fp-sum { cursor: not-allowed; }
.fp-group[data-fp-disabled] .fp-sum__label,
.fp-group[data-fp-disabled] .fp-sum__name { color: var(--c-muted); }
.fp-group[data-fp-disabled] .fp-sum__chev { opacity: .4; }
.fp-modes { gap: 6px; }
.fp-group[data-fp-group="bottom"] .fp-opt__name,
.fp-group[data-fp-group="top"] .fp-opt__name { display: block; -webkit-line-clamp: unset; }
.fp-mode__text { font-size: .8125rem; line-height: 1.3; min-height: 2.75rem; padding: 8px 10px; }
.fp-mode__text::before { width: .9rem; height: .9rem; }
@media (max-width: 420px) {
  .fp-group[data-fp-disabled] .fp-sum__hint { display: block; }
  .fp-sum { grid-template-columns: minmax(5rem, 1fr) minmax(0, 1.6fr) auto; }
  .fp-sum__label { font-size: .9375rem; }
  .fp-modes { grid-template-columns: 1fr 1fr; }
}
