/* Quiz — dark theme aligned with wonderfull.coffee (Ermilov, #f47953, #121111) */

.quiz-page {
  padding: 2rem 0 5rem;
  color: #fff;
}

.quiz-page__container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.quiz-page__breadcrumbs {
  margin-bottom: 2rem;
}

.quiz-app {
  position: relative;
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  min-height: 28rem;
}

/* Screens & transitions */
.quiz-screen {
  display: none;
  opacity: 0;
  transform: translateY(1rem);
}

.quiz-screen[hidden] {
  display: none !important;
}

.quiz-screen--active {
  display: block !important;
  animation: quizScreenIn 0.45s ease forwards;
}

.quiz-screen--leaving {
  display: block;
  animation: quizScreenOut 0.3s ease forwards;
  pointer-events: none;
}

@keyframes quizScreenIn {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes quizScreenOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-0.75rem);
  }
}

/* Intro */
.quiz-hero {
  text-align: center;
  padding: 3rem 1rem 4rem;
  max-width: 48rem;
  margin: 0 auto;
}

.quiz-hero__title {
  margin: 0.75rem 0 1.25rem;
  font-size: clamp(2rem, 5vw, 4rem);
}

.quiz-hero__subtitle {
  margin: 0 auto 2.5rem;
  max-width: 36rem;
  font-family: "FixelDisplay", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

/* Step layout (client ref: centered question + cards) */
.quiz-step {
  padding: 1rem 0 2rem;
}

.quiz-eyebrow {
  margin: 0 0 0.75rem;
  font-family: "Ermilov", sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f47953;
  text-align: center;
}

.quiz-step__title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 3.25rem);
}

.quiz-step__hint {
  margin: 0 auto 2rem;
  max-width: 32rem;
  text-align: center;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
}

/* Option cards — image + overlay label (mockup style) */
.quiz-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 2rem 0 2.5rem;
}

.quiz-options--criteria {
  grid-template-columns: 1fr;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.quiz-option {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0.125rem solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  background: #1c1b1b;
  text-align: left;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.quiz-option:hover {
  border-color: rgba(244, 121, 83, 0.55);
  transform: translateY(-0.125rem);
}

.quiz-option.is-selected {
  border-color: #f47953;
  box-shadow: 0 0 0 0.0625rem #f47953;
}

.quiz-option.is-selected::after {
  content: "";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #f47953 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.5l3 3 6-6' stroke='%23121111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
  pointer-events: none;
}

.quiz-options--criteria .quiz-option.is-selected::after {
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
}

.quiz-option__media {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #121111;
}

.quiz-option__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.quiz-option:hover .quiz-option__image {
  transform: scale(1.04);
}

.quiz-option__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 17, 17, 0) 35%, rgba(18, 17, 17, 0.92) 100%);
  pointer-events: none;
}

.quiz-option__label {
  position: absolute;
  left: 0.875rem;
  right: 0.875rem;
  bottom: 0.875rem;
  z-index: 1;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.9375rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.25;
  color: #fff;
}

.quiz-option__desc {
  display: none;
}

/* Criteria — text rows */
.quiz-options--criteria .quiz-option {
  aspect-ratio: auto;
  padding: 1rem 1.25rem;
  border-radius: 3.125rem;
  background: transparent;
}

.quiz-options--criteria .quiz-option__label {
  position: static;
  font-style: normal;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.9375rem;
}

.quiz-options--criteria .quiz-option.is-selected {
  background: rgba(244, 121, 83, 0.12);
}

