/* =========================
   COOKIE MODAL - INNOVASERV
   PREMIUM CENTERED VERSION
   ========================= */

.cookie-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 27, 60, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
}

.cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(560px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 22px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(7, 87, 154, 0.10);
  overflow: visible;
  z-index: 9999;
  font-family: "Open Sans", sans-serif;
  animation: cookieFadeScale 0.45s ease;
  border: 1px solid rgba(50, 145, 207, 0.14);
}

/* brillo decorativo */
.cookie-modal::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 110px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.00) 55%
  );
  pointer-events: none;
}

/* Header */
.cookie-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #071b3c 0%, #07579a 62%, #3291cf 100%);
  color: #ffffff;
  position: relative;
  border-radius: 22px 22px 0 0;
}

.cookie-brand {
  flex: 1;
  min-width: 0;
}

.cookie-brand h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.1px;
}

.cookie-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Close */
.cookie-close {
  position: relative;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.cookie-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px) scale(1.04);
}

/* Body */
.cookie-modal__body {
  padding: 22px;
  color: #334155;
  font-size: 14px;
  line-height: 1.7;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
}

.cookie-modal__body p {
  margin: 0 0 14px;
}

.cookie-modal__body strong {
  color: #071b3c;
  font-weight: 700;
}

.cookie-modal__body a {
  color: #07579a;
  font-weight: 700;
  text-decoration: none;
}

.cookie-modal__body a:hover {
  color: #3291cf;
  text-decoration: underline;
}

/* Accordion */
.cookie-accordion {
  margin-top: 14px;
  padding: 15px 15px 11px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
  border: 1px solid rgba(7, 87, 154, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.cookie-accordion summary {
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 700;
  color: #07579a;
  outline: none;
  position: relative;
  padding-right: 20px;
}

.cookie-accordion summary::-webkit-details-marker {
  display: none;
}

.cookie-accordion summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: -1px;
  font-size: 18px;
  line-height: 1;
  color: #3291cf;
  transition: all 0.25s ease;
}

.cookie-accordion[open] summary::after {
  content: "–";
}

/* List */
.cookie-list {
  list-style: none;
  padding: 14px 0 0;
  margin: 0;
}

.cookie-list li {
  margin-bottom: 12px;
}

.cookie-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
  cursor: pointer;
}

.cookie-switch input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #07579a;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.cookie-switch span {
  display: inline-block;
}

.cookie-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: #5b6b7f;
}

/* Footer */
.cookie-modal__footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(7, 87, 154, 0.08);
  background: #ffffff;
  border-radius: 0 0 22px 22px;
}

.cookie-modal__footer .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  border: 0;
  text-align: center;
}

/* Botones */
.cookie-modal__footer .btn-secondary {
  background: #eef3f8;
  color: #334155;
  border: 1px solid #d7e1ea;
}

.cookie-modal__footer .btn-secondary:hover {
  background: #e3ebf3;
  transform: translateY(-1px);
}

.cookie-modal__footer .btn-outline {
  background: #ffffff;
  color: #07579a;
  border: 1px solid rgba(7, 87, 154, 0.25);
}

.cookie-modal__footer .btn-outline:hover {
  background: #f4f9fd;
  transform: translateY(-1px);
}

.cookie-modal__footer .btn-primary {
  background: linear-gradient(135deg, #07579a 0%, #3291cf 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 10px 20px rgba(7, 87, 154, 0.20);
}

.cookie-modal__footer .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(7, 87, 154, 0.26);
}

/* Hint footer */
.cookie-modal__footer--hint {
  padding: 0 22px 18px;
  text-align: center;
}

.cookie-reopen {
  border: 0;
  background: transparent;
  color: #07579a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* Tooltips */
.cookie-close .tooltip,
.cookie-modal__footer .tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: #071b3c;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.3;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 99999;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.16);
}

.cookie-close .tooltip::after,
.cookie-modal__footer .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #071b3c transparent transparent transparent;
}

.cookie-close:hover .tooltip,
.cookie-modal__footer .btn:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.cookie-backdrop,
.cookie-modal {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cookie-backdrop.is-open,
.cookie-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 767.98px) {
  .cookie-modal {
    top: 50%;
    left: 50%;
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    transform: translate(-50%, -50%);
    border-radius: 18px;
  }

  .cookie-modal__header {
    flex-wrap: wrap;
    padding: 16px;
    border-radius: 18px 18px 0 0;
  }

  .cookie-brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .cookie-brand h2 {
    font-size: 18px;
  }

  .cookie-badge {
    order: 3;
    margin-top: 4px;
  }

  .cookie-modal__body {
    padding: 16px;
    max-height: calc(100vh - 260px);
  }

  .cookie-modal__footer {
    grid-template-columns: 1fr;
    padding: 14px 16px 16px;
    border-radius: 0 0 18px 18px;
  }

  .cookie-modal__footer--hint {
    padding: 0 16px 16px;
  }

  .cookie-close .tooltip,
  .cookie-modal__footer .tooltip {
    display: none;
  }
}

/* Animación */
@keyframes cookieFadeScale {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}