/**
 * ALTHÉA Cookies Manager
 * Design front premium
 */

:root {
  --althea-cookie-green: #0b4a3a;
  --althea-cookie-green-dark: #062d24;
  --althea-cookie-gold: #d7b56a;
  --althea-cookie-gold-dark: #9a6d1d;
  --althea-cookie-cream: #fbf7f0;
  --althea-cookie-ivory: #fffdf9;
  --althea-cookie-text: #173e34;
  --althea-cookie-muted: #5b6f69;
  --althea-cookie-border: rgba(11, 74, 58, 0.16);
  --althea-cookie-shadow: 0 24px 70px rgba(6, 45, 36, 0.18);
  --althea-cookie-transition: 180ms ease;
}

.althea-cookie-manager,
.althea-cookie-manager * { box-sizing: border-box; }

.althea-cookie-manager[hidden],
.althea-cookie-banner[hidden],
.althea-cookie-preferences[hidden],
.althea-cookie-manager__backdrop[hidden],
.althea-cookie-reopen[hidden] { display: none !important; }

.althea-cookie-manager {
  position: relative;
  z-index: 2147483000;
  color: var(--althea-cookie-text);
  font-family: Arial, Helvetica, sans-serif;
}

.althea-cookie-manager button,
.althea-cookie-manager input { font: inherit; }
.althea-cookie-manager button { cursor: pointer; }

.althea-cookie-manager__backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  background: rgba(6, 45, 36, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: altheaCookieFadeIn 180ms ease both;
}

.althea-cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 2147483002;
  max-width: 1180px;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,253,249,.98), rgba(251,247,240,.98));
  border: 1px solid rgba(215,181,106,.62);
  border-radius: 22px;
  box-shadow: var(--althea-cookie-shadow);
  animation: altheaCookieSlideUp 320ms cubic-bezier(.2,.75,.25,1) both;
}

.althea-cookie-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(215,181,106,.14), transparent 22%),
    radial-gradient(circle at 88% 84%, rgba(11,74,58,.10), transparent 24%);
}

.althea-cookie-banner__content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(250px,.85fr) minmax(320px,1.4fr) auto;
  align-items: center;
  gap: 28px;
  padding: 28px 30px;
}

.althea-cookie-banner__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.althea-cookie-banner__monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  color: var(--althea-cookie-gold);
  background: linear-gradient(135deg,var(--althea-cookie-green-dark),var(--althea-cookie-green));
  border: 1px solid rgba(215,181,106,.55);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(6,45,36,.18);
  font-family: Georgia,"Times New Roman",serif;
  font-size: 25px;
}

.althea-cookie-banner__eyebrow,
.althea-cookie-preferences__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--althea-cookie-gold-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.althea-cookie-banner h2,
.althea-cookie-preferences__header h2 {
  margin: 0;
  color: var(--althea-cookie-green-dark);
  font-family: Georgia,"Times New Roman",serif;
  font-weight: 400;
  line-height: 1.2;
}
.althea-cookie-banner h2 { font-size: 24px; }
.althea-cookie-preferences__header h2 { font-size: 27px; }

.althea-cookie-banner__text p,
.althea-cookie-preferences__intro,
.althea-cookie-category > p {
  color: var(--althea-cookie-muted);
  line-height: 1.65;
}

.althea-cookie-banner__text p {
  margin: 0 0 8px;
  font-size: 14px;
}

.althea-cookie-banner__privacy-link {
  color: var(--althea-cookie-green);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.althea-cookie-banner__privacy-link:hover,
.althea-cookie-banner__privacy-link:focus { color: var(--althea-cookie-gold-dark); }

.althea-cookie-banner__actions {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  gap: 9px;
}

.althea-cookie-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  transition: all var(--althea-cookie-transition);
}
.althea-cookie-button:hover { transform: translateY(-1px); }

.althea-cookie-button--primary {
  color: #fff;
  background: var(--althea-cookie-green);
  border-color: var(--althea-cookie-green);
  box-shadow: 0 8px 18px rgba(11,74,58,.18);
}
.althea-cookie-button--primary:hover,
.althea-cookie-button--primary:focus {
  color: var(--althea-cookie-green-dark);
  background: var(--althea-cookie-gold);
  border-color: var(--althea-cookie-gold);
}

