/* kasa z form-checkout.php, tez koszyk i form-pay.php; zachowanie w src/js/kasa.js */

/* naglowek i stopka kasy */
.kh {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 48px;
}

.kh__logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--f-druk);
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}

.kh__logo svg {
  display: block;
  height: 22px;
  width: auto;
  fill: currentColor;
}

.kh__gdzie {
  font-family: var(--f-mono);
  font-size: var(--t-liczba);
  color: var(--tusz-2);
}

.kh__pyt {
  margin-left: auto;
  font-size: 14px;
  color: var(--tusz-2);
}

.kh__mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.kh__pomoc {
  display: none;
}

.kf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s-5);
  padding: 0 48px 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tusz-2);
}

.kf a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tusz);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.kf span {
  margin-left: auto;
}

@media (hover: hover) {
  .kh__mail:hover,
  .kf a:hover {
    color: var(--czerwien);
  }
}

/* ramka i uklad */
.ks {
  margin: 8px 20px 20px;
  padding: 36px 40px 48px;
  border: 1px dashed var(--tusz);
  line-height: 1.45;
}

.ks a:not(.btn) {
  color: var(--czerwien);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (hover: hover) {
  .ks a:not(.btn):hover {
    color: var(--czerwien-najechanie);
  }
}

.ks__siatka {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 480px;
  gap: 72px;
}

.ks__form {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 680px;
}

.ks__h1 {
  font-family: var(--f-druk);
  font-weight: 500;
  font-size: 44px;
  line-height: 1;
  text-transform: uppercase;
}

.ks__h1 span {
  display: block;
}

.ks__kontur {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--tusz);
}

.ks__sekcja {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ks__h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tusz);
  font-family: var(--f-druk);
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
  text-transform: uppercase;
}

.ks__h2 span {
  font-size: 30px;
}

.ks__hint {
  font-size: 14px;
  line-height: 1.45;
  color: var(--tusz-2);
}

.ks__pusto {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  max-width: 520px;
  padding-bottom: var(--s-8);
}

.ks.is-pusta .ks__siatka {
  display: none;
}

.ks__noscript {
  padding: 20px 48px;
}

/* form-pay.php: komunikat woo nad naglowkiem, w ramce */
.ks > .woocommerce > .woocommerce-notices-wrapper > * {
  margin: 0 0 var(--s-5);
}

/* dostawa i platnosc: wiersz z kwadratowym znacznikiem, wybor zalany tuszem */
.ks__opcje {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2);
  align-items: end;
}

.ks__opcja {
  display: flex;
  flex-direction: column;
}

.ks__zakladka {
  padding: 6px 12px;
  border: 1px solid var(--tusz);
  border-bottom: 0;
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
}

.ks__wiersz {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 64px;
  padding: 0 var(--s-4);
  border: 1px solid var(--tusz);
  cursor: pointer;
}

.ks__wiersz:has(:checked) {
  background: var(--tusz);
  color: var(--krem);
}

.ks__wiersz:has(:focus-visible) {
  outline: 2px solid var(--tusz);
  outline-offset: 2px;
}

.ks__wiersz input {
  appearance: none;
  flex: none;
  color: inherit;
  width: 16px;
  height: 16px;
  padding: 3px;
  border: 1px solid currentColor;
  border-radius: 0;
  background: none;
  outline: 0;
  box-shadow: none;
  cursor: pointer;
}

.ks__wiersz input:checked {
  background: currentColor content-box;
}

.ks__nazwa {
  font-weight: 500;
}

.ks__kwota {
  margin-left: auto;
  font-family: var(--f-mono);
  text-align: right;
}

.ks__punkt {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ks .ks__mapa {
  height: 52px;
  padding: 0 22px;
  gap: var(--s-3);
}

.ks__mapa svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
}

.ks__wybrany {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 8px 18px;
  border: 1px dashed var(--tusz);
}

.ks__wybrany > span {
  display: flex;
  flex-direction: column;
}

.ks__wybrany b {
  font-weight: 500;
}

.ks__blad {
  font-size: 14px;
  font-weight: 500;
  color: var(--czerwien);
}

/* pola: krem, obrys, etykieta nad polem, 16 px */
.ks__pola {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border: 0;
  min-width: 0;
}

.ks__pole {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-width: 0;
}

.ks__et {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
}

.ks__et span {
  font-weight: 400;
  color: var(--tusz-2);
}

.ks__pole--rzad {
  grid-column: 1 / -1;
}

.ks__pole input,
.ks__pole textarea,
.ks__pole select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--linia);
  border-radius: 0;
  background: var(--krem);
  font: 400 16px var(--f-tekst);
  color: var(--tusz);
}

