/* =========================================================
   PRINTNERD – CONSENT
========================================================= */

/* =========================================================
   FIRST LAYER – BOTTOM BAR
========================================================= */

.consent-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9990;

  width: 100%;
  background: #000;
  color: #fff;

  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.28);
}

.consent-bar[hidden] {
  display: none;
}

.consent-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;

  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

.consent-bar__content {
  flex: 1;
  min-width: 0;
}

.consent-bar__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.consent-bar__privacy-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-bar__privacy-link:hover,
.consent-bar__privacy-link:focus-visible {
  text-decoration-thickness: 2px;
}

/* =========================================================
   FIRST LAYER – ACTIONS
========================================================= */

.consent-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.consent-button {
  appearance: none;
  border: 0;
  border-radius: 8px;

  padding: 11px 18px;

  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.consent-button--settings {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #fff;
}

.consent-button--settings:hover {
  background: rgba(255, 255, 255, 0.08);
}

.consent-button--accept {
  background: #f2f2f2;
  color: #111111;
}

.consent-button--accept:hover {
  background: #dcdcdc;
}

.consent-button--reject {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #fff;
}

.consent-button--reject:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   SECOND LAYER – MODAL
========================================================= */

.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
}

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

.consent-modal__backdrop {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);

  cursor: default;
}

.consent-modal__dialog {
  position: relative;
  z-index: 1;

  width: min(560px, 100%);
  max-height: calc(100vh - 48px);

  overflow-y: auto;

  padding: 30px;

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;

  background: #111;
  color: #fff;

  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* =========================================================
   MODAL – HEADER
========================================================= */

.consent-modal__header {
  padding-right: 38px;
  margin-bottom: 28px;
}

.consent-modal__title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.2;
}

.consent-modal__description {
  margin: 0;

  color: rgba(255, 255, 255, 0.66);

  font-size: 0.95rem;
  line-height: 1.55;
}

.consent-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;

  padding: 0;

  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);

  font-size: 1.8rem;
  line-height: 1;

  cursor: pointer;
}

.consent-modal__close:hover {
  color: #fff;
}

/* =========================================================
   MODAL – OPTIONS
========================================================= */

.consent-modal__options {
  display: flex;
  flex-direction: column;
}

.consent-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  padding: 22px 0;

  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.consent-option:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.consent-option__content {
  flex: 1;
  min-width: 0;
}

.consent-option__heading {
  margin-bottom: 5px;

  font-size: 1rem;
  font-weight: 600;
}

.consent-option__description {
  margin: 0;

  color: rgba(255, 255, 255, 0.58);

  font-size: 0.86rem;
  line-height: 1.5;
}

/* =========================================================
   SWITCH
========================================================= */

.consent-switch {
  position: relative;

  display: inline-flex;

  width: 48px;
  height: 26px;

  flex: 0 0 48px;

  cursor: pointer;
}

.consent-switch__input {
  position: absolute;

  width: 1px;
  height: 1px;

  opacity: 0;
  pointer-events: none;
}

.consent-switch__slider {
  position: absolute;
  inset: 0;

  border-radius: 999px;

  background: #3a3a3a;

  transition: background-color 0.2s ease;
}

.consent-switch__slider::before {
  content: "";

  position: absolute;
  top: 3px;
  left: 3px;

  width: 20px;
  height: 20px;

  border-radius: 50%;

  background: #fff;

  transition: transform 0.2s ease;
}

.consent-switch__input:checked + .consent-switch__slider {
  background: #f2f2f2;
}

.consent-switch__input:checked + .consent-switch__slider::before {
  background: #111111;
  transform: translateX(22px);
}

.consent-switch__input:focus-visible + .consent-switch__slider {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.consent-switch__input:disabled + .consent-switch__slider {
  opacity: 0.55;
}

.consent-switch:has(.consent-switch__input:disabled) {
  cursor: default;
}

/* =========================================================
   MODAL – FOOTER
========================================================= */

.consent-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  margin-top: 28px;
}

.consent-modal__privacy-link {
  color: rgba(255, 255, 255, 0.72);

  font-size: 0.86rem;

  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-modal__privacy-link:hover {
  color: #fff;
}

.consent-button--confirm {
  background: #f2f2f2;
  color: #111111;
}

.consent-button--confirm:hover {
  background: #dcdcdc;
}

body.consent-modal-open {
  overflow: hidden;
}

/* =========================================================
   ACCESSIBILITY
========================================================= */

.consent-button:focus-visible,
.consent-modal__close:focus-visible,
.consent-bar__privacy-link:focus-visible,
.consent-modal__privacy-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 820px) {
  .consent-bar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;

    padding: 18px;
  }

  .consent-bar__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .consent-bar__actions .consent-button {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.25;
    text-align: center;
  }

  .consent-modal {
    padding: 16px;
  }

  .consent-modal__dialog {
    max-height: calc(100vh - 32px);
    padding: 24px 20px;
  }

  .consent-option {
    gap: 16px;
  }

  .consent-modal__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .consent-modal__privacy-link {
    text-align: center;
  }

  .consent-button--confirm {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .consent-button {
    padding-left: 12px;
    padding-right: 12px;
  }

  .consent-bar__text {
    font-size: 0.88rem;
  }

  .consent-modal__title {
    font-size: 1.3rem;
  }
}
