/* ============================================================
   LGPD Cookie Consent — modal de preferências (granularidade por
   categoria). Complementa cookie_consent.css (banner + botões).
   Bottom sheet no mobile; dialog centrado no desktop.
   ============================================================ */

.gf-cookie__modal {
  position: fixed;
  inset: 0;
  z-index: 1950;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.gf-cookie.gf-cookie--modal-open .gf-cookie__modal {
  display: flex;
}

.gf-cookie__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.gf-cookie__dialog {
  position: relative;
  background: #fff;
  color: #1f2937;
  width: 100%;
  max-width: 40rem;
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: 1rem 1rem 0 0;
  padding: 1.25rem;
  box-shadow: 0 -0.5rem 1.5rem rgba(0, 0, 0, 0.3);
}

.gf-cookie__dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.gf-cookie__category {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}

.gf-cookie__category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gf-cookie__category-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.gf-cookie__category-desc {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0.375rem 0 0;
  line-height: 1.45;
}

/* Switch acessível (checkbox nativo estilizado) */
.gf-cookie__switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.gf-cookie__switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.gf-cookie__slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.15s;
  pointer-events: none;
}
.gf-cookie__slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}
.gf-cookie__switch input:checked + .gf-cookie__slider {
  background: var(--gf-cookie-accent);
}
.gf-cookie__switch input:checked + .gf-cookie__slider::before {
  transform: translateX(18px);
}
.gf-cookie__switch input:disabled + .gf-cookie__slider {
  background: var(--gf-cookie-accent);
  opacity: 0.55;
}
.gf-cookie__switch input:focus-visible + .gf-cookie__slider {
  outline: 2px solid var(--gf-cookie-accent);
  outline-offset: 2px;
}

.gf-cookie__modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* -------------------- Desktop (modal) -------------------- */
@media (min-width: 768px) {
  .gf-cookie__modal {
    align-items: center;
  }
  .gf-cookie__dialog {
    border-radius: 1rem;
  }
  .gf-cookie__modal-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
  .gf-cookie__modal-actions .gf-cookie__btn {
    width: auto;
  }
}
