/* Cookie Consent - advanced preferences */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  padding: clamp(12px, 3vh, 22px) clamp(12px, 4vw, 36px) env(safe-area-inset-bottom, 0) clamp(12px, 4vw, 36px);
  gap: clamp(14px, 3vw, 18px);
  pointer-events: none;
}

.cookie-consent.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: slideUp 0.35s ease-out;
}

.cookie-consent.expanded {
  gap: clamp(16px, 4vw, 24px);
}

.cookie-consent.show > * {
  pointer-events: auto;
}

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

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-bar {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 24px);
  width: 100%;
  max-width: 940px;
  margin: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(18, 6, 10, 0.08);
  border-radius: 999px;
  padding: clamp(12px, 3vw, 16px) clamp(16px, 4vw, 28px);
  color: #2b2729;
  box-shadow: 0 18px 42px rgba(18, 6, 10, 0.18);
  backdrop-filter: blur(10px);
}

.cookie-bar__message {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 14px);
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cookie-bar__message strong {
  font-size: 1rem;
}

.cookie-bar__description {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #4a4045;
  min-width: 0;
}

.cookie-bar__description a {
  color: var(--vermelho-principal);
  font-weight: 600;
  text-decoration: none;
}

.cookie-bar__description a:hover,
.cookie-bar__description a:focus-visible {
  text-decoration: underline;
}

.cookie-bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-bar__button {
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  padding: 10px 18px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cookie-consent.expanded .cookie-bar__button[data-action="manage"] {
  background: rgba(168, 9, 39, 0.12);
  border-color: rgba(168, 9, 39, 0.32);
  color: var(--vermelho-principal);
}

.cookie-dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(18, 6, 10, 0.08);
  border-radius: 22px;
  box-shadow: 0 26px 60px rgba(18, 6, 10, 0.18);
  padding: clamp(22px, 4vw, 30px);
  color: #2b2729;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  max-height: min(65vh, 520px);
  overflow: hidden;
}

.cookie-dialog__close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: 0;
  color: #7a7074;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s ease;
}

.cookie-dialog__close:hover,
.cookie-dialog__close:focus-visible {
  color: var(--vermelho-principal);
  transform: scale(1.05);
}

.cookie-dialog__body {
  display: grid;
  gap: clamp(14px, 3vw, 22px);
  overflow-y: auto;
  flex: 1 1 auto;
  padding-right: clamp(2px, 1vw, 8px);
}

.cookie-dialog__header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  line-height: 1.2;
}

.cookie-dialog__description {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.6;
  color: #4a4045;
}

.cookie-dialog__description a {
  color: var(--vermelho-principal);
  font-weight: 600;
  text-decoration: none;
}

.cookie-dialog__description a:hover,
.cookie-dialog__description a:focus-visible {
  text-decoration: underline;
}

.cookie-dialog__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94888d;
}

.cookie-preface h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a5f63;
}

.cookie-preface p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #51464b;
}

.cookie-categories {
  display: grid;
  gap: clamp(14px, 3vw, 18px);
}

.cookie-category {
  border: 1px solid rgba(18, 6, 10, 0.08);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 12px;
}

.cookie-category__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cookie-category__badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(168, 9, 39, 0.14);
  color: var(--vermelho-principal);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cookie-category__description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #4a4045;
}

.cookie-category__details {
  border: 1px dashed rgba(168, 9, 39, 0.32);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.7);
}

.cookie-category__details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--vermelho-principal);
  list-style: none;
}

.cookie-category__details summary::marker {
  display: none;
}

.cookie-category__details[open] summary {
  margin-bottom: 8px;
}

.cookie-category__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.cookie-item__name {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  color: #342c30;
}

.cookie-item__purpose {
  display: block;
  font-size: 0.85rem;
  color: #4f4449;
  line-height: 1.45;
}

.cookie-item__meta {
  display: block;
  font-size: 0.78rem;
  color: #90868a;
  letter-spacing: 0.02em;
}

.cookie-empty {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(18, 6, 10, 0.06);
  font-size: 0.92rem;
  color: #564d51;
}

.cookie-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.cookie-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cookie-toggle__track {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: rgba(168, 9, 39, 0.22);
  position: relative;
  transition: background 0.25s ease;
}

.cookie-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(18, 6, 10, 0.18);
  transition: transform 0.25s ease;
}

.cookie-toggle input:checked + .cookie-toggle__track {
  background: var(--vermelho-principal);
}

.cookie-toggle input:checked + .cookie-toggle__track::after {
  transform: translateX(20px);
}

.cookie-toggle__label {
  font-size: 1rem;
  font-weight: 600;
  color: #2b2729;
}

.cookie-toggle input:disabled + .cookie-toggle__track {
  background: rgba(18, 6, 10, 0.24);
}

.cookie-toggle input:disabled + .cookie-toggle__track::after {
  background: #f3f1f2;
}

.cookie-toggle input:disabled ~ .cookie-toggle__label {
  color: #91858a;
  cursor: default;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(12px, 3vw, 18px);
}

.cookie-actions .btn-outline,
.cookie-actions .btn-preferences,
.cookie-actions .btn-accept,
.cookie-bar__button {
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  padding: 12px 18px;
  border: 1px solid transparent;
}

.cookie-actions .btn-outline,
.cookie-bar__button.btn-outline {
  background: #fff;
  border-color: rgba(18, 6, 10, 0.14);
  color: #3a3437;
}

.cookie-actions .btn-outline:hover,
.cookie-actions .btn-outline:focus-visible,
.cookie-bar__button.btn-outline:hover,
.cookie-bar__button.btn-outline:focus-visible {
  border-color: rgba(168, 9, 39, 0.4);
  color: var(--vermelho-principal);
  transform: translateY(-1px);
}

.cookie-actions .btn-preferences {
  background: rgba(168, 9, 39, 0.14);
  color: var(--vermelho-principal);
}

.cookie-actions .btn-preferences:hover,
.cookie-actions .btn-preferences:focus-visible {
  background: rgba(168, 9, 39, 0.22);
  transform: translateY(-1px);
}

.cookie-actions .btn-accept,
.cookie-bar__button.btn-accept {
  background: var(--vermelho-principal);
  color: var(--branco, #fff);
  box-shadow: 0 12px 24px rgba(168, 9, 39, 0.25);
}

.cookie-actions .btn-accept:hover,
.cookie-actions .btn-accept:focus-visible,
.cookie-bar__button.btn-accept:hover,
.cookie-bar__button.btn-accept:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(168, 9, 39, 0.3);
}

@media (max-width: 768px) {
  .cookie-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-radius: 22px;
  }

  .cookie-bar__message {
    white-space: normal;
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-bar__actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .cookie-bar__button {
    width: 100%;
    text-align: center;
    padding: 12px 18px;
  }

  .cookie-dialog {
    margin-bottom: 12px;
    max-height: min(68vh, 500px);
  }

  .cookie-category {
    padding: 14px 16px;
  }

  .cookie-actions {
    flex-direction: column;
  }

  .cookie-actions .btn-outline,
  .cookie-actions .btn-preferences,
  .cookie-actions .btn-accept {
    width: 100%;
    text-align: center;
  }

  .cookie-dialog__close {
    top: 10px;
    right: 12px;
  }
}

@media (max-width: 480px) {
  .cookie-consent {
    padding-left: clamp(10px, 5vw, 16px);
    padding-right: clamp(10px, 5vw, 16px);
  }

  .cookie-dialog {
    padding: 20px;
    max-height: min(70vh, 460px);
  }

  .cookie-category__toggle {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-category__badge {
    align-self: flex-start;
  }
}
