/* --- SISTEMA DE COOKIES (CUMPLIMIENTO AEPD) --- */

/* --- Fase 1: Banner de Entrada --- */
.cookies-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid rgba(130, 255, 157, 0.4);
  box-shadow: 0 -5px 25px rgba(37, 61, 47, 0.1);
  padding: 15px 0;
  z-index: 10000;
  animation: slideInUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.banner-content-cookies p {
  font-size: 12px;
  color: #253d2f;
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  line-height: 1.5;
}

.banner-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.banner-actions button {
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.btn-accept {
  background: #82ff9d;
  color: #1a4d2e;
}

.btn-accept:hover {
  background: #253d2f;
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-reject {
  background: #f2f2f2;
  color: #777;
}

.btn-reject:hover {
  background: #e0e0e0;
  color: #333;
}

.btn-settings {
  background: transparent;
  color: #253d2f;
  text-decoration: underline;
  padding: 8px 10px !important;
}

/* --- Fase 2: Modal de Configuración --- */
.cookies-modal {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 600px;
  background: #ffffff;
  color: #253d2f;
  border: 1px solid rgba(130, 255, 157, 0.3);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(37, 61, 47, 0.2);
  padding: 30px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.close-modal-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #777;
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 5px;
}

.close-modal-btn:hover {
  color: #253d2f;
  transform: scale(1.1);
}

.policy-link {
  color: #1a4d2e;
  text-decoration: underline;
  font-weight: 500;
  margin-left: 5px;
}

.policy-link:hover {
  color: #82ff9d;
}

.footer-policy-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: #777;
  text-decoration: underline;
  margin-top: 15px;
  transition: color 0.3s;
}

.footer-policy-link:hover {
  color: #253d2f;
}

.cookies-header h3 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #253d2f;
}

.cookies-header p,
.cookies-modal p {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

.cookies-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #f9fbf9;
  border-radius: 16px;
  border: 1px solid rgba(130, 255, 157, 0.1);
}

.cookie-category.locked {
  background: #f5f5f5;
  opacity: 0.9;
}

.category-info .category-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #253d2f;
}

.category-info .category-desc {
  font-size: 12px;
  color: #777;
  margin-bottom: 0 !important;
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked+.slider {
  background-color: #253d2f;
}

input:focus+.slider {
  box-shadow: 0 0 1px #82ff9d;
}

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

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Locked Toggle */
.toggle-switch-locked {
  width: 50px;
  height: 26px;
  background: #82ff9d;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  opacity: 0.6;
}

.slider-locked {
  font-size: 10px;
  font-weight: 700;
  color: #1a4d2e;
}

/* Save and Action Buttons in Modal */
.cookies-footer-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.cookies-footer-actions button {
  flex: 1;
  padding: 8px 5px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: "Plus Jakarta Sans", sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 50px;
}

.accept-btn {
  background: #82ff9d;
  color: #1a4d2e;
}

.reject-btn {
  background: #f2f2f2;
  color: #777;
}

.save-btn {
  background: #253d2f;
  color: #ffffff;
}

.accept-btn:hover,
.reject-btn:hover,
.save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.accept-btn:hover {
  background: #6ee689;
}

.reject-btn:hover {
  background: #e0e0e0;
  color: #333;
}

.save-btn:hover {
  background: #1a4d2e;
}

/* Botón contraído de cookies */
.cookies-toggle {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 9998;
}

.cookies-toggle button {
  background: #ffffff;
  color: #253d2f;
  border: 1px solid rgba(130, 255, 157, 0.5);
  border-radius: 30px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.cookies-toggle button img {
  width: 20px;
  height: 20px;
}

.cookies-toggle button:hover {
  background: #f9fbf9;
  border-color: #82ff9d;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(130, 255, 157, 0.15);
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

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

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(40px);
  }
}

/* --- Responsive Cookies --- */
@media (max-width: 767px) {
  .cookies-modal {
    width: calc(100% - 30px) !important;
    left: 15px !important;
    right: 15px !important;
    bottom: 15px !important;
    padding: 20px !important;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    gap: 15px !important;
    border-radius: 20px !important;
  }

  .banner-container {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 15px !important;
    padding: 10px 15px !important;
    text-align: center !important;
  }

  .banner-actions {
    width: 100% !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .cookies-footer-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .cookies-footer-actions button {
    width: 100% !important;
    min-height: 44px !important;
  }
}