/**
 * Shoe Finder – PUMA Brand
 * Typography: FF DIN for PUMA only (Bold Condensed, Light, Regular, Bold).
 * Primary palette: PUMA RED, BLACK, WHITE.
 */
@font-face {
  font-family: "FF DIN for PUMA";
  src: url('../font/FFDINforPUMA-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Add Light, Regular, Bold Condensed @font-face here when webfont files are available */

:root {
  /* Corporate typography – FF DIN for PUMA only */
  --sf-font: "FF DIN for PUMA", "FFDINforPUMA", sans-serif;

  /* Primary palette */
  --puma-red: #FF0000;
  --puma-black: #000000;
  --puma-white: #FFFFFF;
  --puma-green: #006241; /* Sportstyle / Archive only */

  /* Application usage – white screen theme */
  --sf-bg: var(--puma-white);
  --sf-bg-card: #f0f0f0;
  --sf-text: var(--puma-black);
  --sf-text-muted: rgba(0, 0, 0, 0.75);
  --sf-accent: var(--puma-red);
  --sf-border: rgba(0, 0, 0, 0.2);
  --sf-border-strong: rgba(0, 0, 0, 0.5);

  /* Neutrals (Cool Gray approx) */
  --sf-neutral-dark: #2d2d2d;
  --sf-neutral-mid: #5c5c5c;
  --sf-neutral-light: #e5e5e5;
}

/* Iframe-friendly: fill container so app aligns to iframe size when embedded */
html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html *,
html *::before,
html *::after {
  box-sizing: inherit;
}

.sf-body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 100%;
  /* Fill iframe when embedded; fallback for standalone */
  min-height: 100vh;
  min-height: 100%;
  height: auto;
  background-color: var(--sf-bg);
  font-family: var(--sf-font);
  color: var(--sf-text);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* When embedded in iframe, parent typically sets iframe height; html gets that via 100% */
body.embedded {
  min-height: 100%;
}

.sf-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 24px) clamp(60px, 10vw, 80px);
  flex: 1 0 auto;
  text-align: center;
}

/* Vertically center the Get Started (welcome) block on the first page */
.sf-container:has(> .sf-welcome) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100%;
}

/* Option screens: subtle depth behind content (classy lift) */
.sf-container:has(> .sf-progress-wrap) {
  position: relative;
}

.sf-container:has(> .sf-progress-wrap)::before {
  content: "";
  position: absolute;
  inset: -20px -12px -24px;
  background: radial-gradient(ellipse 75% 50% at 50% 30%, rgba(0, 0, 0, 0.04) 0%, transparent 65%);
  pointer-events: none;
  z-index: -1;
}

/* Progress */
.sf-progress-wrap {
  margin-bottom: clamp(20px, 3vw, 32px);
  animation: sf-welcome-fade-in 0.5s ease-out both;
}

.sf-progress-label {
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: bold;
  color: var(--sf-text);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
}

.sf-progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--sf-bg-card);
  border-radius: 3px;
  overflow: hidden;
}

.sf-progress-fill {
  height: 100%;
  background-color: var(--sf-accent);
  transition: width 0.4s ease;
}

/* Question */
.sf-question {
  font-size: clamp(22px, 5vw, 44px);
  font-weight: bold;
  color: var(--sf-text);
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 40px);
  line-height: 1.2;
  padding: 0 8px;
  animation: sf-welcome-fade-in 0.5s ease-out 0.08s both;
}

/* Options – horizontal cards with image + label */
.sf-options {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2.5vw, 24px);
  justify-content: center;
  margin-bottom: clamp(32px, 5vw, 48px);
  animation: sf-welcome-fade-in 0.5s ease-out 0.16s both;
}

/* Staggered entrance for each option card (non-size only) */
.sf-options:not(.sf-options--size) .sf-option-card {
  animation: sf-welcome-fade-in 0.45s ease-out both;
}

.sf-options:not(.sf-options--size) .sf-option-card:nth-child(1) { animation-delay: 0.22s; }
.sf-options:not(.sf-options--size) .sf-option-card:nth-child(2) { animation-delay: 0.28s; }
.sf-options:not(.sf-options--size) .sf-option-card:nth-child(3) { animation-delay: 0.34s; }
.sf-options:not(.sf-options--size) .sf-option-card:nth-child(4) { animation-delay: 0.40s; }
.sf-options:not(.sf-options--size) .sf-option-card:nth-child(5) { animation-delay: 0.46s; }
.sf-options:not(.sf-options--size) .sf-option-card:nth-child(6) { animation-delay: 0.52s; }

