.cookie-layer[hidden] {
  display: none !important;
}

html.chrome-wait .cookie-layer {
  visibility: hidden;
}

.cookie-layer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(26, 28, 30, 0.4);
}

html.night-board .cookie-layer {
  background: rgba(42, 24, 10, 0.45);
}

html.night-board .cookie-row input[type="checkbox"] {
  background: var(--paper-deep);
}

html.night-board .cookie-board {
  background-color: #6a4424;
  background-image:
    linear-gradient(180deg, rgba(52, 30, 10, 0.4), rgba(28, 14, 4, 0.48)),
    url("../images/cork.webp"),
    linear-gradient(180deg, #4a3418, #6a4a28 38%, #3f2c16);
}

html.night-board .cookie-board::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--moulding));
  z-index: 0;
  pointer-events: none;
  border: var(--moulding) solid rgba(42, 22, 8, 0.42);
  box-sizing: border-box;
}

.cookie-board {
  --moulding: 34px;
  position: relative;
  width: min(500px, 100%);
  padding: 6px;
  border: var(--moulding) solid #5c4428;
  border-image-source: url("../images/frame-oak.webp");
  border-image-slice: 10%;
  border-image-width: var(--moulding);
  border-image-repeat: round;
  background-color: #c4a06a;
  background-image:
    url("../images/cork.webp"),
    linear-gradient(180deg, #5c4428, #8a6a40 38%, #5a4328);
  background-repeat: repeat, no-repeat;
  background-size: 300px, auto;
  background-origin: content-box, padding-box;
  background-clip: content-box, padding-box;
  box-shadow:
    inset 0 2px 5px rgba(20, 12, 4, 0.55),
    inset 0 -1px 0 rgba(255, 230, 180, 0.12),
    0 0 0 1px rgba(70, 48, 22, 0.45),
    0 18px 48px rgba(0, 0, 0, 0.5),
    0 40px 80px rgba(0, 0, 0, 0.28);
}

@supports (background-image: image-set(url("x.avif") type("image/avif"))) {
  .cookie-board {
    border-image-source: url("../images/frame-oak.avif");
    background-image:
      url("../images/cork.avif"),
      linear-gradient(180deg, #5c4428, #8a6a40 38%, #5a4328);
  }

  html.night-board .cookie-board {
    background-image:
      linear-gradient(180deg, rgba(52, 30, 10, 0.4), rgba(28, 14, 4, 0.48)),
      url("../images/cork.avif"),
      linear-gradient(180deg, #4a3418, #6a4a28 38%, #3f2c16);
  }
}

@media (max-width: 720px) {
  .cookie-board {
    --moulding: 22px;
  }
}

.cookie-note {
  position: relative;
  margin: 1.2rem 1.05rem 1.15rem;
  padding: 1.35rem 1.1rem 1.2rem;
  background: #fffaf0;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.16);
  transform: rotate(-0.5deg);
  color: var(--ink);
}

.cookie-tack {
  top: -12px;
}

.cookie-tape {
  position: absolute;
  top: -8px;
  z-index: 4;
  display: block;
  height: 16px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(246, 238, 220, 0.8),
    rgba(210, 192, 154, 0.48)
  );
  box-shadow: 0 1px 2px rgba(40, 20, 0, 0.18);
}

.cookie-tape-left {
  left: 10%;
  width: 52px;
  transform: rotate(-5.5deg);
}

.cookie-tape-right {
  right: 14%;
  width: 58px;
  transform: rotate(6.5deg);
}

.cookie-note h2 {
  margin: 0.35rem 0 0.55rem;
  font-family: var(--font-hand);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

.cookie-note p,
.cookie-row p {
  margin: 0 0 0.7rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.cookie-note a {
  font-family: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
  transform: rotate(0.5deg);
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  flex: 1 1 9.5rem;
  margin: 0;
  border: 0;
  transform: none;
  min-height: 2.6rem;
  padding: 0.4rem 0.65rem;
  background: #e8e0d0;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px var(--stamp);
}

.cookie-btn-ico {
  display: inline-block;
  margin-right: 0.35em;
  font-weight: 700;
  flex: 0 0 auto;
}

.cookie-btn-ico-end {
  margin-right: 0;
  margin-left: 0.35em;
}

svg.cookie-btn-ico {
  width: 1.05em;
  height: 1.05em;
  fill: currentColor;
}

.cookie-btn-full {
  flex: 1 1 100%;
}

.cookie-btn[data-cookie="reject"] {
  box-shadow:
    inset 0 0 0 1px var(--stamp);
}

.cookie-btn[data-cookie="accept"] {
  box-shadow:
    inset 0 0 0 1px #2f6f4e;
}

.cookie-btn[data-cookie="settings"] {
  box-shadow:
    inset 0 0 0 1px #c45c12;
}

.cookie-btn-ghost {
  flex-basis: 100%;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-hand);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.cookie-btn-ok {
  flex: 0 0 auto;
  background: rgba(47, 111, 78, 0.22);
  color: #1e4d35;
  box-shadow: inset 0 0 0 1px #2f6f4e;
}

.cookie-btn-danger {
  flex: 0 0 auto;
  background: rgba(155, 44, 44, 0.22);
  color: #7a1810;
  box-shadow: inset 0 0 0 1px var(--stamp);
}

.cookie-actions .cookie-btn-danger {
  flex: 1 1 9.5rem;
}

.cookie-btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cookie-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin: 0 0 0.85rem;
}

.cookie-row strong,
.cookie-row label {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.cookie-row p {
  margin: 0.25rem 0 0;
}

.cookie-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  background: #e8e0d0;
  box-shadow:
    inset 0 0 0 1px rgba(62, 48, 28, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  color: var(--ink);
}

.cookie-row input[type="checkbox"]::after {
  content: "";
  font-family: var(--font-hand);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
}

.cookie-row input[type="checkbox"]:checked::after {
  content: "\2713";
}

.cookie-row input[type="checkbox"]:disabled {
  opacity: 0.72;
  cursor: default;
}

.cookie-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cookie-row-agree {
  align-items: center;
}

.cookie-row-agree p {
  margin: 0;
}

.cookie-row-agree label {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: none;
  font-weight: inherit;
  color: inherit;
}

.cookie-note .cookie-row-agree a {
  font-family: inherit;
  font-weight: inherit;
}

.cookie-row-agree input[type="checkbox"] {
  margin-top: 0;
}

.legal-nav .cookie-open {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-family: var(--font-hand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.cookie-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.cookie-alert[hidden] {
  display: none !important;
}

.cookie-alert-icon {
  display: none;
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.12rem;
  fill: currentColor;
}

.cookie-alert-error {
  padding: 0.55rem 0.7rem;
  background: #f4d6d0;
  box-shadow: inset 0 0 0 1px rgba(155, 44, 44, 0.4);
  color: var(--stamp);
}

.cookie-alert-error .cookie-alert-icon {
  display: block;
}

.cookie-alert-error .cookie-alert-icon-ok {
  display: none;
}

.cookie-alert-success {
  padding: 0.55rem 0.7rem;
  background: #d7eadc;
  box-shadow: inset 0 0 0 1px rgba(47, 111, 78, 0.45);
  color: #2f6f4e;
}

.cookie-alert-success .cookie-alert-icon-ok {
  display: block;
}

.cookie-alert-wait {
  padding: 0;
}
