/* ==========================================================================
   Funny's Snack — Çekiliş Sayfası
   ========================================================================== */

/* Hero
   ========================================================================== */

.hero {
  position: relative;
  z-index: 2;
  background: var(--c-red);
}

.hero__inner {
  position: relative;
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--container);
  aspect-ratio: 2 / 1;
  padding: 0;
}

.hero__mascot {
  position: absolute;
  bottom: 0;
  left: 52%;
  width: 44%;
  /* Patiler bir sonraki bölümün üzerine taşar */
  transform: translateY(6.59%);
  pointer-events: none;
}

/* Taste rating (hero, maskotun solu)
   ========================================================================== */

.taste-rating {
  position: absolute;
  bottom: 14%;
  left: max(var(--gutter), 50% - var(--container) / 2);
  z-index: 3;
}

.taste-rating__field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.taste-rating__label {
  margin-bottom: 14px;
  padding: 0;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--c-white);
}

.taste-rating__count {
  margin-top: 8px;
  padding-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--c-white);
}

.taste-rating__count strong {
  font-weight: 500;
}

.taste-rating__message {
  min-height: 1.4em;
  margin-top: 4px;
  padding-left: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-white);
}

/* Yıldızlar sağdan sola dizilir, böylece "~" ile önceki yıldızlar boyanır */
.rating {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 11px;
  height: 58px;
  padding: 0 32px 0 29px;
  border-radius: 999px;
  background: var(--c-white);
}

.rating input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rating label {
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: var(--c-red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.8 6 6.6.7-4.9 4.5 1.4 6.5L12 17l-5.9 3.3 1.4-6.5-4.9-4.5 6.6-.7z' fill='none' stroke='%23000' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.8 6 6.6.7-4.9 4.5 1.4 6.5L12 17l-5.9 3.3 1.4-6.5-4.9-4.5 6.6-.7z' fill='none' stroke='%23000' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s ease;
}

.rating label:hover,
.rating label:hover ~ label,
.rating input:checked ~ label {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.8 6 6.6.7-4.9 4.5 1.4 6.5L12 17l-5.9 3.3 1.4-6.5-4.9-4.5 6.6-.7z' fill='%23000' stroke='%23000' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.8 6 6.6.7-4.9 4.5 1.4 6.5L12 17l-5.9 3.3 1.4-6.5-4.9-4.5 6.6-.7z' fill='%23000' stroke='%23000' stroke-width='1.1' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.rating label:hover {
  transform: scale(1.12);
}

.rating input:focus-visible + label {
  outline: 2px solid #000;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Oy verildikten sonra yıldızlar sabitlenir */
.taste-rating.is-done .rating label {
  cursor: default;
  pointer-events: none;
}

/* Raffles
   ========================================================================== */

.raffles {
  /* Maskotun patileri bölüme taşar; boşluk ekran genişliğiyle orantılı */
  padding-top: clamp(36px, 4.5vw, 64px);
}

.raffles .section-title {
  margin-bottom: 74px;
}

/* Product code
   ========================================================================== */

.code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  align-items: center;
  gap: 24px 48px;
  margin-bottom: 80px;
  padding: 36px 44px;
  border-radius: var(--radius-lg);
  background: var(--c-red);
  color: var(--c-white);
}

.code-card__title {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 900;
  font-size: 26px;
  line-height: 1.12;
  text-transform: uppercase;
}

.code-card__text {
  margin-top: 10px;
  max-width: 380px;
  font-size: 14px;
  line-height: 1.5;
}

.code-form__row {
  display: flex;
  gap: 12px;
}

.code-form__input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--c-white);
  color: #000;
  font-family: var(--font-display);
  font-stretch: 110%;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .12em;
  text-transform: uppercase;
  outline: none;
  transition: box-shadow .2s ease;
}

.code-form__input::placeholder {
  font-family: var(--font-body);
  font-weight: 300;
  letter-spacing: 0;
  text-transform: none;
  color: #B9B9B9;
}

.code-form__input:focus {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .35);
}

.code-form.is-error .code-form__input {
  box-shadow: 0 0 0 3px #000;
}

.code-form__submit {
  flex-shrink: 0;
  min-height: 52px;
  padding-inline: 28px;
}

.code-form__submit.is-loading {
  color: transparent;
  position: relative;
}