.sf-option-card {
  flex: 1 1 260px;
  min-width: 0;
  max-width: 320px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--sf-bg-card);
  border: 1px solid var(--sf-border);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sf-option-card:hover {
  border-color: var(--sf-border-strong);
  transform: translateY(-6px) scale(1.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15);
}

.sf-option-card.selected {
  border-color: var(--sf-border);
  border-width: 1px;
  border-bottom: 4px solid var(--puma-red);
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: scale(1.02);
}

.sf-option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sf-option-card .sf-option-img-wrap {
  aspect-ratio: 1;
  background: var(--sf-bg);
  overflow: hidden;
  position: relative;
  display: block;
}

.sf-option-card .sf-option-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Full-bleed card: label overlaid at bottom, white uppercase */
.sf-option-card .sf-option-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(12px, 2vw, 20px) clamp(8px, 1.5vw, 12px);
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--puma-white);
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.sf-option-card.selected .sf-option-label {
  color: var(--puma-white);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
}

.sf-option-card .sf-option-check {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--puma-red);
  color: var(--puma-white);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.4);
}

.sf-option-card.selected .sf-option-check {
  display: flex;
}

/* Size step – title and subtitle (Select Your Size) */
.sf-size-title {
  margin-bottom: 8px;
}
.sf-size-subtitle {
  color: var(--sf-text-muted);
  font-size: clamp(15px, 2vw, 17px);
  margin: 0 0 12px;
  font-weight: normal;
}
.sf-size-find-link-wrap,
.sf-size-chart-link-wrap {
  margin: 0 0 clamp(20px, 3vw, 28px);
  text-align: center;
}
.sf-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sf-font);
  font-size: clamp(14px, 2vw, 16px);
  padding: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.sf-size-find-link {
  color: var(--puma-red);
  font-weight: bold;
}
.sf-size-find-link:hover {
  text-decoration: underline;
}
.sf-size-find-link .fa-arrow-right {
  font-size: 0.85em;
  margin-left: 2px;
}
.sf-size-chart-link {
  color: var(--sf-text-muted);
}
.sf-size-chart-link:hover {
  color: var(--puma-black);
  text-decoration: underline;
}

