/* ============================================================================
   Cookie Banner GDPR
   ============================================================================ */

.heq-cb {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 999998;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  padding: 18px 20px;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: heq-cb-up 0.3s ease;
}

@keyframes heq-cb-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.heq-cb-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

.heq-cb-text strong {
  display: block;
  font-size: 15px;
  color: #111827;
  margin-bottom: 4px;
}

.heq-cb-text p {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
}

.heq-cb-text a {
  color: #004F6B;
  text-decoration: underline;
  margin-left: 6px;
}

.heq-cb-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.heq-cb-btn {
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.heq-cb-customize {
  background: transparent;
  color: #4b5563;
  border-color: #d1d5db;
}

.heq-cb-customize:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.heq-cb-reject {
  background: #fff;
  color: #4b5563;
  border-color: #d1d5db;
}

.heq-cb-reject:hover {
  background: #f9fafb;
}

.heq-cb-accept {
  background: #004F6B;
  color: #fff;
}

.heq-cb-accept:hover {
  background: #003a50;
}

/* Modal */

.heq-cm {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.heq-cm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.heq-cm-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.heq-cm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid #f3f4f6;
}

.heq-cm-header h2 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.heq-cm-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 6px;
}

.heq-cm-close:hover { color: #111827; }

.heq-cm-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.heq-cm-body > p {
  margin: 0 0 18px;
  font-size: 13px;
  color: #4b5563;
}

.heq-cm-cat {
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
}

.heq-cm-cat:last-child { border-bottom: none; }

.heq-cm-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.heq-cm-cat-head label {
  font-size: 14px;
  color: #111827;
}

.heq-cm-cat p {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

.heq-cm-tag {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.heq-cm-required {
  background: #ecfdf5;
  color: #065f46;
}

.heq-cm-switch {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
  flex-shrink: 0;
}

.heq-cm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.heq-cm-switch span {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.heq-cm-switch span::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.heq-cm-switch input:checked + span {
  background: #004F6B;
}

.heq-cm-switch input:checked + span::before {
  transform: translateX(18px);
}

.heq-cm-footer {
  padding: 14px 22px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Link "Gerir cookies" no footer */
.heq-cb-reopen {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 700px) {
  .heq-cb {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 14px;
  }

  .heq-cb-inner {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .heq-cb-actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .heq-cb-btn {
    width: 100%;
  }

  .heq-cm-content {
    max-height: 92vh;
  }
}