.code-form__submit.is-loading .coin {
  visibility: hidden;
}

.code-form__submit.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: auto;
  border: 3px solid var(--c-red);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.code-form__help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 0 0 0 24px;
  border: 0;
  background: none;
  color: var(--c-white);
  font-size: 13px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.code-form__help::before {
  content: "?";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-red);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12px;
  text-decoration: none;
}

.code-form__help:hover {
  color: #000;
}

.code-form__message {
  min-height: 1.4em;
  margin-top: 10px;
  padding-left: 24px;
  font-size: 13px;
  font-weight: 400;
}

.code-form.is-success .code-form__message {
  font-weight: 500;
}

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

.raffle-card {
  display: grid;
  grid-template-columns: 51% 1fr;
  background: var(--c-card);
  border-radius: var(--radius-lg);
}

.raffle-card__media {
  position: relative;
}

.raffle-card__media img {
  width: 67.55%;
  margin: -9.52% 0 1.44% 19.7%;
}

.raffle-card__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 4% 18px 0;
}

.raffle-card__date {
  margin-top: -14px;
  padding: 8px 22px;
  border-radius: 999px;
  background: var(--c-pill);
  color: var(--c-white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  line-height: 1.4;
  min-width: 262px;
}

.raffle-card__title {
  margin-top: 36px;
  font-family: var(--font-display);
  font-stretch: 105%;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.18;
  color: var(--c-white);
}

.raffle-card__btn {
  margin-top: 20px;
  width: 328px;
  max-width: 100%;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--c-white);
  color: var(--c-card-accent);
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 900;
  font-size: 28px;
  line-height: 1.3;
  text-transform: uppercase;
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease;
}

.raffle-card__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(176, 81, 105, .3);
  color: var(--c-pill);
}

.raffle-card__btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Countdown */

.countdown {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 26px;
  padding: 6px 14px 4px;
  border-radius: 10px;
  background: var(--c-navy);
  color: var(--c-white);
}

.countdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.countdown__value {
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
}

.countdown__sep {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
}

.raffle-card__legal {
  margin-top: 24px;
  max-width: 483px;
  font-size: 8px;
  line-height: 1.45;
  text-align: justify;
  color: #3B2A2E;
}

/* Rewards
   ========================================================================== */

.rewards {
  padding-top: 63px;
  padding-bottom: 80px;
}

.rewards__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 29px;
}

.rewards__store {
  padding-bottom: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: color .2s ease;
}

.rewards__store:hover {
  color: var(--c-red);
}

.rewards__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  aspect-ratio: 409 / 570;
  padding-bottom: 14px;
  border-radius: var(--radius-md);
  color: var(--c-white);
  transition: transform .25s ease, box-shadow .25s ease;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(96, 96, 96, .15);
}

.product-card--blue   { background: var(--c-blue); }
.product-card--purple { background: var(--c-purple); }

.product-card__img {
  width: 84.35%;
  margin: 3.9% auto 0;
}

.product-card__name {
  margin-top: auto;
  padding-inline: 18px;
  font-size: 15px;
  line-height: 1.3;
}

.product-card__points {
  padding-inline: 18px;
  font-size: 22px;
  line-height: 1.2;
}

.product-card__coin {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 30px;
  height: 30px;
}

.product-card__points strong {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 900;
}

.rewards__all {
  display: block;
  width: max-content;
  margin: 34px auto 0;
  font-family: var(--font-display);
  font-stretch: 110%;
  font-weight: 900;
  font-size: 16px;
  text-transform: uppercase;
  transition: color .2s ease;
}

.rewards__all:hover {
  color: var(--c-red);
}

