.gift-finder {
  /* Component tokens inherit the homepage design system. */
  --gf-ink: var(--ink);
  --gf-muted: var(--muted);
  --gf-accent: var(--rose);
  --gf-accent-dark: var(--rose-dark);
  --gf-surface: var(--card);
  --gf-border: #f1d9d4;
  --gf-focus: rgba(198, 32, 48, 0.22);

  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: var(--gf-ink);
  background: linear-gradient(135deg, #fff8f6 0%, #ffeff4 48%, #fff8f6 100%);
  border: 1px solid #f4ddd7;
  border-radius: 24px;
  box-shadow: 0 16px 34px rgba(95, 35, 44, 0.11);
  padding: clamp(24px, 4vw, 48px);
  margin: 40px 0;
  font-family: inherit;
  scroll-margin-top: 100px;
}

.gift-finder::before,
.gift-finder::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}

.gift-finder::before {
  width: 300px;
  height: 300px;
  top: -190px;
  right: -70px;
  background: radial-gradient(circle, rgba(198, 32, 48, 0.16), rgba(198, 32, 48, 0) 70%);
}

.gift-finder::after {
  width: 230px;
  height: 230px;
  bottom: -160px;
  left: -70px;
  background: radial-gradient(circle, rgba(255, 153, 173, 0.2), rgba(255, 153, 173, 0) 72%);
}

.gift-finder *,
.gift-finder *::before,
.gift-finder *::after {
  box-sizing: border-box;
}

.gift-finder [hidden] {
  display: none !important;
}

.gift-finder h2 {
  max-width: 760px;
  margin: 0 0 14px;
  color: var(--gf-ink);
  font-family: "Playfair Display", serif;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.16;
}

.gf-kicker {
  margin: 0 0 12px;
  color: var(--gf-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gf-intro {
  max-width: 700px;
}

.gf-intro p {
  margin: 0 0 20px;
  color: #6a4c45;
  font-size: 17px;
  line-height: 1.65;
}

.gf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gf-accent) 0%, var(--gf-accent-dark) 100%);
  box-shadow: 0 10px 24px rgba(198, 32, 48, 0.24);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.gf-button:hover {
  background: linear-gradient(135deg, #d3203a 0%, #98111f 100%);
  box-shadow: 0 13px 28px rgba(198, 32, 48, 0.3);
  transform: translateY(-1px);
}

.gf-button:active {
  box-shadow: 0 6px 14px rgba(198, 32, 48, 0.22);
  transform: translateY(0);
}

.gf-button:disabled {
  box-shadow: none;
  cursor: not-allowed;
  filter: saturate(0.45);
  opacity: 0.52;
  transform: none;
}

.gf-secondary {
  border: 1px solid var(--gf-border);
  background: #fff;
  box-shadow: 0 7px 16px rgba(60, 22, 22, 0.07);
  color: #6a4c45;
}

.gf-secondary:hover {
  border-color: rgba(198, 32, 48, 0.3);
  background: var(--rose-soft);
  box-shadow: 0 9px 20px rgba(198, 32, 48, 0.12);
  color: var(--gf-accent-dark);
}

.gift-finder :is(button, a, input, summary, legend, .gf-results h3):focus-visible {
  outline: 3px solid var(--gf-focus);
  outline-offset: 3px;
}

.gf-progress {
  margin: 28px 0 26px;
}

.gf-progress progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: var(--gf-accent);
  background: #f3ddd9;
}

.gf-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #f3ddd9;
}

.gf-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gf-accent), #e45a84);
}

.gf-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 10px 0 0;
  color: var(--gf-muted);
  font-size: 14px;
  list-style: none;
}

.gf-steps [aria-current] {
  color: var(--gf-accent);
  font-weight: 700;
}

.gf-steps .is-complete {
  color: #31704b;
}

.gf-step-label {
  margin-bottom: 7px;
  color: #6a4c45;
  font-size: 14px;
  font-weight: 700;
}

.gift-finder fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0;
}

.gift-finder legend {
  padding: 0;
  margin-bottom: 20px;
  color: var(--gf-ink);
  font-family: "Playfair Display", serif;
  font-size: clamp(23px, 2.5vw, 29px);
  font-weight: 600;
  line-height: 1.3;
}