.ks__pole select {
  appearance: none;
  padding-right: 44px;
  background: var(--krem)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23111' stroke-width='1.5' stroke-linecap='square'%3E%3Cpath d='M5 7.5l5 5 5-5'/%3E%3C/svg%3E")
    right 14px center / 18px no-repeat;
  cursor: pointer;
}

.ks__pole ::placeholder {
  color: var(--tusz-2);
  opacity: 1;
}

/* dlugi placeholder ulicy na telefonie */
.ks__pole input {
  text-overflow: ellipsis;
}

.ks__pole textarea {
  height: auto;
  padding: var(--s-3) var(--s-4);
  line-height: 1.45;
  resize: vertical;
}

/* po pierwszej probie zamowienia, komunikat dodaje src/js/kasa.js */
.is-proba .ks__pole :invalid {
  border-color: var(--czerwien);
}

.ks__zgoda {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  cursor: pointer;
}

.ks__zgoda input {
  appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid var(--tusz);
  border-radius: 0;
  background: var(--krem);
  cursor: pointer;
}

.ks__zgoda input:checked {
  background: var(--tusz)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23F6EFE4' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E")
    center / 18px no-repeat;
}

.is-proba .ks__zgoda input:invalid {
  border-color: var(--czerwien);
  box-shadow: 0 0 0 1px var(--czerwien);
}

/* zwijany kupon: natywny details, naglowek wyglada jak link */
.ks__wiecej summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  font-weight: 500;
  color: var(--czerwien);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  list-style: none;
}

.ks__wiecej summary::-webkit-details-marker {
  display: none;
}

.ks__wiecej summary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
}

.ks__wiecej[open] summary {
  margin-bottom: var(--s-1);
}

/* podsumowanie: zamowienie w kolorach smakow */
.ks__zam {
  align-self: start;
  padding: 22px 28px 24px;
  background: var(--piasek);
}

.ks__zamh {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ks__zamh h2 {
  font-family: var(--f-druk);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.1;
  text-transform: uppercase;
}

.ks__grupy {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 18px;
  margin-top: 10px;
}

.ks__grupa {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ks__sloiki {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ks__sloik {
  position: relative;
  width: 46px;
  height: 46px;
}

.ks__sloik img {
  position: absolute;
  left: 50%;
  max-width: none;
  transform: translateX(-50%);
}

.ks__podpis {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--tusz-2);
}

.ks__lista {
  margin-top: 14px;
}

.ks__poz {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 10px 0;
  border-top: 1px dashed var(--tusz);
}

.ks__poz > span:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.ks__poz b {
  font-weight: 500;
}

.ks__opis {
  font-size: 14px;
  color: var(--tusz-2);
}

.ks__opis--liczba {
  font-family: var(--f-mono);
}

.ks__cena {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
}

.ks__cena > span:first-child {
  display: flex;
  gap: var(--s-2);
  white-space: nowrap;
  font-family: var(--f-mono);
}

.ks__cena s {
  color: var(--tusz-2);
}

.ks__cena small {
  font-size: 12px;
  line-height: 1.45;
  color: var(--tusz-2);
}

.ks__kod {
  padding: 2px 0;
  border-top: 1px dashed var(--tusz);
}

.ks__kodf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s-2);
  align-items: end;
  padding-bottom: 14px;
}

.ks .ks__kodf .btn {
  height: 52px;
}

.ks__kodf .ks__blad {
  grid-column: 1 / -1;
}

.ks__kwoty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: var(--s-3);
  border-top: 1px solid var(--tusz);
  font-size: 14px;
}

.ks__kwoty > div {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
}

.ks__kwoty > div > :last-child {
  font-family: var(--f-mono);
  white-space: nowrap;
}

.ks__kwoty .ks__razem {
  align-items: baseline;
  margin-top: 6px;
}

.ks__razem > :first-child {
  font-weight: 500;
  font-size: 16px;
}

.ks__razem > :last-child {
  font-size: 40px;
  line-height: 1;
}

.ks__vat {
  align-self: flex-end;
  color: var(--tusz-2);
}

/* odstep w srodku opakowania, nie nad nim: zaslona w niskim oknie musi go zakryc */
.ks__kupw {
  padding-top: 14px;
}

.ks__zgody {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0 14px;
  border-top: 1px dashed var(--tusz);
}

.ks .ks__kup {
  height: 56px;
  font-size: 18px;
}

.ks .ks__kup .btn__cena {
  font-size: 16px;
}