/* Size selection – compact chip grid (image 2 style). Unselected: white + grey border; selected: black bg + white text. */
.sf-options--size {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px 12px;
  justify-content: center;
  margin-bottom: 16px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.sf-options--size .sf-option-card {
  flex: none;
  min-width: 0;
  max-width: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--puma-white);
  border: 1px solid var(--sf-neutral-light);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.sf-options--size .sf-option-card:hover {
  border-color: var(--sf-neutral-mid);
}

.sf-options--size .sf-option-card.selected {
  background: var(--puma-black);
  border-color: var(--puma-black);
  border-width: 1px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sf-options--size .sf-option-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: auto;
  min-height: 40px;
  background: transparent;
}

.sf-options--size .sf-option-img-wrap img {
  display: none;
}

.sf-options--size .sf-option-label {
  position: static;
  padding: 10px 6px;
  font-size: clamp(13px, 2.5vw, 15px);
  font-weight: bold;
  text-align: center;
  color: var(--puma-black);
  background: none;
  text-shadow: none;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap; /* keep e.g. “UK 11” on one line */
}

.sf-options--size .sf-option-card.selected .sf-option-label {
  color: var(--puma-white);
}

.sf-options--size .sf-option-card.selected .sf-option-img-wrap {
  background: transparent;
}

/* Hide checkmark on size step to avoid overlap with label (selected state is black bg + white text only) */
/* Size step: small red checkmark on selected chip (top-right, smaller than default) */
.sf-options--size .sf-option-card .sf-option-check {
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  font-size: 9px;
  box-shadow: 0 1px 4px rgba(255, 0, 0, 0.4);
}
/* Gender: vertical rectangle cards so all 3 fit in one line on mobile */
.sf-options--gender {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2.5vw, 24px);
  justify-content: center;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.sf-options--gender .sf-option-card {
  flex: none;
  min-width: 0;
  max-width: 200px;
}

.sf-options--gender .sf-option-img-wrap {
  aspect-ratio: 2 / 3;
  min-height: 140px;
}

.sf-options--gender .sf-option-img-wrap img {
  object-fit: cover;
  object-position: center;
  /* Sharper rendering when scaled: promote to own layer, avoid subpixel blur */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Colour: show full image in card, avoid zoomed/cropped look from object-fit: cover */
.sf-options--colour .sf-option-img-wrap img {
  object-fit: contain;
  object-position: center;
}

/* Desktop: keep all non-size options in a single row when space allows */
@media (min-width: 1024px) {
  .sf-options:not(.sf-options--size):not(.sf-options--gender) {
    flex-wrap: nowrap;
    justify-content: center;
  }

  .sf-options:not(.sf-options--size):not(.sf-options--gender) .sf-option-card {
    flex: 0 0 23%;
    max-width: 23%;
  }

  .sf-options--gender {
    grid-template-columns: repeat(3, 1fr);
    max-width: 480px;
  }

  .sf-options--gender .sf-option-card {
    max-width: none;
  }
}

/* Navigation – below options, Back left / Next right, no overlap */
.sf-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(24px, 4vw, 40px);
  padding-top: clamp(16px, 3vw, 24px);
  border-top: 2px solid var(--sf-accent);
  animation: sf-welcome-fade-in 0.5s ease-out 0.24s both;
}

/* Respect reduced motion on option screens */
@media (prefers-reduced-motion: reduce) {
  .sf-progress-wrap,
  .sf-question,
  .sf-options,
  .sf-options:not(.sf-options--size) .sf-option-card,
  .sf-nav {
    animation: none;
  }
}

.sf-nav .sf-btn-results-wrap {
  order: 2;
  margin-left: auto;
}

.sf-nav-left {
  order: 1;
  display: flex;
  gap: 12px;
}

.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(12px, 2vw, 14px) clamp(20px, 4vw, 28px);
  font-size: clamp(16px, 2.2vw, 18px);
  font-weight: bold;
  border-radius: 0;
  border: 1px solid;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  font-family: var(--sf-font);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

/* Back control – icon + previous step name + "Back" (text-only, no button chrome) */
.sf-btn-back {
  background: transparent;
  color: var(--puma-black);
  border: none;
  padding: 0;
  min-height: auto;
  cursor: pointer;
  align-items: flex-start;
  justify-content: flex-start;
}

.sf-btn-back .sf-btn-back-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.sf-btn-back .fa-arrow-left {
  font-size: 18px;
  margin-bottom: 2px;
}

.sf-btn-back .sf-btn-back-screen {
  display: block;
  font-size: clamp(15px, 1.8vw, 17px);
  font-weight: bold;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
}

.sf-btn-back .sf-btn-back-label {
  display: block;
  font-size: 12px;
  font-weight: normal;
  opacity: 0.9;
  text-transform: none;
  letter-spacing: normal;
}

.sf-btn-back:hover {
  background: transparent;
  color: var(--puma-black);
}

.sf-btn-skip {
  background: transparent;
  color: var(--sf-text-muted);
  border-color: transparent;
  text-decoration: underline;
}

.sf-btn-skip:hover {
  color: var(--sf-text);
}

/* Final CTA on last step: See My Recommendations – GET STARTED style (white, black border, red line above) */
.sf-btn-results {
  background: var(--puma-white);
  color: var(--puma-black);
  border: 1px solid var(--puma-black);
  border-radius: 0;
  padding: clamp(14px, 2vw, 16px) clamp(24px, 4vw, 32px);
  font-weight: bold;
  letter-spacing: 0.02em;
}

.sf-btn-results:hover {
  background: var(--puma-black);
  color: var(--puma-white);
  border-color: var(--puma-white);
}

.sf-btn-results:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modals – Find my size & Size chart */
.sf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sf-modal[hidden] {
  display: none;
}
.sf-modal.sf-modal-open {
  display: flex;
}
.sf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.sf-modal-content {
  position: relative;
  background: var(--puma-white);
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.sf-modal-content--wide {
  max-width: 520px;
}

/* Recommendations popup (size step): centered CTA */
.sf-modal-content--recommendations {
  text-align: center;
  max-width: 360px;
}
.sf-recommendations-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: bold;
  color: var(--puma-black);
}
.sf-recommendations-text {
  margin: 0 0 20px;
  font-size: 16px;
  color: var(--sf-text-muted);
}
.sf-modal-content--recommendations .sf-btn-results {
  width: 100%;
}
.sf-recommendations-start-again {
  margin: 16px 0 0;
  padding: 0;
}
.sf-start-again-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sf-font);
  font-size: 14px;
  color: var(--sf-text-muted);
  cursor: pointer;
  text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
}
.sf-start-again-btn:hover {
  color: var(--puma-black);
}

