/**
 * Cookie Consent Banner & Modal - LGPD
 * Dr. André Oliveira - Unique Plástica Avançada
 *
 * Design minimalista seguindo identidade da marca
 * Cores: #b29158 (dourado escuro), #dbc08d (dourado claro), #000000 (preto)
 */

/* ========================================
   WIDGET CRISALIX — sempre visível
   (widget de exibição de avaliações, não rastreamento de usuário)
   ======================================== */

.crisalix_widget_wrap_23a0f5ee {
  display: block;
}

/* Navbar imediatamente abaixo do banner Crisalix (altura exata: 48px border-box) */
.navbar-3.w-nav {
  top: 48px !important;
}

/* Crisalix header — sempre visível */
.crisalix-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: auto !important;
  min-height: 48px !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 99999 !important;
  width: 100%;
  background: #fff;
  padding: 8px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Mobile: espaçamento de segurança esquerda/direita */
@media (max-width: 767px) {
  .crisalix-header {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .crisalix_widget_wrap_23a0f5ee {
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

/* ========================================
   BANNER DE COOKIES - MINIMALISTA
   ======================================== */

#cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 16px 20px 20px;
  z-index: 999999;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(178, 145, 88, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: all 0.3s ease;
}

#cookie-consent-banner.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cookie-banner-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cookie-banner-content {
  flex: 1;
  min-width: 250px;
}

.cookie-banner-title {
  color: #dbc08d;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px 0;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.3px;
}

.cookie-banner-text {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  opacity: 0.95;
  font-weight: 400;
}

.cookie-banner-text a {
  color: #dbc08d;
  text-decoration: none;
  border-bottom: 1px solid rgba(219, 192, 141, 0.3);
  transition: all 0.3s ease;
  font-weight: 500;
}

.cookie-banner-text a:hover {
  color: #b29158;
  border-bottom-color: #b29158;
}

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

.cookie-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.cookie-btn-primary {
  background: #b29158;
  color: #000000;
  box-shadow: 0 2px 8px rgba(178, 145, 88, 0.3);
}

.cookie-btn-primary:hover {
  background: #dbc08d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(178, 145, 88, 0.4);
}

.cookie-btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.5);
}

.cookie-btn-text {
  background: transparent;
  color: #dbc08d;
  padding: 8px 12px;
  font-weight: 500;
}

.cookie-btn-text:hover {
  color: #b29158;
  background: rgba(219, 192, 141, 0.05);
}

/* ========================================
   MODAL DE CONFIGURAÇÕES - MINIMALISTA
   ======================================== */

#cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#cookie-settings-modal.show {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-content {
  background: #2a2a2a;
  border: 3px solid #dbc08d;
  border-radius: 12px;
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(219, 192, 141, 0.3);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

#cookie-settings-modal.show .cookie-modal-content {
  transform: scale(1);
}

.cookie-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(178, 145, 88, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-title {
  color: #f4e4c1;
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.3px;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 4px;
  opacity: 0.7;
}

.cookie-modal-close:hover {
  background: rgba(178, 145, 88, 0.1);
  color: #dbc08d;
  opacity: 1;
}

.cookie-modal-body {
  padding: 20px 24px;
}

.cookie-modal-intro {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.cookie-category {
  background: rgba(219, 192, 141, 0.15);
  border: 2px solid rgba(219, 192, 141, 0.4);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: all 0.3s ease;
}

.cookie-category:hover {
  border-color: rgba(178, 145, 88, 0.5);
  background: rgba(178, 145, 88, 0.12);
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.cookie-category-name {
  color: #f4e4c1;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px 0;
  font-family: 'Poppins', sans-serif;
}

.cookie-category-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.cookie-category-required {
  background: rgba(178, 145, 88, 0.25);
  color: #dbc08d;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(178, 145, 88, 0.4);
}

/* Toggle Switch - Minimalista */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

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

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.3s;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: #b29158;
  border-color: #b29158;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.4;
  cursor: not-allowed;
}

.cookie-modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(178, 145, 88, 0.15);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ========================================
   RESPONSIVO
   ======================================== */

@media screen and (max-width: 768px) {
  /* Crisalix mobile - EXATAMENTE do backup */
  .crisalix-header .crisalix-widget-micro {
    flex-direction: row !important;
  }
  .crisalix-header .crisalix-widget-micro .crisalix-widget-logo {
    order: initial !important;
    margin-top: 0 !important;
    margin-right: 20px !important;
  }
  .crisalix-header .crisalix-widget-micro__content {
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px;
  }
  .crisalix-header .crisalix-widget-rate-text,
  .crisalix-header .carousel-reviews-count {
    font-size: 12px;
  }
  .crisalix-header .crisalix-widget-stars__rating__svg {
    width: 17px !important;
    height: 17px !important;
  }

  /* Banner de cookies mobile */
  #cookie-consent-banner {
    padding: 12px 16px;
  }

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

  .cookie-banner-content {
    min-width: auto;
  }

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

  .cookie-banner-actions {
    justify-content: space-between;
  }

  .cookie-btn {
    font-size: 11px;
    padding: 7px 16px;
    flex: 1;
  }

  .cookie-btn-text {
    flex: 0;
    padding: 7px 10px;
  }

  .cookie-modal-content {
    margin: 10px;
    max-height: calc(100vh - 20px);
  }

  .cookie-modal-header {
    padding: 16px 20px 12px;
  }

  .cookie-modal-title {
    font-size: 16px;
  }

  .cookie-modal-body {
    padding: 16px 20px;
  }

  .cookie-modal-footer {
    padding: 12px 20px 16px;
  }

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

@media (max-width: 480px) {
  .cookie-banner-text {
    font-size: 10px;
  }

  .cookie-btn {
    font-size: 10px;
    padding: 6px 12px;
  }

  .cookie-category {
    padding: 12px;
  }

  .cookie-category-name {
    font-size: 13px;
  }

  .cookie-category-description {
    font-size: 11px;
  }
}

/* ========================================
   ACESSIBILIDADE
   ======================================== */

.cookie-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider,
.cookie-modal-close:focus {
  outline: 2px solid #dbc08d;
  outline-offset: 2px;
}

/* Scrollbar customizada para o modal */
.cookie-modal-content::-webkit-scrollbar {
  width: 6px;
}

.cookie-modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.cookie-modal-content::-webkit-scrollbar-thumb {
  background: rgba(178, 145, 88, 0.3);
  border-radius: 3px;
}

.cookie-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(178, 145, 88, 0.5);
}

/* Animação de entrada suave */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
