/* ==================================================================
   INNOVALIFE — Banner y panel de preferencias de cookies
   Autocontenido: no depende de legal.css para poder usarse en
   cualquier página del sitio (incluida la landing principal).
   Prefijo de namespacing: "cc-" (Cookie Consent).
   ================================================================== */

:root {
  --cc-purple: #6f42c1;
  --cc-blue: #1f2f9b;
  --cc-grad: linear-gradient(90deg, #fc00ff 0%, #00dbde 51%, #fc00ff 100%);
  --cc-text: #5d5d5d;
  --cc-shadow: 0 -8px 30px rgba(31, 47, 155, 0.18);
}

body.cc-banner-active .btn-whatsapp {
  bottom: calc(var(--cc-banner-h, 0px) + 90px) !important;
  transition: bottom 0.3s ease;
}
body.cc-banner-active .ip-back-to-top {
  bottom: calc(var(--cc-banner-h, 0px) + 190px) !important;
  transition: bottom 0.3s ease;
}

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999997;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.75rem;
  background: #fff;
  box-shadow: var(--cc-shadow);
  border-top: 3px solid transparent;
  border-image: var(--cc-grad) 1;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transform: translateY(120%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cc-banner.is-visible {
  transform: translateY(0);
}

.cc-banner__text {
  flex: 1 1 320px;
  color: var(--cc-text);
  font-size: 0.92rem;
  line-height: 1.5;
}
.cc-banner__text a {
  color: var(--cc-purple);
  font-weight: 600;
  text-decoration: underline;
}

.cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 0 0 auto;
}

.cc-btn {
  border: none;
  border-radius: 50px;
  padding: 0.6rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.cc-btn:focus-visible {
  outline: 3px solid var(--cc-purple);
  outline-offset: 2px;
}
.cc-btn--ghost {
  background: #f4f2fb;
  color: var(--cc-blue);
}
.cc-btn--ghost:hover {
  background: #ece7f9;
}
.cc-btn--accept {
  background-image: var(--cc-grad);
  background-size: 200% auto;
  color: #fff;
  box-shadow: 0 8px 18px rgba(111, 66, 193, 0.28);
}
.cc-btn--accept:hover {
  background-position: right center;
  transform: translateY(-1px);
}

/* Preferences modal */
.cc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(20, 22, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.cc-modal-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.cc-modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 4rem rgba(31, 47, 155, 0.25);
  padding: 2rem;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transform: translateY(16px);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cc-modal-overlay.is-visible .cc-modal {
  transform: translateY(0);
}

.cc-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f4f2fb;
  color: var(--cc-blue);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.cc-modal__close:focus-visible {
  outline: 3px solid var(--cc-purple);
  outline-offset: 2px;
}

.cc-modal h3 {
  color: var(--cc-blue);
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}
.cc-modal > p {
  color: var(--cc-text);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.cc-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #f0eefa;
}
.cc-option:first-of-type {
  border-top: none;
}
.cc-option strong {
  color: var(--cc-blue);
  font-size: 0.92rem;
  display: block;
  margin-bottom: 0.2rem;
}
.cc-option p {
  color: var(--cc-text);
  font-size: 0.82rem;
  margin: 0;
}

.cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  display: inline-block;
}
.cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cc-switch span {
  position: absolute;
  inset: 0;
  background: #ddd8ee;
  border-radius: 50px;
  transition: background 0.2s ease;
}
.cc-switch span::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.cc-switch input:checked + span {
  background-image: var(--cc-grad);
}
.cc-switch input:checked + span::before {
  transform: translateX(20px);
}
.cc-switch input:focus-visible + span {
  outline: 3px solid var(--cc-purple);
  outline-offset: 2px;
}
.cc-switch--disabled {
  opacity: 0.6;
}

.cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.cc-modal__actions .cc-btn {
  flex: 1 1 auto;
  text-align: center;
}

@media (max-width: 575.98px) {
  .cc-banner {
    padding: 1.1rem 1.1rem 1.25rem;
  }
  .cc-banner__actions {
    width: 100%;
  }
  .cc-banner__actions .cc-btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner,
  .cc-modal,
  .cc-modal-overlay {
    transition: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  .cc-banner,
  .cc-modal {
    background: #1b1c26;
  }
  .cc-banner__text,
  .cc-modal > p,
  .cc-option p {
    color: #b8b7c4;
  }
  .cc-btn--ghost {
    background: #262735;
    color: #a9b6ff;
  }
  .cc-btn--ghost:hover {
    background: #2f3040;
  }
  .cc-option {
    border-top-color: #2a2b38;
  }
  .cc-modal__close {
    background: #262735;
    color: #a9b6ff;
  }
}