/* Size guide modal header: title left, close (X) right, separator, subtitle */
.sf-size-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sf-size-guide-title {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: var(--puma-black);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sf-size-guide-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--puma-black);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  border-radius: 4px;
}
.sf-size-guide-close:hover {
  background: var(--sf-neutral-light);
  color: var(--puma-black);
}
.sf-size-guide-separator {
  height: 1px;
  background: var(--sf-neutral-light);
  margin: 12px 0 16px;
}
.sf-size-guide-subtitle {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: normal;
  color: var(--puma-black);
}

.sf-modal-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: bold;
  color: var(--puma-black);
}
.sf-modal-note {
  font-size: 14px;
  color: var(--sf-text-muted);
  margin: 0 0 16px;
}
.sf-find-size-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.sf-find-size-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  font-weight: bold;
  color: var(--puma-black);
}
.sf-find-size-field input {
  padding: 10px 12px;
  border: 1px solid var(--sf-border);
  border-radius: 4px;
  font-family: var(--sf-font);
  font-size: 16px;
}
.sf-find-size-result {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: bold;
  color: var(--puma-red);
  min-height: 1.5em;
}
.sf-modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.sf-modal-btn-primary {
  background: var(--puma-red);
  color: var(--puma-white);
  border-color: var(--puma-red);
}
.sf-modal-btn-primary:hover {
  background: #cc0000;
  border-color: #cc0000;
  color: var(--puma-white);
}
.sf-modal-btn-secondary {
  background: var(--puma-white);
  color: var(--puma-black);
  border-color: var(--sf-border);
}
.sf-size-chart-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}
.sf-size-chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--puma-white);
}
.sf-size-chart-table th,
.sf-size-chart-table td {
  padding: 12px 16px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  vertical-align: middle;
}
.sf-size-chart-table th {
  background: var(--puma-white);
  font-weight: bold;
  color: var(--puma-black);
}
#sf-size-chart-modal .sf-size-chart-table th.sf-size-chart-th--normal {
  font-weight: 400 !important;
}
.sf-size-chart-table tbody tr {
  background: var(--puma-white);
}
.sf-size-chart-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}
.sf-size-chart-table td {
  color: var(--puma-black);
}

/* Result page */
.sf-result-page {
  padding: 40px 20px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.sf-result-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: bold;
  color: var(--sf-text);
  text-align: center;
  margin-bottom: 32px;
}

.sf-result-fallback {
  text-align: center;
  color: var(--sf-text-muted);
  font-size: 20px;
  margin-bottom: 24px;
}

.sf-result-products {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.sf-product-card {
  background: var(--sf-bg-card);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--sf-border);
}

.sf-product-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.sf-product-card .sf-product-img {
  aspect-ratio: 1;
  background: var(--sf-bg);
  overflow: hidden;
}

.sf-product-card .sf-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sf-product-card .sf-product-name {
  padding: 16px;
  font-size: 18px;
  font-weight: bold;
  color: var(--sf-text);
  text-align: center;
}

