/* ================================================================
   KROW MOBILE — Cookie Consent Banner (LGPD/GDPR)
   Design premium com glassmorphism, responsivo e dark/light
   ================================================================ */

/* =============================================
   COOKIE BANNER (Fixo no Bottom)
   ============================================= */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 0;
  transform: translateY(110%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.cookie-banner.active {
  transform: translateY(0);
  pointer-events: all;
}

.cookie-banner__inner {
  max-width: 1100px;
  margin: 0 auto 16px;
  padding: 24px 28px;
  border-radius: 20px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  /* Glassmorphism */
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 -4px 32px rgba(0, 0, 0, 0.08),
    0 2px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .cookie-banner__inner {
  background: rgba(20, 20, 28, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 -4px 32px rgba(0, 0, 0, 0.3),
    0 2px 16px rgba(0, 0, 0, 0.15);
}

/* Ícone decorativo */
.cookie-banner__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.cookie-banner__content {
  flex: 1;
  min-width: 0;
}

.cookie-banner__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary, #1a1a1a);
  font-family: 'Poppins', sans-serif;
}

[data-theme="dark"] .cookie-banner__title {
  color: #f0f0f5;
}

.cookie-banner__text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted, #6b7280);
  margin: 0 0 16px;
}

.cookie-banner__text a {
  color: #8b5cf6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Botões do banner */
.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  white-space: nowrap;
}

.cookie-btn--accept {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.cookie-btn--accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.cookie-btn--reject {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-primary, #374151);
  border: 1px solid rgba(107, 114, 128, 0.2);
}

[data-theme="dark"] .cookie-btn--reject {
  background: rgba(255, 255, 255, 0.06);
  color: #d1d5db;
  border-color: rgba(255, 255, 255, 0.1);
}

.cookie-btn--reject:hover {
  background: rgba(107, 114, 128, 0.18);
}

.cookie-btn--customize {
  background: transparent;
  color: #8b5cf6;
  padding: 10px 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-btn--customize:hover {
  color: #7c3aed;
}

/* =============================================
   MODAL DE PERSONALIZAÇÃO
   ============================================= */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cookie-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cookie-modal {
  background: var(--bg-card, #ffffff);
  border-radius: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .cookie-modal {
  background: #18181f;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.cookie-modal-overlay.active .cookie-modal {
  transform: scale(1) translateY(0);
}

.cookie-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(107, 114, 128, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6b7280);
  transition: all 0.2s;
}

.cookie-modal__close:hover {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-primary, #1a1a1a);
}

.cookie-modal__close svg {
  width: 18px;
  height: 18px;
}

.cookie-modal__header {
  margin-bottom: 24px;
}

.cookie-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary, #1a1a1a);
  font-family: 'Poppins', sans-serif;
}

[data-theme="dark"] .cookie-modal__title {
  color: #f0f0f5;
}

.cookie-modal__desc {
  font-size: 0.85rem;
  color: var(--text-muted, #6b7280);
  line-height: 1.5;
  margin: 0;
}

/* Categorias de cookies */
.cookie-category {
  padding: 18px 0;
  border-bottom: 1px solid rgba(107, 114, 128, 0.1);
}

.cookie-category:last-of-type {
  border-bottom: none;
}

.cookie-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.cookie-category__info {
  flex: 1;
}

.cookie-category__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
  margin: 0;
}

[data-theme="dark"] .cookie-category__name {
  color: #e5e7eb;
}

.cookie-category__desc {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin: 4px 0 0;
  line-height: 1.45;
}

/* Badge obrigatório */
.cookie-category__required {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  white-space: nowrap;
}

/* Toggle Switch Premium */
.cookie-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle__slider {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: #d1d5db;
  cursor: pointer;
  transition: all 0.3s ease;
}

[data-theme="dark"] .cookie-toggle__slider {
  background: #3f3f46;
}

.cookie-toggle__slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.cookie-toggle input:checked + .cookie-toggle__slider {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.cookie-toggle input:checked + .cookie-toggle__slider::before {
  transform: translateX(22px);
}

.cookie-toggle input:disabled + .cookie-toggle__slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Ações do modal */
.cookie-modal__actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.cookie-modal__actions .cookie-btn {
  flex: 1;
}

/* =============================================
   LINK FOOTER — Gerenciar Cookies
   ============================================= */
.cookie-settings-link {
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  transition: color 0.2s;
}

.cookie-settings-link:hover {
  color: #8b5cf6;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .cookie-banner__inner {
    flex-direction: column;
    margin: 0 8px 8px;
    padding: 20px;
    border-radius: 16px;
    gap: 14px;
  }

  .cookie-banner__icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: 12px;
  }

  .cookie-banner__title {
    font-size: 0.95rem;
  }

  .cookie-banner__text {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }

  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.8rem;
    text-align: center;
    justify-content: center;
  }

  .cookie-btn--customize {
    flex: 0 0 100%;
    text-align: center;
  }

  .cookie-modal {
    padding: 24px 20px;
    border-radius: 20px;
    max-height: 85vh;
  }

  .cookie-modal__title {
    font-size: 1.1rem;
  }

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

  .cookie-modal__actions .cookie-btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .cookie-banner__actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }
}

/* =============================================
   ANIMAÇÕES
   ============================================= */
@keyframes cookieSlideUp {
  from {
    transform: translateY(110%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes cookiePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.cookie-banner.active .cookie-banner__icon {
  animation: cookiePulse 2s ease-in-out infinite;
}
