/* ==========================================================================
   Cookie banner (partials/cookie-consent.html, js/modules/cookie-consent.js)
   Fixed at the bottom left, in the language of the site: dashed cream card
   like the hero fragments, pink [ label ], mono details.
   ========================================================================== */

.cookie-consent {
  position: fixed;
  left: 2.7778vw;
  bottom: 2.7778vw;
  z-index: var(--z-consent);
  width: 30.5556vw;
  padding: 1.6667vw;
  display: grid;
  gap: 1.1111vw;
  color: var(--color-black);
  background-color: var(--color-cream);
  border: 1px dashed var(--color-black);
  border-radius: var(--radius-fluid);
}

.cookie-consent__label {
  width: fit-content;
  padding: 0.5556vw 0.8333vw;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9722vw;
  line-height: 1.1;
  letter-spacing: 0.2083vw;
  background-color: var(--color-pink);
  outline-offset: 4px;
}

.cookie-consent__text {
  font-family: var(--font-sans);
  font-size: 1.1111vw;
  line-height: 1.3;
}

.cookie-consent__text a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  white-space: nowrap;
}

.cookie-consent__text a:hover {
  color: var(--color-red);
}

/* Preferences: one row per category, switch on the right */
.cookie-consent__prefs {
  display: grid;
  gap: 1.1111vw;
}

.cookie-consent__options {
  min-width: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8333vw;
  border: 0;
}

.cookie-consent__option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.2778vw 1.1111vw;
  padding-top: 0.8333vw;
  border-top: 1px dashed var(--color-black);
}

.cookie-consent__option-name {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9722vw;
  line-height: 1.1;
}

.cookie-consent__option-text {
  grid-column: 1;
  font-family: var(--font-sans);
  font-size: 0.9722vw;
  line-height: 1.3;
}

.cookie-consent__switch {
  grid-column: 2;
  grid-row: 1 / 3;
  position: relative;
  width: 2.9167vw;
  height: 1.6667vw;
  appearance: none;
  cursor: pointer;
  background-color: var(--color-cream);
  border: 1px solid var(--color-black);
  border-radius: 999px;
  transition: background-color 0.3s var(--ease-out-quint);
}

.cookie-consent__switch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.2083vw;
  width: 1.1111vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--color-black);
  translate: 0 -50%;
  transition: translate 0.3s var(--ease-out-quint);
}

.cookie-consent__switch:checked {
  background-color: var(--color-pink);
}

.cookie-consent__switch:checked::before {
  translate: 1.25vw -50%;
}

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

/* Buttons: "recusar" and "aceitar" with the same weight (LGPD) */
.cookie-consent__actions {
  display: flex;
  align-items: center;
  gap: 0.5556vw;
}

.cookie-consent__button {
  padding: 1.0417vw 1.6667vw;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.1111vw;
  line-height: 1.1;
  border: 1px solid var(--color-black);
  border-radius: var(--radius-fluid);
}

.cookie-consent__button--accept {
  background-color: var(--color-pink);
}

.cookie-consent__button--save {
  justify-self: start;
  background-color: var(--color-pink);
}

.cookie-consent__customize {
  margin-left: auto;
  padding: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9722vw;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cookie-consent__customize:hover {
  color: var(--color-red);
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent__switch,
  .cookie-consent__switch::before {
    transition: none;
  }
}

/* Tablet: fixed sizes, the 1440 vw values get too small here */
@media (max-width: 1024px) {
  .cookie-consent {
    left: 24px;
    bottom: 24px;
    width: 400px;
    padding: 22px;
    gap: 14px;
    border-radius: var(--radius);
  }

  .cookie-consent__label,
  .cookie-consent__option-name,
  .cookie-consent__customize {
    font-size: 13px;
  }

  .cookie-consent__label {
    padding: 7px 11px;
    letter-spacing: 3px;
  }

  .cookie-consent__text,
  .cookie-consent__button {
    font-size: 15px;
  }

  .cookie-consent__option-text {
    font-size: 13px;
  }

  .cookie-consent__prefs,
  .cookie-consent__options {
    gap: 12px;
  }

  .cookie-consent__option {
    gap: 4px 14px;
    padding-top: 12px;
  }

  .cookie-consent__switch {
    width: 42px;
    height: 24px;
  }

  .cookie-consent__switch::before {
    left: 3px;
    width: 16px;
  }

  .cookie-consent__switch:checked::before {
    translate: 18px -50%;
  }

  .cookie-consent__actions {
    gap: 8px;
  }

  .cookie-consent__button {
    padding: 14px 22px;
    border-radius: var(--radius);
  }
}

/* Mobile: full width, based on the 440px frame (1vw = 4.4px) */
@media (max-width: 767px) {
  .cookie-consent {
    left: 3.6364vw;
    right: 3.6364vw;
    bottom: 3.6364vw;
    width: auto;
    padding: 5.4545vw;
    gap: 3.6364vw;
  }

  .cookie-consent__label,
  .cookie-consent__option-name,
  .cookie-consent__customize {
    font-size: 3.1818vw;
  }

  .cookie-consent__label {
    padding: 1.8182vw 2.7273vw;
    letter-spacing: 0.6818vw;
  }

  .cookie-consent__text,
  .cookie-consent__button {
    font-size: 3.6364vw;
  }

  .cookie-consent__option-text {
    font-size: 3.1818vw;
  }

  .cookie-consent__prefs,
  .cookie-consent__options {
    gap: 3.6364vw;
  }

  .cookie-consent__option {
    gap: 0.9091vw 3.6364vw;
    padding-top: 3.6364vw;
  }

  .cookie-consent__switch {
    width: 10.9091vw;
    height: 6.3636vw;
  }

  .cookie-consent__switch::before {
    left: 0.6818vw;
    width: 4.5455vw;
  }

  .cookie-consent__switch:checked::before {
    translate: 4.5455vw -50%;
  }

  .cookie-consent__actions {
    flex-wrap: wrap;
    gap: 2.2727vw;
  }

  .cookie-consent__button {
    flex: 1 1 0;
    padding: 3.6364vw 5.4545vw;
  }

  .cookie-consent__customize {
    flex-basis: 100%;
    margin: 0;
    padding-top: 1.3636vw;
  }
}