.althea-cookie-button--secondary {
  color: var(--althea-cookie-green);
  background: transparent;
  border-color: rgba(11,74,58,.28);
}
.althea-cookie-button--secondary:hover,
.althea-cookie-button--secondary:focus {
  color: #fff;
  background: var(--althea-cookie-green-dark);
  border-color: var(--althea-cookie-green-dark);
}

.althea-cookie-button--link {
  min-height: auto;
  justify-content: space-between;
  padding: 5px 2px 0;
  color: var(--althea-cookie-green);
  background: transparent;
  border: 0;
  border-radius: 0;
}

.althea-cookie-preferences {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2147483003;
  width: min(720px,calc(100vw - 32px));
  max-height: min(820px,calc(100vh - 32px));
  overflow: hidden;
  background: var(--althea-cookie-ivory);
  border: 1px solid rgba(215,181,106,.55);
  border-radius: 22px;
  box-shadow: 0 35px 100px rgba(6,45,36,.32);
  transform: translate(-50%,-50%);
  animation: altheaCookieModalIn 260ms cubic-bezier(.2,.75,.25,1) both;
}

.althea-cookie-preferences::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg,var(--althea-cookie-green-dark),var(--althea-cookie-green),var(--althea-cookie-gold));
}

.althea-cookie-preferences__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 20px;
  background: linear-gradient(145deg,#fffdf9 0%,#f8f1e6 100%);
  border-bottom: 1px solid var(--althea-cookie-border);
}

.althea-cookie-preferences__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--althea-cookie-green);
  background: rgba(11,74,58,.06);
  border: 1px solid rgba(11,74,58,.16);
  border-radius: 50%;
  font-size: 27px;
  transition: all var(--althea-cookie-transition);
}
.althea-cookie-preferences__close:hover,
.althea-cookie-preferences__close:focus {
  color: #fff;
  background: var(--althea-cookie-green);
}

.althea-cookie-preferences__body {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding: 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(11,74,58,.34) transparent;
}

.althea-cookie-preferences__intro {
  margin: 0 0 22px;
  font-size: 14px;
}

.althea-cookie-preferences__categories {
  display: grid;
  gap: 14px;
}

.althea-cookie-category {
  padding: 19px 20px;
  background: #fff;
  border: 1px solid var(--althea-cookie-border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(6,45,36,.05);
}

.althea-cookie-category__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.althea-cookie-category__heading > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.althea-cookie-category__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: var(--althea-cookie-gold-dark);
  background: #fff8e8;
  border: 1px solid rgba(215,181,106,.42);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.althea-cookie-category h3 {
  margin: 0 0 3px;
  color: var(--althea-cookie-green-dark);
  font-size: 16px;
  font-weight: 700;
}

.althea-cookie-category__status {
  color: var(--althea-cookie-gold-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.althea-cookie-category > p {
  margin: 14px 0 0 50px;
  font-size: 13px;
}

.althea-cookie-preferences__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px 22px;
  background: #fbf7f0;
  border-top: 1px solid var(--althea-cookie-border);
}

.althea-cookie-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 50px;
  height: 28px;
}
.althea-cookie-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.althea-cookie-switch__slider,
.althea-cookie-switch--locked {
  position: absolute;
  inset: 0;
  display: block;
  background: #d5ddd9;
  border: 1px solid rgba(11,74,58,.14);
  border-radius: 999px;
  transition: background-color var(--althea-cookie-transition);
}

.althea-cookie-switch__slider::before,
.althea-cookie-switch--locked::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(6,45,36,.18);
  transition: transform var(--althea-cookie-transition);
}

.althea-cookie-switch input:checked + .althea-cookie-switch__slider,
.althea-cookie-switch--locked { background: var(--althea-cookie-green); }

.althea-cookie-switch input:checked + .althea-cookie-switch__slider::before,
.althea-cookie-switch--locked::before { transform: translateX(22px); }

.althea-cookie-reopen {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 2147482999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 13px 7px 7px;
  color: #fff;
  background: var(--althea-cookie-green-dark);
  border: 1px solid rgba(215,181,106,.58);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(6,45,36,.22);
  transition: all var(--althea-cookie-transition);
}
.althea-cookie-reopen:hover,
.althea-cookie-reopen:focus {
  color: var(--althea-cookie-green-dark);
  background: var(--althea-cookie-gold);
  transform: translateY(-2px);
}

