/* =========================
   FORMULARZ – WYBÓR PACZKI (kafelki zamiast selecta)
========================= */

.wybor-pole {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.wybor-legenda,
#form-offer > .wybor-legenda--dane {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  float: none;
  width: 100%;
  margin: 0 0 16px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 130%;
}
#form-offer > .wybor-legenda--dane {
  margin: 16px 0 -8px;
}
.wybor-legenda__krok {
  padding: 4px 12px;
  border-radius: 64px;
  border: 1px solid rgba(255, 145, 0, 0.5);
  background: rgba(255, 145, 0, 0.12);
  color: var(--pomarancz);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.wybor-siatka {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.wybor--inne {
  grid-column: 1 / -1;
}
.wybor {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.wybor input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.wybor__karta {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(165deg, #1b2238 0%, #0e1222 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.3s ease,
    opacity 0.3s ease, filter 0.3s ease;
}
.wybor:hover .wybor__karta {
  transform: translateY(-4px);
  border-color: rgba(255, 145, 0, 0.55);
}
.wybor input:focus-visible + .wybor__karta {
  outline: 3px solid var(--zloto);
  outline-offset: 3px;
}

/* zdjęcie urządzenia */
.wybor__foto {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, rgba(255, 145, 0, 0.35) 0%, rgba(255, 145, 0, 0) 65%), var(--noc-2);
}
.wybor__foto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: grayscale(0.4) brightness(0.75);
  transition: filter 0.4s ease, transform 0.6s ease;
}
.wybor__foto::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10, 14, 26, 0) 50%, rgba(14, 18, 34, 0.95) 100%);
  pointer-events: none;
}
.wybor__zastepcza {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}
.wybor__zastepcza svg {
  width: 62%;
  height: auto;
}
.wybor__foto--brak .wybor__zastepcza {
  display: flex;
}
.wybor__rabat {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 64px;
  background: var(--pomarancz);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transform: rotate(-3deg);
}

/* opis */
.wybor__opis {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 16px;
  text-align: left;
}
.wybor__nazwa {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 125%;
}
.wybor__stara {
  color: var(--tekst-przygaszony);
  font-size: 0.8rem;
  text-decoration-color: var(--pomarancz);
  text-decoration-thickness: 2px;
}
.wybor__cena {
  color: var(--zloto);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 130%;
  white-space: nowrap;
}
.wybor__cena small {
  color: var(--tekst-przygaszony);
  font-size: 0.7rem;
  font-weight: 500;
}

/* znaczek wyboru */
.wybor__check {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(4px);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wybor__check svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.35s ease 0.1s;
}

/* połysk przelatujący po wybranym kafelku */
.wybor__polysk {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

/* stan: wybrany */
.wybor input:checked + .wybor__karta {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--zloto);
  box-shadow: 0 0 0 2px var(--zloto), 0 18px 40px rgba(255, 145, 0, 0.35);
}
.wybor input:checked + .wybor__karta .wybor__foto img {
  filter: none;
  transform: scale(1.06);
}
.wybor input:checked + .wybor__karta .wybor__check {
  background: var(--pomarancz);
  border-color: var(--pomarancz);
  transform: scale(1.15);
}
.wybor input:checked + .wybor__karta .wybor__check svg {
  stroke-dashoffset: 0;
}
.wybor input:checked + .wybor__karta .wybor__polysk {
  animation: polysk 0.9s ease-out;
}
/* pozostałe przygasają, gdy coś jest wybrane */
.wybor-siatka--wybrano .wybor input:not(:checked) + .wybor__karta {
  opacity: 0.5;
  filter: saturate(0.5);
}
.wybor-siatka--wybrano .wybor:hover input:not(:checked) + .wybor__karta {
  opacity: 0.9;
  filter: none;
}
@keyframes polysk {
  to {
    transform: translateX(120%);
  }
}

/* kafelek "Inne urządzenie" */
.wybor--inne .wybor__karta {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 16px 60px 16px 20px;
  border-style: dashed;
  border-color: rgba(255, 145, 0, 0.45);
}
.wybor--inne .wybor__opis {
  padding: 0;
}
.wybor--inne .wybor__check {
  top: 50%;
  right: 18px;
  margin-top: -15px;
}
.wybor--inne input:checked + .wybor__karta {
  transform: translateY(-3px);
  border-style: solid;
}
.wybor__inne-ikona {
  font-size: 1.8rem;
  line-height: 1;
}
.wybor__inne-tekst {
  color: var(--tekst-przygaszony);
  font-size: 0.85rem;
  line-height: 140%;
}