.sf-back-home {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 24px;
  background: var(--puma-white);
  color: var(--puma-black);
  border: 1px solid var(--puma-black);
  border-radius: 0;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.sf-back-home:hover {
  background: var(--sf-neutral-light);
  color: var(--puma-black);
}

/* Welcome / start – first page (Get Started): classy entrance and depth */

@keyframes sf-welcome-fade-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sf-accent-draw {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.sf-welcome {
  text-align: center;
  padding: 48px 24px 56px;
  background: transparent;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

/* Subtle depth: soft shadow behind content (classy lift) */
.sf-welcome::before {
  content: "";
  position: absolute;
  inset: -24px -16px -32px;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 0, 0, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.sf-welcome h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: bold;
  color: var(--puma-black);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  animation: sf-welcome-fade-in 0.6s ease-out both;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sf-welcome p {
  color: var(--sf-text-muted);
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.5;
  margin: 0 0 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  animation: sf-welcome-fade-in 0.6s ease-out 0.12s both;
}

/* Accent line: draws in after tagline */
.sf-welcome p::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--puma-red);
  margin: 24px auto 0;
  transform-origin: center;
  animation: sf-accent-draw 0.5s ease-out 0.35s both;
}

.sf-welcome form {
  animation: sf-welcome-fade-in 0.6s ease-out 0.24s both;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sf-welcome h1,
  .sf-welcome p,
  .sf-welcome p::after,
  .sf-welcome form {
    animation: none;
  }
}

.sf-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  font-size: clamp(16px, 2vw, 18px);
  font-weight: bold;
  border-radius: 2px;
  background: var(--puma-white);
  color: var(--puma-black);
  border: 1px solid var(--puma-black);
  cursor: pointer;
  font-family: var(--sf-font);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sf-start-btn i {
  font-size: 0.95em;
}

.sf-start-btn:hover {
  background: var(--puma-black);
  color: var(--puma-white);
  border-color: var(--puma-black);
}

.sf-start-btn:focus-visible {
  outline: 2px solid var(--puma-red);
  outline-offset: 3px;
}

/* Step screen – hide all, show current */
.sf-step {
  display: none;
}

.sf-step.active {
  display: block;
}

/* Placeholder image when file missing */
.sf-option-img-wrap img[src=""],
.sf-option-img-wrap img:not([src]) {
  display: none;
}

.sf-option-img-wrap:has(img[src=""]),
.sf-option-img-wrap:has(img:not([src])) {
  background: var(--sf-bg);
}

/* ========== Large desktop (e.g. 1920×1080) – fit to screen, avoid zoomed/clipped view ========== */
@media (min-width: 1024px) and (max-height: 1080px) {
  .sf-container {
    padding: clamp(16px, 2vw, 24px) clamp(16px, 3vw, 24px) clamp(32px, 5vw, 48px);
  }

  .sf-progress-wrap {
    margin-bottom: clamp(12px, 2vw, 20px);
  }

  .sf-progress-label {
    font-size: clamp(13px, 1.8vw, 16px);
  }

  .sf-question {
    font-size: clamp(20px, 3.5vw, 32px);
    margin-bottom: clamp(16px, 2.5vw, 24px);
  }

  .sf-options:not(.sf-options--size) {
    gap: clamp(10px, 2vw, 16px);
    margin-bottom: clamp(20px, 3vw, 32px);
  }

  .sf-options:not(.sf-options--size) .sf-option-card {
    max-width: 260px;
  }

  .sf-option-card .sf-option-label {
    padding: clamp(10px, 1.5vw, 14px);
    font-size: clamp(13px, 1.6vw, 16px);
  }

  .sf-nav {
    margin-top: clamp(16px, 2.5vw, 24px);
    padding-top: clamp(12px, 2vw, 16px);
  }

  .sf-btn {
    padding: clamp(10px, 1.5vw, 12px) clamp(16px, 3vw, 22px);
    font-size: clamp(14px, 1.8vw, 16px);
    min-height: 44px;
  }
}

/* ========== Responsive & mobile-friendly ========== */
/* Mobile: 2 option blocks per row so they fit in one frame */
@media (max-width: 768px) {
  .sf-options:not(.sf-options--size) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-items: stretch;
    margin-bottom: clamp(24px, 4vw, 40px);
  }

  /* Style preference: vertical stack, fit both on one screen */
  .sf-options.sf-options--style {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 12px;
    justify-items: center;
  }

  .sf-options--style .sf-option-card {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    flex: none;
  }

  .sf-options--style .sf-option-img-wrap {
    aspect-ratio: 1;
    min-height: 0;
    max-height: min(35vh, 220px);
  }

  /* Gender: vertical stack, card size = image size, centered */
  .sf-options.sf-options--gender {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 12px;
    justify-items: center;
  }

  .sf-options--gender .sf-option-card {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    flex: none;
  }

  .sf-options--gender .sf-option-img-wrap {
    display: block;
    width: auto;
    height: min(22vh, 140px);
    aspect-ratio: 2 / 3;
    min-height: 0;
  }

  .sf-options:not(.sf-options--size) .sf-option-card {
    flex: none;
    min-width: 0;
    max-width: none;
  }

  .sf-options:not(.sf-options--size):not(.sf-options--gender):not(.sf-options--style) .sf-option-img-wrap {
    min-height: 80px;
    aspect-ratio: 1;
  }

  /* Colour: 3 columns, 2 rows; flexbox so row 2’s two cards are centered */
  .sf-options.sf-options--colour {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: clamp(20px, 4vw, 36px);
  }

  .sf-options--colour .sf-option-card {
    flex: 0 0 calc((100% - 16px) / 3);
    min-width: 0;
    max-width: min(calc((100% - 16px) / 3), 120px);
  }

  .sf-options--colour .sf-option-img-wrap {
    aspect-ratio: 1;
    max-height: 100px;
    min-height: 0;
  }

  .sf-options--colour .sf-option-img-wrap img {
    object-fit: contain;
    object-position: center;
  }

  /* When last row has a single card (e.g. other steps with 5 options), center it */
  .sf-options:not(.sf-options--size):not(.sf-options--gender):not(.sf-options--colour) .sf-option-card:nth-child(odd):last-child {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: calc((100% - 10px) / 2);
  }

  .sf-options:not(.sf-options--size) .sf-option-label {
    padding: 10px 6px;
    font-size: clamp(11px, 2.8vw, 14px);
    text-align: center;
  }

  .sf-options {
    gap: 10px;
  }

  .sf-option-card {
    flex: 1 1 140px;
    max-width: 180px;
  }

  /* Size grid – mobile: 3 columns, compact chips (image 2 style) */
  .sf-options--size {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 100%;
    padding: 0 4px;
  }

  .sf-options--size .sf-option-card {
    min-height: 44px;
    max-height: none;
  }

  .sf-options--size .sf-option-label {
    padding: 8px 4px;
    font-size: 14px;
  }

  .sf-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .sf-nav .sf-btn-results-wrap {
    order: 0;
    margin-left: 0;
    width: 100%;
  }
  .sf-nav .sf-btn-results-wrap .sf-btn-results {
    width: 100%;
  }

  .sf-nav-left {
    order: 1;
    justify-content: center;
    gap: 8px;
  }

  .sf-nav-left .sf-btn {
    flex: 1;
    min-width: 0;
  }

  .sf-welcome {
    padding: 40px 16px;
  }

  .sf-welcome h1 {
    font-size: clamp(28px, 8vw, 40px);
  }

  .sf-welcome p {
    font-size: 16px;
  }

  .sf-start-btn {
    padding: 14px 32px;
    font-size: 18px;
    min-height: 48px;
  }

  .sf-result-products {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sf-result-page {
    padding: 24px 16px 60px;
  }
}

/* Tablet: 6 columns (2 rows) before switching to single line on desktop */
/* Very small phones: keep 3 columns for size (same as shared layout) */
@media (max-width: 400px) {
  .sf-options--size {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .sf-options--size {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px 12px;
    max-width: 420px;
  }

  .sf-options--size .sf-option-card {
    min-height: 44px;
  }

  .sf-options--size .sf-option-label {
    font-size: 14px;
  }
}

/* Desktop: all sizes in one horizontal row; larger chips for clearer tap/click targets */
@media (min-width: 1024px) {
  .sf-options--size {
    grid-template-columns: repeat(12, 1fr);
    gap: 14px 18px;
    max-width: 1040px;
  }

  .sf-options--size .sf-option-card {
    min-height: 64px;
    max-height: 70px;
  }

  .sf-options--size .sf-option-label {
    font-size: 18px;
    padding: 18px 14px;
  }
}

/* Desktop: colour step – keep all 5 cards neatly inside the red baseline */
@media (min-width: 1024px) {
  .sf-options.sf-options--colour {
    max-width: 1000px; /* slightly narrower than container so cards sit inside red line */
    margin-left: auto;
    margin-right: auto;
    justify-content: space-between;
  }

  .sf-options.sf-options--colour .sf-option-card {
    flex: 0 0 17%;
    max-width: 17%;
  }
}

/* Touch-friendly: ensure tap targets and no hover-only reliance */
@media (hover: none) and (pointer: coarse) {
  .sf-option-card {
    min-height: 44px;
  }

  .sf-option-card .sf-option-img-wrap {
    min-height: 80px;
  }
}
