/* Cookie banner styles. Markup: templates/_privacy/cookie-banner.twig. Behavior: cookie-banner.js. */

.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 32px;
  padding: 16px 24px;
  background: var(--white);
  box-shadow: 0 -6px 20px -10px var(--primary);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__text {
  margin: 0;
  color: var(--primary);
  font-size: 17px;
  line-height: 1.5;
}

.cookie-banner__actions {
  display: flex;
  gap: 12px;
}

/* Shown while the banner is closed, so the choice can be changed later. A round cookie button that
   slides open to show its name on hover or keyboard focus. Desktop only: on phones the footer's
   Cookie Settings link does the job and nothing floats over the page. */
.cookie-settings-tab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2999;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: 22px;
  background: var(--secondary);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.35);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cookie-settings-tab__icon {
  flex: none;
}

.cookie-settings-tab__label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.25s ease, margin 0.25s ease, opacity 0.2s ease;
}

.cookie-settings-tab:hover,
.cookie-settings-tab:focus-visible {
  background: var(--primary);
  color: var(--secondary);
}

.cookie-settings-tab:hover .cookie-settings-tab__label,
.cookie-settings-tab:focus-visible .cookie-settings-tab__label {
  max-width: 140px;
  margin-left: 8px;
  opacity: 1;
}

.cookie-settings-tab[hidden] {
  display: none;
}

/* The answer already given, when the banner is reopened: a line of text plus a tick on the chosen button. */
.cookie-banner__status {
  flex-basis: 100%;
  margin: 0;
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.cookie-banner__status[hidden] {
  display: none;
}

.cookie-banner [aria-pressed="true"] {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.cookie-banner [aria-pressed="true"]::before {
  content: "\2713\00a0";
}

/* Badge on the round button: a tick when cookies are accepted, a cross when rejected. */
.cookie-settings-tab::after {
  position: absolute;
  top: -4px;
  right: -4px;
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
}

.cookie-settings-tab[data-choice="allow"]::after {
  content: "\2713";
  display: block;
}

.cookie-settings-tab[data-choice="deny"]::after {
  content: "\2715";
  display: block;
}

@media (max-width: 768px) {
  .cookie-settings-tab {
    display: none;
  }
}

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .cookie-banner__actions .btn {
    flex: 1 1 0;
    padding-right: 12px;
    padding-left: 12px;
  }
}