/* Modal
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(59, 20, 30, .55);
  animation: fade-in .2s ease;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - var(--gutter) * 2);
  overflow-y: auto;
  padding: 36px 32px 32px;
  border-radius: var(--radius-lg);
  background: var(--c-bg);
  animation: pop-in .25s ease;
}

.modal__dialog--wide {
  max-width: 560px;
}

.code-help__figure {
  margin: 0 0 20px;
}

.code-help__figure img {
  width: 100%;
  border-radius: var(--radius-md);
}

.code-help__placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 2px dashed var(--c-card);
  border-radius: var(--radius-md);
  background: var(--c-white);
  color: var(--c-card);
  font-size: 14px;
  font-weight: 400;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--c-text);
  font-size: 28px;
  line-height: 1;
}

.modal__close:hover {
  background: rgba(0, 0, 0, .06);
}

.modal__logo {
  width: 110px;
  margin: -16px auto 4px;
}

.modal__title {
  font-family: var(--font-display);
  font-stretch: 120%;
  font-weight: 900;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--c-red);
}

.modal__subtitle {
  margin: 4px 0 22px;
  font-size: 14px;
}

.join-success p {
  margin: 12px 0 24px;
  font-size: 15px;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--c-white);
  color: #333;
  font: inherit;
  font-weight: 400;
  outline: none;
  transition: border-color .2s ease;
}

.field input:focus {
  border-color: var(--c-card);
}

.field__error {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--c-red);
}

.field.is-invalid input {
  border-color: var(--c-red);
}

.field.is-invalid .field__error {
  display: block;
}

.field--check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 12px;
}

.field--check input {
  margin: 2px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--c-pill);
}

.field--check .field__error {
  grid-column: 2;
}

.join-form__submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--c-red);
  color: var(--c-white);
  font-family: var(--font-display);
  font-stretch: 115%;
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  transition: background .2s ease;
}

.join-form__submit:hover {
  background: var(--c-pill);
}

body.has-modal {
  overflow: hidden;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
}

/* Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .code-card {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .raffle-card {
    grid-template-columns: 1fr;
    margin-top: 60px;
  }

  .raffle-card__media img {
    width: 56%;
    margin: -7.9% auto 0;
  }

  .raffle-card__content {
    align-items: center;
    padding: 12px 24px 28px;
    text-align: center;
  }

  .raffle-card__date {
    order: -1;
    margin-top: 0;
    min-width: 0;
  }

  .raffle-card__title {
    margin-top: 20px;
  }

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

@media (max-width: 767px) {
  /* Mobilde maskotun yanında yer yok: oylama kırmızı alanın altında */
  .taste-rating {
    position: static;
    padding: 28px var(--gutter) 24px;
    text-align: center;
  }

  .rating {
    gap: 8px;
    height: 52px;
    padding-inline: 24px;
  }

  .rating label {
    width: 32px;
    height: 32px;
  }

  .taste-rating__count,
  .taste-rating__message {
    padding-left: 0;
  }

  .code-card {
    margin-bottom: 56px;
    padding: 24px 20px;
  }

  .code-card__title {
    font-size: 21px;
  }

  .code-form__row {
    flex-direction: column;
    gap: 10px;
  }

  /* Dikey dizilimde flex: 1 yüksekliği sıfırlıyordu */
  .code-form__input {
    flex: none;
    width: 100%;
    height: 52px;
    padding-inline: 20px;
    text-align: center;
  }

  .code-form__submit {
    width: 100%;
  }

  .code-form__message {
    padding-left: 0;
    text-align: center;
  }

  .code-form__help {
    display: flex;
    width: max-content;
    margin-inline: auto;
    padding-left: 0;
  }

  .hero__inner {
    aspect-ratio: 1 / .95;
  }

  .hero__mascot {
    left: 12%;
    width: 76%;
  }

  .section-title {
    font-size: 22px;
  }

  .raffles .section-title {
    margin-bottom: 0;
  }

  .raffle-card__media img {
    width: 78%;
    margin-top: -11%;
  }

  .raffle-card__title {
    font-size: 19px;
  }

  .raffle-card__btn {
    font-size: 22px;
  }

  .countdown {
    gap: 4px;
    padding-inline: 10px;
  }

  .countdown__item {
    min-width: 46px;
  }

  .countdown__value {
    font-size: 28px;
  }

  .countdown__sep {
    font-size: 24px;
  }

  .countdown__label {
    font-size: 11px;
  }

  .raffle-card__legal {
    font-size: 9px;
  }

  .rewards__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .rewards__grid {
    gap: 14px;
  }

  .product-card__name {
    padding-inline: 12px;
    font-size: 12px;
  }

  .product-card__points {
    padding-inline: 12px;
    font-size: 17px;
  }

  .product-card__coin {
    right: 10px;
    bottom: 12px;
    width: 22px;
    height: 22px;
  }
}
