/*
 * Cookies consent
 * Used by: tuki cookie consent system (box-cookieterms)
 */

/* ─── Overlay backdrop ────────────────────────────────────────────── */

.box-cookieterms {
  position: fixed;
  inset: 0;
  background-color: var(--color-cookies-backdrop);
  z-index: 200;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.cookieterms-hidden .box-cookieterms {
  opacity: 0;
  visibility: hidden;
}

/* ─── Inner panel ─────────────────────────────────────────────────── */

.cookieterms-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 2rem);
  max-width: 580px;
  background-color: var(--color-cookies-bg);
  color: var(--color-cookies-text);
  padding: 1rem;
  border-radius: 0;
}

/* ─── Scrollable content area ─────────────────────────────────────── */

.cookieterms-content {
  font-size: 0.889rem; /* 16px */
  line-height: 1.4;
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
  padding: 0 1rem;
  margin: 0 -1rem;
}

/* ─── Text block ──────────────────────────────────────────────────── */

.cookieterms-text {
  margin-bottom: 1rem;
}

.cookieterms-text strong:first-child,
.cookieterms-text b:first-child {
  display: block;
  font-size: 1.111rem; /* 20px */
}

/* ─── Button groups ───────────────────────────────────────────────── */

.cookieterms-actions,
.cookieterms-settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

@media (width >= 576px) {
  .cookieterms-actions,
  .cookieterms-settings-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* ─── Buttons (common) ────────────────────────────────────────────── */

.cookieterms-customize,
.cookieterms-decline,
.cookieterms-accept,
.cookieterms-save {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.889rem; /* 16px */
  font-weight: 600;
  text-align: center;
  border-radius: 0.25rem;
  border: 2px solid var(--color-cookies-text);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

@media (width >= 576px) {
  .cookieterms-customize,
  .cookieterms-decline,
  .cookieterms-accept,
  .cookieterms-save {
    width: auto;
    padding: 0.5rem 1.5rem;
  }
}

/* Outline buttons */
.cookieterms-customize,
.cookieterms-decline,
.cookieterms-save {
  background-color: transparent;
  color: var(--color-cookies-text);
}

.cookieterms-customize:hover,
.cookieterms-decline:hover,
.cookieterms-save:hover {
  background-color: var(--color-cookies-text);
  color: var(--color-orange);
}

/* Primary button */
.cookieterms-accept {
  background-color: var(--color-cookies-text);
  color: var(--color-orange);
}

.cookieterms-accept:hover {
  background-color: transparent;
  color: var(--color-cookies-text);
}

/* ─── Settings group ──────────────────────────────────────────────── */

.cookieterms-settings-group {
  margin-bottom: 1rem;
}

.cookieterms-settings-group-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.cookieterms-settings-group-title {
  font-weight: 700;
}

.cookieterms-settings-group-check {
  position: relative;
}

.cookieterms-settings-group-check input[type="checkbox"] {
  appearance: none;
  width: 2.5rem;
  height: 1.25rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
}

.cookieterms-settings-group-check input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  background-color: var(--color-white);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.cookieterms-settings-group-check input[type="checkbox"]:checked {
  background-color: var(--color-cookies-text);
}

.cookieterms-settings-group-check input[type="checkbox"]:checked::after {
  transform: translateX(1.25rem);
}

/* ─── Cookie settings button (footer) ────────────────────────────── */

.cookie-settings-button {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
