/**
 * pysieccookies - baner zgód (szeroki pasek wyśrodkowany na dole; na telefonie pasek nad dolnym menu)
 * i okno ustawień. Kolory i zaokrąglenia jak w reszcie sklepu. Sesja 2026-10-23.
 */
.pysiec-cookies[hidden],
.pysiec-cookies-modal[hidden] {
  display: none !important;
}

/* Wyśrodkowany na dole (left/right 0 + margin auto, nie transform - transform zajmuje animacja). */
.pysiec-cookies {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 1070;
  width: min(1040px, calc(100vw - 40px));
  margin-inline: auto;
  padding: 18px 18px 16px;
  border: 1px solid rgba(62, 47, 35, .12);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(30, 22, 16, .18);
  color: #3e2f23;
  font-size: 13.5px;
  line-height: 1.5;
  animation: pysiec-cookies-in .3s ease-out;
}

.pysiec-cookies__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pysiec-cookies__icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: #b08858;
}

.pysiec-cookies__title {
  margin: 0;
  font-family: var(--pysiec-font-heading, 'Nunito', sans-serif);
  font-size: 16px;
  font-weight: 800;
  color: #1a1a18;
}

.pysiec-cookies__text {
  margin: 0 0 14px;
  color: rgba(62, 47, 35, .85);
}

.pysiec-cookies__link {
  color: #3e2f23;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pysiec-cookies__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pysiec-cookies__btn {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #3e2f23;
  border-radius: 999px;
  background: #fff;
  color: #3e2f23;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.pysiec-cookies__btn:hover,
.pysiec-cookies__btn:focus-visible {
  border-color: #3e2f23;
  background: #3e2f23;
  color: #fff;
}

.pysiec-cookies__btn--primary {
  border-color: #8a6535;
  background: #8a6535;
  color: #fff;
}

.pysiec-cookies__btn--primary:hover,
.pysiec-cookies__btn--primary:focus-visible {
  border-color: #704f27;
  background: #704f27;
}

/* "Ustawienia" - ten sam obły przycisk, jaśniejsza ramka (najniżej w hierarchii); na telefonie
   pod dwoma głównymi, na całą szerokość. 2026-10-23. */
.pysiec-cookies__btn--settings {
  grid-column: 1 / -1;
  border-color: rgba(62, 47, 35, .3);
}

/* Desktop: szeroki pasek - tytuł i tekst po lewej, przyciski w jednym rzędzie po prawej. 2026-10-23. */
@media (min-width: 992px) {
  .pysiec-cookies {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "head actions"
      "text actions";
    column-gap: 32px;
    align-items: center;
    padding: 20px 24px;
  }

  .pysiec-cookies__head {
    grid-area: head;
  }

  .pysiec-cookies__text {
    grid-area: text;
    margin: 0;
  }

  .pysiec-cookies__actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .pysiec-cookies__btn {
    height: 44px;
    padding: 0 22px;
  }

  /* Kolejność: Ustawienia · Tylko niezbędne · Akceptuję wszystkie (główny przycisk na końcu). */
  .pysiec-cookies__btn--settings {
    order: -1;
  }

  .pysiec-cookies__btn--primary {
    order: 1;
  }
}

/* Telefon: pasek nad dolnym menu (pysiec-tabbar ~60 px) */
@media (max-width: 991.98px) {
  .pysiec-cookies {
    left: 10px;
    right: 10px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    width: auto;
    padding: 14px 14px 12px;
  }
}

/* Okno ustawień */
html.pysiec-cookies-modal-open,
html.pysiec-cookies-modal-open body {
  overflow: hidden;
}

.pysiec-cookies-modal {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pysiec-cookies-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 16, .45);
}

.pysiec-cookies-modal__dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 26px 24px 20px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(30, 22, 16, .25);
  color: #3e2f23;
  outline: none;
  animation: pysiec-cookies-in .2s ease-out;
}

.pysiec-cookies-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(62, 47, 35, .2);
  border-radius: 50%;
  background: #fff;
  color: #3e2f23;
  cursor: pointer;
}

.pysiec-cookies-modal__close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.pysiec-cookies-modal__title {
  margin: 0 44px 6px 0;
  font-family: var(--pysiec-font-heading, 'Nunito', sans-serif);
  font-size: 20px;
  font-weight: 800;
  color: #1a1a18;
}

.pysiec-cookies-modal__intro {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: rgba(62, 47, 35, .75);
}

.pysiec-cookies-modal__cat {
  display: block;
  margin-bottom: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--pysiec-cream-light, #f6efe3);
  cursor: default;
}

label.pysiec-cookies-modal__cat {
  cursor: pointer;
}

.pysiec-cookies-modal__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.pysiec-cookies-modal__cat-name {
  font-size: 14.5px;
  font-weight: 800;
  color: #1a1a18;
}

.pysiec-cookies-modal__always {
  font-size: 12px;
  font-weight: 700;
  color: #5d7030;
}

.pysiec-cookies-modal__cat-desc {
  display: block;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(62, 47, 35, .78);
}

/* Przełącznik */
.pysiec-cookies-switch {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 24px;
}

.pysiec-cookies-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pysiec-cookies-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(62, 47, 35, .25);
  transition: background-color .15s ease;
  pointer-events: none;
}

.pysiec-cookies-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .15s ease;
}

.pysiec-cookies-switch input:checked + .pysiec-cookies-switch__track {
  background: #8a6535;
}

.pysiec-cookies-switch input:checked + .pysiec-cookies-switch__track::after {
  transform: translateX(20px);
}

.pysiec-cookies-switch input:focus-visible + .pysiec-cookies-switch__track {
  box-shadow: 0 0 0 3px rgba(138, 101, 53, .3);
}

.pysiec-cookies-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

@keyframes pysiec-cookies-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pysiec-cookies,
  .pysiec-cookies-modal__dialog {
    animation: none;
  }
}
