/* ==========================================================
   Mi Recomendación — Sistema de consentimiento de cookies V052
   ========================================================== */

.cookie-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  padding: 18px 0;
  background: rgba(255, 250, 242, 0.96);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -12px 36px rgba(12, 35, 64, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.cookie-banner__inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1 1 420px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.cookie-banner__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.cookie-btn:focus-visible {
  outline: 3px solid rgba(255, 151, 0, 0.42);
  outline-offset: 2px;
}

/* Aceptar y Rechazar comparten prominencia visual */
.cookie-btn--choice {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: 0 8px 18px rgba(12, 35, 64, 0.07);
}

.cookie-btn--choice:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.cookie-btn--primary {
  background: linear-gradient(135deg, var(--green), #00b886);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(0, 159, 115, 0.22);
}

.cookie-btn--primary:hover {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
}

.cookie-btn--ghost {
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}

.cookie-btn--ghost:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(12, 35, 64, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.cookie-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 220;
  width: min(590px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 34px 90px rgba(12, 35, 64, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.cookie-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.cookie-panel__inner {
  padding: clamp(22px, 4vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cookie-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cookie-panel__title {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.cookie-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
}

.cookie-panel__close:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.cookie-panel__close:focus-visible {
  outline: 3px solid rgba(255, 151, 0, 0.42);
  outline-offset: 2px;
}

.cookie-panel__close svg {
  width: 17px;
  height: 17px;
}

.cookie-panel__desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}

.cookie-categories {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

.cookie-category {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.cookie-category:last-child {
  border-bottom: 0;
}

.cookie-category__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.cookie-category__info {
  flex: 1 1 auto;
}

.cookie-category__name {
  display: block;
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1rem;
}

.cookie-category__desc {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.cookie-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  flex: 0 0 auto;
}

.cookie-toggle__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cookie-toggle__track {
  position: relative;
  display: inline-block;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #dbe3ea;
  cursor: pointer;
  transition: background 0.18s ease;
}

.cookie-toggle__track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(12, 35, 64, 0.18);
  transition: transform 0.18s ease;
}

.cookie-toggle__input:checked + .cookie-toggle__track {
  background: var(--green);
}

.cookie-toggle__input:checked + .cookie-toggle__track::after {
  transform: translateX(24px);
}

.cookie-toggle__input:focus-visible + .cookie-toggle__track {
  outline: 3px solid rgba(255, 151, 0, 0.42);
  outline-offset: 2px;
}

.cookie-toggle--locked {
  min-width: auto;
}

.cookie-toggle__label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.cookie-toggle__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cookie-panel__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

body.cookie-panel-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .cookie-banner {
    padding: 16px 0;
  }

  .cookie-banner__inner {
    width: min(100% - 28px, 1180px);
    align-items: stretch;
  }

  .cookie-banner__actions,
  .cookie-panel__footer {
    width: 100%;
  }

  .cookie-btn--primary,
  .cookie-btn--choice,
  .cookie-btn--ghost {
    flex: 1;
    justify-content: center;
  }

  .cookie-category__header {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-toggle {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .cookie-banner__actions,
  .cookie-panel__footer {
    flex-direction: column;
    align-items: stretch;
  }

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