.gf-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gf-option {
  display: flex;
  align-items: center;
  min-height: 66px;
  padding: 17px 18px;
  border: 1px solid #f1ddd7;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(60, 22, 22, 0.06);
  cursor: pointer;
  font-size: 16px;
  line-height: 1.45;
  gap: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.gf-option:hover {
  border-color: rgba(198, 32, 48, 0.32);
  box-shadow: 0 11px 24px rgba(198, 32, 48, 0.1);
  transform: translateY(-1px);
}

.gf-option:has(input:checked) {
  border-color: var(--gf-accent);
  background: linear-gradient(135deg, #fff 0%, #ffe6ed 100%);
  box-shadow: 0 10px 24px rgba(198, 32, 48, 0.15), inset 0 0 0 1px var(--gf-accent);
}

.gf-option:focus-within {
  outline: 3px solid var(--gf-focus);
  outline-offset: 2px;
}

.gf-option input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--gf-accent);
}

.gf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.gf-status {
  min-height: 1.5em;
  color: var(--gf-muted);
  font-size: 15px;
  line-height: 1.5;
}

.gf-enter {
  animation: gf-enter 0.2s ease-out;
}

.gf-results h3 {
  margin: 10px 0;
  color: var(--gf-ink);
  font-family: "Playfair Display", serif;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.25;
}

.gf-summary,
.gf-note {
  color: var(--gf-muted);
  font-size: 14px;
  line-height: 1.6;
}

.gf-summary {
  margin: 0 0 8px;
}

.gf-note {
  margin: 0;
}

.gf-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.gf-product {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid #f1ddd7;
  border-radius: 18px;
  background: var(--gf-surface);
  box-shadow: 0 12px 28px rgba(72, 25, 33, 0.08);
}

.gf-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 5 / 4;
  margin-bottom: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff9f7, #ffeef2);
}

.gf-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gf-image span {
  padding: 16px;
  color: var(--gf-muted);
  font-size: 14px;
  text-align: center;
}

.gf-product h4 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.gf-price {
  margin: 0 0 6px;
  color: var(--gf-accent);
  font-size: 22px;
  font-weight: 700;
}

.gf-stock {
  margin: 0 0 10px;
  color: #31704b;
  font-size: 13px;
  font-weight: 600;
}

.gf-reasons {
  padding-left: 18px;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
}

.gf-product .gf-button {
  width: 100%;
  margin-top: auto;
}

.gf-fallback {
  padding: 20px;
  border: 1px dashed #e2bcb4;
  border-radius: 16px;
  margin: 24px 0;
  background: rgba(255, 255, 255, 0.88);
}

.gf-fallback p {
  margin: 0 0 14px;
}

.gf-fallback .gf-note {
  margin-top: 12px;
}

.gf-gift-reveal {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffe6ed, #ffdfe7);
  box-shadow: 0 12px 26px rgba(198, 32, 48, 0.16);
  font-size: 38px;
  pointer-events: none;
  animation: gf-reveal 0.55s ease-out;
}

.gf-consent {
  padding-top: 18px;
  border-top: 1px solid var(--gf-border);
  margin-top: 30px;
  color: #6a4c45;
  font-size: 14px;
  line-height: 1.6;
}

.gf-consent summary {
  display: list-item;
  min-height: 44px;
  color: var(--gf-ink);
  cursor: pointer;
  font-weight: 700;
}

.gf-consent p {
  margin: 10px 0 0;
}

.gf-consent a,
.gf-static a {
  color: var(--gf-accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(165, 19, 33, 0.34);
  text-underline-offset: 3px;
}

.gf-consent .gf-actions {
  margin-top: 12px;
}

.gf-consent .gf-button {
  font-size: 14px;
}

.gf-consent button[aria-pressed="true"] {
  border-color: var(--gf-accent);
  background: var(--rose-soft);
  box-shadow: inset 0 0 0 1px var(--gf-accent);
  color: var(--gf-accent-dark);
}

.gf-consent-status {
  color: var(--gf-muted);
}

.gf-static {
  padding: 10px 0;
}

@keyframes gf-enter {
  from { opacity: 0.5; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gf-reveal {
  from { opacity: 0.5; transform: scale(0.86) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@media (max-width: 800px) {
  .gf-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .gift-finder {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .gift-finder h2 {
    font-size: clamp(28px, 9vw, 34px);
  }

  .gf-options,
  .gf-products {
    grid-template-columns: minmax(0, 1fr);
  }

  .gf-actions .gf-button {
    flex: 1;
    min-width: 120px;
  }

  .gf-steps {
    gap: 4px;
    font-size: 12px;
  }

  .gf-option {
    padding: 15px;
  }

  .gf-consent .gf-actions {
    flex-direction: column;
  }

  .gf-image {
    max-height: 260px;
  }

  .gf-products {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gift-finder *,
  .gift-finder *::before,
  .gift-finder *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
