/* ==========================================
   COOKIE CONSENT - Barra e Modal
   ========================================== */

/* Backdrop REMOVIDO - Usuário pode navegar sem aceitar cookies */

/* Banner de Cookies */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideUp 0.4s ease-out;
  border-top: 2px solid #667eea;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

/* Botão de fechar banner */
.btn-close-banner {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: #999;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.btn-close-banner:hover {
  background: #f3f4f6;
  color: #333;
  transform: rotate(90deg);
}

.cookie-banner-text {
  flex: 1;
  min-width: 300px;
}

.cookie-banner-text h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #1a1a1a;
  font-weight: 600;
}

.cookie-banner-text p {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

.cookie-banner-text a {
  color: #667eea;
  text-decoration: underline;
}

.cookie-banner-text a:hover {
  color: #5568d3;
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-banner-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-accept-all {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-accept-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-settings {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-settings:hover {
  background: #f8f9ff;
}

.btn-reject {
  background: #f3f4f6;
  color: #6b7280;
}

.btn-reject:hover {
  background: #e5e7eb;
}

/* Modal de Configurações */
.cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.cookie-modal-content {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.cookie-modal-header {
  padding: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.cookie-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.cookie-category {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.cookie-category:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.category-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.category-info h3 {
  margin: 0;
  font-size: 16px;
  color: #1a1a1a;
  font-weight: 600;
}

.category-status {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
}

.always-on {
  background: #d1fae5;
  color: #065f46;
}

.category-description {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Modal Footer */
.cookie-modal-footer {
  padding: 20px 24px;
  background: #f8f9fa;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
}

.cookie-modal-footer button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-save {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  /* Banner mais discreto no mobile */
  .cookie-banner {
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
  }

  .cookie-banner-content {
    padding: 16px;
    gap: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-text {
    min-width: 100%;
  }

  .cookie-banner-text h3 {
    font-size: 15px;
    margin-bottom: 4px;
  }

  .cookie-banner-text p {
    font-size: 13px;
    line-height: 1.4;
  }

  .cookie-banner-actions {
    flex-direction: row;
    gap: 8px;
  }

  .cookie-banner-actions button {
    flex: 1;
    padding: 10px 16px;
    font-size: 13px;
    justify-content: center;
  }

  /* Esconder botão "Rejeitar" no mobile para economizar espaço */
  .btn-reject {
    display: none;
  }

  /* Botão de configurações menor no mobile */
  .btn-settings {
    padding: 10px 12px;
  }

  .btn-settings span {
    display: none; /* Esconder texto, manter apenas ícone */
  }

  .cookie-modal {
    width: 95%;
    max-height: 95vh;
  }

  .cookie-modal-footer {
    flex-direction: column;
  }

  .cookie-modal-footer button {
    width: 100%;
    justify-content: center;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* Mobile extra pequeno - ainda mais discreto */
@media (max-width: 480px) {
  .cookie-banner-content {
    padding: 12px;
  }

  .cookie-banner-text h3 {
    font-size: 14px;
  }

  .cookie-banner-text p {
    font-size: 12px;
  }

  .cookie-banner-actions button {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Ícones menores */
  .cookie-banner-actions button i {
    font-size: 14px;
  }
}

/* Botão flutuante de configuração de cookies (opcional) */
.cookie-settings-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.3s ease;
}

.cookie-settings-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cookie-settings-button i {
  font-size: 24px;
}
