/* ==========================================================================
   SISTEMA DE COOKIES CONFORME A LA AEPD Y RGPD - TUASEGÚRATE
   Sin Cookie Wall | Botones de idéntico peso visual | Modal granular
   ========================================================================== */

/* Banner Flotante Inferior */
#tuasegurate-cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 1140px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 35px rgba(13, 41, 93, 0.18);
  border: 1px solid #e2e8f0;
  padding: 1.5rem 2rem;
  z-index: 99999;
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2d3748;
  display: none;
  animation: cookieSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cookieSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-content h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0d295d;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #4a5568;
  margin-bottom: 1.25rem;
}

.cookie-content p a {
  color: #177a72;
  text-decoration: underline;
  font-weight: 600;
}

/* Botones de igual peso visual exigidos por la AEPD */
.cookie-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cookie-btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  border: 2px solid #0d295d;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Los 3 botones tienen idéntica jerarquía y presencia */
.cookie-btn-accept {
  background-color: #0d295d;
  color: #ffffff;
}
.cookie-btn-accept:hover {
  background-color: #177a72;
  border-color: #177a72;
  color: #ffffff;
}

.cookie-btn-reject {
  background-color: #ffffff;
  color: #0d295d;
}
.cookie-btn-reject:hover {
  background-color: #f7fafc;
  color: #0d295d;
}

.cookie-btn-config {
  background-color: #edf6f5;
  color: #177a72;
  border-color: #177a72;
}
.cookie-btn-config:hover {
  background-color: #d6eeec;
  color: #177a72;
}

/* Modal de Configuración Granular */
#tuasegurate-cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 41, 93, 0.6);
  backdrop-filter: blur(3px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.cookie-modal {
  background: #ffffff;
  border-radius: 16px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2d3748;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.cookie-modal-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0d295d;
  margin: 0;
}

.cookie-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #a0aec0;
  line-height: 1;
}
.cookie-modal-close:hover {
  color: #2d3748;
}

.cookie-category {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cookie-category-title {
  font-weight: 700;
  font-size: 1rem;
  color: #0d295d;
}

/* Interruptores Switches */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e0;
  transition: .3s;
  border-radius: 24px;
}
.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.cookie-switch input:checked + .cookie-slider {
  background-color: #177a72;
}
.cookie-switch input:checked + .cookie-slider:before {
  transform: translateX(20px);
}
.cookie-switch input:disabled + .cookie-slider {
  background-color: #177a72;
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-category-desc {
  font-size: 0.85rem;
  color: #718096;
  line-height: 1.45;
  margin: 0;
}

.cookie-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

/* Adaptación responsive en móviles */
@media (max-width: 767px) {
  #tuasegurate-cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 1.25rem 1.25rem;
  }
  .cookie-actions {
    grid-template-columns: 1fr;
  }
  .cookie-modal {
    padding: 1.25rem;
  }
  .cookie-modal-actions {
    flex-direction: column;
  }
  .cookie-modal-actions .cookie-btn {
    width: 100%;
  }
}