/* Price tiers */
.quiz-option--price {
  aspect-ratio: auto;
  min-height: 5.5rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.quiz-option--price .quiz-option__label {
  position: static;
  font-style: normal;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.quiz-option--price .quiz-option__desc {
  display: block;
  position: static;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
}

.quiz-options--price {
  grid-template-columns: repeat(3, 1fr);
}

/* Processing / country — картки з ілюстрацією + опис + характер (ТЗ) */
.quiz-options--detailed {
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.quiz-option--detailed {
  display: flex;
  flex-direction: column;
}

.quiz-option--detailed .quiz-option__media {
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
}

.quiz-option--detailed .quiz-option__overlay {
  display: none;
}

.quiz-option--detailed .quiz-option__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.625rem 0.75rem 0.875rem;
  flex: 1;
}

.quiz-option--detailed .quiz-option__label {
  position: static;
  font-family: "FixelDisplay", sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: #fff;
}

.quiz-option--detailed .quiz-option__desc {
  display: -webkit-box;
  position: static;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.75);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-option--detailed .quiz-option__character {
  display: -webkit-box;
  position: static;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-option--detailed .quiz-option__character-label {
  color: #f47953;
  font-weight: 600;
  font-style: normal;
}

/* Navigation */
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.quiz-nav__back,
.quiz-nav__next {
  min-width: 9rem;
  text-align: center;
}

.quiz-nav__next::after {
  content: "→";
  margin-left: 0.35rem;
}

.quiz-nav__back::before {
  content: "←";
  margin-right: 0.35rem;
}

.quiz-nav--results {
  gap: 0.75rem 1.25rem;
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.quiz-nav--results .quiz-nav__back,
.quiz-nav--results .quiz-nav__catalog,
.quiz-nav--results .quiz-nav__discount {
  min-width: auto;
}

.quiz-nav--results .quiz-nav__add-all {
  min-width: 12rem;
  flex-shrink: 0;
}

.quiz-nav--results .quiz-nav__add-all::after {
  content: none;
}

/* Progress — mockup: Step 01 — 03 */
.quiz-progress-text {
  margin: 1.75rem 0 0;
  text-align: center;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
}

.quiz-progress-text--top {
  margin: 0 0 1rem;
}

.quiz-progress-text:empty {
  display: none;
}

.quiz-results__notice {
  margin: 0 0 1.25rem;
  text-align: center;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
}

.quiz-results__panel-title {
  margin: 0 0 1.25rem;
  font-family: "Ermilov", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.quiz-results__tabs-wrap {
  position: relative;
  margin-bottom: 2.5rem;
}

.quiz-error-msg,
.quiz-error {
  color: #f47953;
  text-align: center;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Results */
.quiz-step--results .quiz-step__title {
  margin-bottom: 1rem;
}

.quiz-results {
  margin-top: 1.5rem;
}

.quiz-results__tabs {
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.quiz-results__tabs .tabs__title {
  font-family: "Ermilov", sans-serif;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3.125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.7);
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.quiz-results__tabs .tabs__title._tab-active {
  background: #f47953;
  border-color: #f47953;
  color: #121111;
}

.quiz-results__content {
  width: 100%;
}

.quiz-results__panel[hidden] {
  display: none !important;
}

/* Product cards in quiz results — keep grid safe; layout matches catalog on desktop */
.quiz-results .catalog__cards {
  width: 100%;
  min-width: 0;
}

.quiz-results .catalog__cards > .shop-card,
.quiz-results .catalog__cards > .coffe-item {
  min-width: 0;
  max-width: 100%;
}

.quiz-results .shop-card__front,
.quiz-results .shop-card__back {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.quiz-results .shop-card__add {
  max-width: 100%;
  box-sizing: border-box;
}

.quiz-social-proof {
  margin-top: 2.5rem;
  text-align: center;
  font-family: "FixelDisplay", sans-serif;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Loading */
.quiz-loading {
  position: absolute;
  inset: 0;
  background: rgba(18, 17, 17, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.quiz-loading[hidden] {
  display: none !important;
}

.quiz-loading__spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 0.1875rem solid rgba(244, 121, 83, 0.2);
  border-top-color: #f47953;
  border-radius: 50%;
  animation: quizSpin 0.75s linear infinite;
}

@keyframes quizSpin {
  to { transform: rotate(360deg); }
}

/* Match catalog mobile card layout (≤767px): full-width options, prevent overflow */
@media (max-width: 47.99875em) {
  .quiz-results .shop-card__bottom,
  .quiz-results .options_container,
  .quiz-results .shop-card__prices {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .quiz-results .shop-card__btns {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .quiz-results .shop-card__btns > .shop-card {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    perspective: none;
    transform: none;
  }

  .quiz-results .shop-card__btns .shop-card__btn {
    width: 100%;
    box-sizing: border-box;
  }

  .quiz-results .shop-card__btns > .select,
  .quiz-results .shop-card__btns .select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
  }

  .quiz-results .select__body,
  .quiz-results .select__title,
  .quiz-results .select__value {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .quiz-results .select__content {
    min-width: 0;
    max-width: 100%;
  }
}

/* Responsive */
@media (max-width: 61.9988em) {
  .quiz-results__tabs {
    gap: 0.75rem 1.5rem;
  }

  .quiz-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-options--detailed {
    grid-template-columns: repeat(2, 1fr);
  }

  .quiz-options--price {
    grid-template-columns: 1fr;
  }

  .quiz-results .catalog__cards {
    gap: 1rem;
  }
}

@media (max-width: 29.9988em) {
  .quiz-results__tabs-wrap::before,
  .quiz-results__tabs-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0.5rem;
    width: 1.75rem;
    z-index: 1;
    pointer-events: none;
  }

  .quiz-results__tabs-wrap::before {
    left: 0;
    background: linear-gradient(90deg, #121111 0%, rgba(18, 17, 17, 0) 100%);
  }

  .quiz-results__tabs-wrap::after {
    right: 0;
    background: linear-gradient(270deg, #121111 0%, rgba(18, 17, 17, 0) 100%);
  }

  .quiz-results__tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.125rem 0.75rem 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .quiz-results__tabs::-webkit-scrollbar {
    display: none;
  }

  .quiz-results__tabs .tabs__title {
    font-size: 0.8125rem;
    scroll-snap-align: start;
  }

  .quiz-options {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .quiz-options--detailed {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
  }

  .quiz-options--criteria {
    grid-template-columns: 1fr;
    max-width: 18rem;
    margin-left: auto;
    margin-right: auto;
  }

  .quiz-options--price {
    grid-template-columns: 1fr;
    max-width: 18rem;
    margin-left: auto;
    margin-right: auto;
  }

  .quiz-option__media {
    aspect-ratio: 1 / 1;
  }

  .quiz-option--detailed .quiz-option__media {
    aspect-ratio: 1 / 1;
  }

  .quiz-option__label {
    left: 0.625rem;
    right: 0.625rem;
    bottom: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    display: block;
    -webkit-line-clamp: unset;
  }

  .quiz-option--detailed .quiz-option__label {
    font-size: 0.8125rem;
  }

  .quiz-option--detailed .quiz-option__desc,
  .quiz-option--detailed .quiz-option__character {
    -webkit-line-clamp: 2;
  }

  .quiz-nav {
    flex-direction: column;
  }

  .quiz-nav--sticky {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: 1.5rem;
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(18, 17, 17, 0) 0%, #121111 28%);
  }

  .quiz-nav__back,
  .quiz-nav__next {
    width: 100%;
    max-width: 18rem;
  }

  .quiz-nav--results .quiz-nav__back,
  .quiz-nav--results .quiz-nav__catalog,
  .quiz-nav--results .quiz-nav__add-all,
  .quiz-nav--results .quiz-nav__discount {
    width: 100%;
    max-width: 18rem;
    text-align: center;
  }

  .quiz-results .catalog__cards {
    gap: 0.75rem;
  }

  .quiz-results .shop-card__front,
  .quiz-results .shop-card__back {
    padding: 0.5rem;
  }

  .quiz-results .shop-card__btn {
    font-size: 0.625rem;
    padding: 0.3125rem 0.375rem;
  }

  .quiz-results .select_product-card .select__value {
    font-size: 0.5625rem;
    padding: 0.5rem 0.375rem;
  }

  .quiz-results .shop-card__btns .shop-card__btn {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
  }
}

.quiz-page .select:has(#quiz-select-bootstrap) {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.quiz-discount-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.quiz-discount-modal[hidden] {
  display: none;
}

.quiz-discount-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.quiz-discount-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 1rem;
  background: #1f1f1f;
  color: #fff;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.quiz-discount-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.quiz-discount-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.quiz-discount-modal__text {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.quiz-discount-form {
  display: grid;
  gap: 0.85rem;
}

.quiz-discount-form__field {
  display: grid;
  gap: 0.35rem;
}

.quiz-discount-form__field span,
.quiz-discount-form__checkbox span {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.quiz-discount-form__field > input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.quiz-discount-form__phone {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
}

.quiz-discount-form__phone-prefix {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quiz-discount-form__phone input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.quiz-discount-form__checkbox.checkbox {
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  cursor: pointer;
}

.quiz-discount-form__checkbox.checkbox::before {
  margin-top: 0.1rem;
  font-family: "icons";
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.quiz-discount-form__checkbox.checkbox:has(.checkbox__input:checked)::before {
  content: "\e90f";
  background-color: #f47953;
  border-color: #f47953;
}

.quiz-discount-form__checkbox span {
  flex: 1;
  line-height: 1.4;
}

.quiz-discount-form__submit {
  width: 100%;
  justify-self: stretch;
  margin-top: 0.25rem;
  text-align: center;
}

.quiz-discount-form__success {
  margin: 0;
  color: #8fd19e;
}

body.quiz-discount-open {
  overflow: hidden;
}

/* SEO text from information description (below quiz) */
.quiz-seo {
  margin-top: 1rem;
  padding: 2.5rem 0 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.quiz-seo__content {
  max-width: 55rem; /* ~880px as in TZ */
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1.65;
}

.quiz-seo__content h2,
.quiz-seo__content h3 {
  color: #fff;
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
}

.quiz-seo__content h2:first-child,
.quiz-seo__content h3:first-child {
  margin-top: 0;
}

.quiz-seo__content p {
  margin: 0 0 1rem;
}

.quiz-seo__content ul,
.quiz-seo__content ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.quiz-seo__content a {
  color: #f47953;
  text-decoration: underline;
}

.quiz-seo__content a:hover {
  color: #ff8f6d;
}

@media (max-width: 47.99875em) {
  .quiz-seo {
    padding-top: 2rem;
  }

  .quiz-seo__content {
    font-size: 0.95rem;
  }
}