.althea-cookie-reopen__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--althea-cookie-gold);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  font-family: Georgia,"Times New Roman",serif;
  font-weight: 700;
}
.althea-cookie-reopen__label { font-size: 12px; font-weight: 700; }

.althea-cookie-manager :focus-visible {
  outline: 3px solid rgba(215,181,106,.62);
  outline-offset: 3px;
}
.althea-cookie-script-container { display: none !important; }

@media (max-width: 1024px) {
  .althea-cookie-banner__content { grid-template-columns: 1fr 1.35fr; }
  .althea-cookie-banner__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    min-width: 0;
  }
  .althea-cookie-banner__actions .althea-cookie-button { flex: 1 1 0; }
  .althea-cookie-button--link {
    justify-content: center;
    gap: 10px;
    padding-top: 11px;
    border: 1px solid rgba(11,74,58,.18);
    border-radius: 999px;
  }
}

@media (max-width: 767px) {
  .althea-cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    border-radius: 18px;
  }
  .althea-cookie-banner__content { display: block; padding: 21px 18px 18px; }
  .althea-cookie-banner__brand { align-items: flex-start; margin-bottom: 15px; }
  .althea-cookie-banner__monogram {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    font-size: 21px;
  }
  .althea-cookie-banner h2 { font-size: 21px; }
  .althea-cookie-banner__text { margin-bottom: 16px; }
  .althea-cookie-banner__text p { font-size: 13px; line-height: 1.55; }
  .althea-cookie-banner__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .althea-cookie-button--link { grid-column: 1 / -1; }
  .althea-cookie-preferences {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: calc(100vh - 16px);
    border-radius: 18px;
    transform: none;
    animation: altheaCookieSheetIn 260ms cubic-bezier(.2,.75,.25,1) both;
  }
  .althea-cookie-preferences__header { padding: 20px 18px 16px; }
  .althea-cookie-preferences__header h2 { font-size: 22px; }
  .althea-cookie-preferences__body { max-height: calc(100vh - 215px); padding: 18px; }
  .althea-cookie-category { padding: 16px; }
  .althea-cookie-category__heading { align-items: flex-start; }
  .althea-cookie-category > p { margin-left: 0; }
  .althea-cookie-preferences__footer {
    display: grid;
    grid-template-columns: 1fr;
    padding: 14px 18px 18px;
  }
  .althea-cookie-preferences__footer .althea-cookie-button { width: 100%; }
  .althea-cookie-reopen { left: 10px; bottom: 10px; }
}

@media (max-width: 420px) {
  .althea-cookie-banner__actions { grid-template-columns: 1fr; }
  .althea-cookie-button--link { grid-column: auto; }
  .althea-cookie-category__icon { display: none; }
  .althea-cookie-category__heading > div { gap: 0; }
}

@media (prefers-color-scheme: dark) {
  .althea-cookie-banner,
  .althea-cookie-preferences {
    color: #edf5f2;
    background: linear-gradient(145deg,rgba(8,39,32,.98),rgba(10,55,44,.98));
    border-color: rgba(215,181,106,.48);
  }
  .althea-cookie-banner h2,
  .althea-cookie-preferences__header h2,
  .althea-cookie-category h3 { color: #fff; }
  .althea-cookie-banner__text p,
  .althea-cookie-preferences__intro,
  .althea-cookie-category > p { color: #c9d8d3; }
  .althea-cookie-preferences__header,
  .althea-cookie-preferences__footer { background: rgba(255,255,255,.035); }
  .althea-cookie-category {
    background: rgba(255,255,255,.045);
    border-color: rgba(255,255,255,.11);
  }
}

@keyframes altheaCookieFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes altheaCookieSlideUp {
  from { opacity: 0; transform: translateY(28px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes altheaCookieModalIn {
  from { opacity: 0; transform: translate(-50%,-47%) scale(.97); }
  to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
@keyframes altheaCookieSheetIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .althea-cookie-manager *,
  .althea-cookie-manager *::before,
  .althea-cookie-manager *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
