/**
 * Cookie Consent Banner - Estilos
 * J&J y Asociados
 */

/* Banner Principal */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 39, 69, 0.98);
  color: white;
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.cookie-consent-banner.show {
  transform: translateY(0);
}

.cookie-consent-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-consent-content {
  flex: 1;
  min-width: 300px;
}

.cookie-consent-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-icon {
  font-size: 1.5rem;
}

.cookie-consent-text {
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.cookie-consent-text a {
  color: #b79b6f;
  text-decoration: underline;
}

.cookie-consent-text a:hover {
  color: #d4b890;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.cookie-btn:focus {
  outline: 2px solid #b79b6f;
  outline-offset: 2px;
}

.cookie-btn-primary {
  background: #b79b6f;
  color: white;
}

.cookie-btn-primary:hover {
  background: #a18a5f;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(183, 155, 111, 0.3);
}

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

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

.cookie-btn-tertiary {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
  padding: 0.75rem 1rem;
}

.cookie-btn-tertiary:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

/* Modal de Configuración */
.cookie-consent-settings {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(5px);
}

.cookie-consent-settings.show {
  display: flex;
}

.cookie-settings-modal {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cookie-settings-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f2745;
  color: white;
  border-radius: 12px 12px 0 0;
}

.cookie-settings-header h2 {
  margin: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-settings-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.cookie-settings-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cookie-settings-close:focus {
  outline: 2px solid #b79b6f;
  outline-offset: 2px;
}

.cookie-settings-body {
  padding: 1.25rem 1.5rem;
}

.cookie-settings-intro {
  margin-bottom: 1rem;
  color: #666;
  line-height: 1.6;
}

.cookie-category {
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.cookie-category:hover {
  border-color: #e0e0e0;
}

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

.cookie-category-info {
  flex: 1;
}

.cookie-category-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f2745;
  margin: 0 0 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-category-required {
  font-size: 0.75rem;
  background: #b79b6f;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.cookie-category-description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  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: #ccc;
  transition: 0.4s;
  border-radius: 28px;
}

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

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

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

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

.cookie-toggle input:focus+.cookie-toggle-slider {
  box-shadow: 0 0 0 2px rgba(183, 155, 111, 0.3);
}

.cookie-settings-footer {
  padding: 1rem 1.5rem;
  border-top: 2px solid #f0f0f0;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  background: #f9f9f9;
  border-radius: 0 0 12px 12px;
}

.cookie-settings-footer .cookie-btn {
  min-width: 120px;
}

/* Botón flotante de configuración de cookies */
.cookie-settings-float {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #0f2745;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9998;
  transition: all 0.3s;
  font-size: 1.5rem;
}

.cookie-settings-float:hover {
  background: #1a3a5f;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.cookie-settings-float:focus {
  outline: 2px solid #b79b6f;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .cookie-consent-banner {
    padding: 1rem;
  }

  .cookie-consent-container {
    flex-direction: column;
    gap: 1rem;
  }

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

  .cookie-consent-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    text-align: center;
  }

  .cookie-settings-modal {
    margin: 1rem;
    max-height: 85vh;
  }

  .cookie-settings-header {
    padding: 1rem;
  }

  .cookie-settings-header h2 {
    font-size: 1.25rem;
  }

  .cookie-settings-body {
    padding: 1.5rem 1rem;
  }

  .cookie-settings-footer {
    flex-direction: column;
    padding: 1rem;
  }

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

  .cookie-category-header {
    flex-direction: column;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {

  .cookie-consent-banner,
  .cookie-settings-modal,
  .cookie-toggle-slider,
  .cookie-toggle-slider:before {
    transition: none;
  }

  .cookie-settings-modal {
    animation: none;
  }
}

/* Alto contraste para accesibilidad */
@media (prefers-contrast: high) {
  .cookie-consent-banner {
    border-top: 3px solid white;
  }

  .cookie-category {
    border: 2px solid #333;
  }
}