/* pasek zamowienia pod naglowkiem, uklad w jednej kolumnie */
.ks__pasek {
  display: none;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  height: 64px;
  padding: 0 16px 0 20px;
  border: 0;
  border-top: 1px dashed var(--tusz);
  border-bottom: 1px dashed var(--tusz);
  background: var(--piasek);
  color: var(--tusz);
  cursor: pointer;
}

.ks__pasek svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  transition: transform var(--czas) var(--krzywa);
}

.ks__pasek[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

.ks__kolory {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  font-family: var(--f-mono);
  font-size: var(--t-liczba);
}

.ks__kolory i {
  flex: none;
  width: 22px;
  height: 22px;
}

.ks__kolory i.is-sub {
  margin-left: var(--s-2);
}

.ks__kolory i.is-sub + i.is-sub {
  margin-left: 0;
}

.ks__pasekr {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  line-height: 1.15;
}

.ks__pasekr span {
  font-size: 14px;
  color: var(--tusz-2);
}

.ks__pasekr b {
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 18px;
}

.ks__zwin {
  display: none;
  padding: 16px 20px 20px;
  border-bottom: 1px dashed var(--tusz);
  background: var(--piasek);
}

.ks__zwin .ks__grupy {
  margin-top: 0;
}

/* podsumowanie stoi, w niskim oknie przewija sie samo, inaczej przycisk znika */
@media (min-width: 1081px) {
  .ks__zam {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* dlugi koszyk: przewija sie sama lista, kwoty, zgoda i przycisk zostaja na widoku */
@media (min-width: 1081px) {
  /* 129 px = naglowek 64 + margines 8 + ramka 1 + padding ramki 36 + 20 zapasu */
  .ks__zam:has(> [data-gora]) {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 129px);
  }

  /* sticky razem ze zgoda, sam przycisk zaslonilby ja na laptopie 1366 x 768
     na `.ks__kupw`, nie na przycisku: tam box-shadow szarzeje na hover */
  .ks__zam .ks__kupw {
    position: sticky;
    bottom: 0;
    z-index: 1;
    background: var(--piasek);
    box-shadow: 0 24px 0 var(--piasek);
  }

  .ks__zam:has(> [data-gora]) > * {
    flex: none;
  }

  .ks__zam > [data-gora] {
    flex: 0 1 auto;
    min-height: 200px;
    margin-right: -14px;
    padding-right: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--tusz) transparent;

    /* cien tylko od strony, gdzie jest co przewinac: zaslony jada, cienie stoja */
    background:
      linear-gradient(var(--piasek) 40%, transparent) top / 100% 28px no-repeat local,
      linear-gradient(transparent, var(--piasek) 60%) bottom / 100% 28px no-repeat local,
      linear-gradient(rgba(19, 19, 19, 0.2), transparent) top / 100% 10px no-repeat scroll,
      linear-gradient(transparent, rgba(19, 19, 19, 0.2)) bottom / 100% 10px no-repeat scroll;
  }
}

@media (max-width: 1080px) {
  .ks__pasek:not([hidden]) {
    display: flex;
  }

  .ks__zwin:not([hidden]) {
    display: block;
  }

  .ks {
    margin-top: 20px;
  }

  .ks__siatka {
    grid-template-columns: minmax(0, 680px);
    gap: 30px;
  }
}

@media (max-width: 720px) {
  .kh {
    gap: 10px;
    height: 56px;
    padding: 0 20px;
  }

  .kh__logo {
    font-size: 16px;
  }

  .kh__logo svg {
    height: 16px;
  }

  .kh__pyt,
  .kh__adres {
    display: none;
  }

  .kh__mail {
    margin-left: auto;
  }

  .kh__pomoc {
    display: inline;
  }

  .kf {
    padding: 0 20px 20px;
  }

  .kf span {
    margin-left: 0;
    padding: 10px 0;
  }

  .ks {
    margin: 0;
    padding: 22px 20px 32px;
    border: 0;
  }

  .ks__form {
    gap: 24px;
  }

  .ks__h1 {
    font-size: 30px;
  }

  .ks__kontur {
    -webkit-text-stroke-width: 1.2px;
  }

  .ks__sekcja {
    gap: 14px;
  }

  .ks__h2 {
    gap: 12px;
    padding-bottom: 8px;
    font-size: 18px;
  }

  .ks__h2 span {
    font-size: 26px;
  }

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

  .ks__wiersz {
    min-height: 60px;
  }

  .ks__punkt {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .ks .ks__mapa {
    justify-content: space-between;
    padding: 0 20px;
  }

  .ks__pola {
    gap: 14px 12px;
  }

  .ks__pole--cale {
    grid-column: 1 / -1;
  }

  .ks__zam {
    margin: 0 -20px;
    padding: 22px 20px 24px;
  }

  .ks__razem > :last-child {
    font-size: 32px;
  }
}

/* 320 px: logo i link po prawej nie mieszcza sie obok "/ koszyk" */
@media (max-width: 359px) {
  .kh__gdzie {
    display: none;
  }
}

/* zamiast wylaczonych w functions.php stylow woo; :where() nie dodaje wagi
   plik laduje sie tez na 404 i podziekowaniu przez inc/enqueue.php */
:where(body:not(.woocommerce-order-received, .error404)) .woocommerce .woocommerce-message,
:where(body:not(.woocommerce-order-received, .error404)) .woocommerce .woocommerce-error,
:where(body:not(.woocommerce-order-received, .error404)) .woocommerce .woocommerce-info {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px dashed var(--tusz);
  list-style: none;
  font-size: 14px;
  line-height: 1.5;
}

:where(body:not(.woocommerce-order-received, .error404)) .woocommerce .woocommerce-error {
  border-color: var(--czerwien);
  color: var(--czerwien);
  font-weight: 500;
}

:where(body:not(.woocommerce-order-received, .error404)) .woocommerce > .woocommerce-notices-wrapper > *,
:where(body:not(.woocommerce-order-received, .error404)) .woocommerce > .woocommerce-message,
:where(body:not(.woocommerce-order-received, .error404)) .woocommerce > .woocommerce-error,
:where(body:not(.woocommerce-order-received, .error404)) .woocommerce > .woocommerce-info {
  margin: 8px 20px 0;
}

:where(body:not(.woocommerce-order-received, .error404)) .checkout-inline-error-message,
:where(body:not(.woocommerce-order-received, .error404)) .ks .ks__pole .ks__blad {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--czerwien);
}

:where(body:not(.woocommerce-order-received, .error404)) .ks .woocommerce-invalid input,
:where(body:not(.woocommerce-order-received, .error404)) .ks .woocommerce-invalid select,
:where(body:not(.woocommerce-order-received, .error404)) .ks [aria-invalid='true'] {
  border-color: var(--czerwien);
}

/* stylelint-disable selector-class-pattern -- nazwy klas z woo */
:where(body:not(.woocommerce-order-received, .error404)) .ks .wc_payment_methods {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* !important: przy jednej bramce checkout.js woo chowa radio stylem inline */
:where(body:not(.woocommerce-order-received, .error404)) .ks .wc_payment_method .input-radio {
  display: block !important;
}

:where(body:not(.woocommerce-order-received, .error404)) .ks .payment_box {
  font-size: 14px;
  line-height: 1.45;
  color: var(--tusz-2);
}

:where(body:not(.woocommerce-order-received, .error404)) .ks .payment_box p {
  margin: 0;
}
/* stylelint-enable selector-class-pattern */

:where(body:not(.woocommerce-order-received, .error404)) .ks .ks__kup[data-razem]::after {
  content: attr(data-razem);
  font-family: var(--f-mono);
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
}

:where(body:not(.woocommerce-order-received, .error404)) .ks .ks__kup {
  gap: 16px;
}

:where(body:not(.woocommerce-order-received, .error404)) .ks .woocommerce-remove-coupon {
  margin-left: 6px;
  font-size: 13px;
}

:where(body:not(.woocommerce-order-received, .error404)) .ks__paczkomat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

:where(body:not(.woocommerce-order-received, .error404)) .ks__paczkomat .checkout-inline-error-message {
  margin-top: 4px;
}

/* stylelint-disable selector-class-pattern -- nazwy klas z jQuery BlockUI, !important, bo
   blockUI wpisuje tlo nakladki w atrybut style */
:where(body:not(.woocommerce-order-received, .error404)) .ks .blockUI.blockOverlay {
  background: var(--krem) !important;
}
/* stylelint-enable selector-class-pattern */

:where(body:not(.woocommerce-order-received, .error404)) .ks .woocommerce-bacs-bank-details {
  margin-top: 24px;
}

:where(body:not(.woocommerce-order-received, .error404)) .ks .woocommerce-bacs-bank-details ul {
  list-style: none;
  padding: 0;
}

:where(body:not(.woocommerce-order-received, .error404)) .ks .wc-bacs-bank-details-heading,
:where(body:not(.woocommerce-order-received, .error404)) .ks .wc-bacs-bank-details-account-name {
  font-family: var(--f-druk);
  font-weight: 500;
  font-size: 18px;
  text-transform: uppercase;
}