/* błąd – nic nie wybrano */
.wybor-siatka--blad {
  animation: siatka-blad 0.5s ease;
}
.wybor-siatka--blad .wybor__karta {
  border-color: rgba(255, 90, 70, 0.7);
}
.wybor-blad {
  display: none;
  margin-top: 12px;
  color: #ff7a66;
  font-weight: 600;
  text-align: left;
}
.wybor-blad--widoczny {
  display: block;
}
@keyframes siatka-blad {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}

/* podsumowanie wyboru */
.wybor-podsumowanie {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 145, 0, 0.35);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.wybor-podsumowanie__pusto {
  color: var(--tekst-przygaszony);
  font-size: 0.95rem;
}
.wybor-podsumowanie__pelno {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.wybor-podsumowanie--pelne {
  border-style: solid;
  border-color: rgba(255, 210, 94, 0.6);
  background: linear-gradient(100deg, rgba(255, 145, 0, 0.16) 0%, rgba(255, 145, 0, 0.03) 100%);
}
.wybor-podsumowanie--pelne .wybor-podsumowanie__pusto {
  display: none;
}
.wybor-podsumowanie--pelne .wybor-podsumowanie__pelno {
  display: flex;
}
.wybor-podsumowanie--puls {
  animation: podsumowanie-puls 0.6s ease;
}
.wybor-podsumowanie__etykieta {
  padding: 2px 10px;
  border-radius: 64px;
  background: var(--zloto);
  color: #1d1a10;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.wybor-podsumowanie__nazwa {
  color: #fff;
  font-size: 1.15rem;
}
.wybor-podsumowanie__cena {
  color: var(--zloto);
  font-weight: 700;
}
.wybor-podsumowanie__oszczednosc {
  margin-left: auto;
  color: var(--pomarancz);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.wybor-podsumowanie__oszczednosc[hidden] {
  display: none;
}
.wybor-podsumowanie__oszczednosc strong {
  color: var(--pomarancz);
  font-size: 1.35rem;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@keyframes podsumowanie-puls {
  40% {
    box-shadow: 0 0 0 4px rgba(255, 210, 94, 0.25), 0 0 30px rgba(255, 145, 0, 0.35);
  }
}

/* przycisk wysyłki */
button.przycisk-wyslij {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 18px 44px;
  border-radius: 64px;
  background: linear-gradient(100deg, #ff7a00 0%, var(--pomarancz) 50%, var(--pomarancz-jasny) 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(255, 145, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
button.przycisk-wyslij::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: polysk 3s ease-in-out 1s infinite;
}
button.przycisk-wyslij:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 40px rgba(255, 145, 0, 0.55);
}
.przycisk-wyslij__ikona {
  display: inline-block;
  font-size: 1.2rem;
}
button.przycisk-wyslij:hover .przycisk-wyslij__ikona {
  animation: ikona-kiwanie 0.5s ease;
}
@keyframes ikona-kiwanie {
  25% {
    transform: rotate(-15deg) scale(1.2);
  }
  75% {
    transform: rotate(15deg) scale(1.2);
  }
}

/* konfetti na całym ekranie (wybór paczki, wysłanie formularza) */
.konfetti-ekran {
  position: fixed;
  z-index: 60;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  animation: konfetti-ekran-lot 1.1s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
.konfetti-ekran--pasek {
  width: 5px;
  height: 14px;
  border-radius: 2px;
}
@keyframes konfetti-ekran-lot {
  from {
    transform: translate(-50%, -50%) rotate(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 60px)) rotate(var(--r)) scale(0.4);
    opacity: 0;
  }
}

@media (max-width: 992px) {
  .wybor-siatka {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .wybor-siatka {
    gap: 12px;
  }
  .wybor__nazwa {
    font-size: 0.95rem;
  }
  .wybor__cena {
    font-size: 1rem;
  }
  .wybor-podsumowanie__oszczednosc {
    margin-left: 0;
    width: 100%;
  }
  button.przycisk-wyslij {
    width: 100%;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wybor__karta,
  .wybor__foto img {
    transition: none;
  }
  .wybor input:checked + .wybor__karta .wybor__polysk,
  button.przycisk-wyslij::after,
  .wybor-siatka--blad,
  .wybor-podsumowanie--puls {
    animation: none;
  }
}
