/* Educa Cookies – banner y panel.
   Colores vía variables (Ajustes > Cookies): --ecc-primary, --ecc-primary-text, --ecc-bg, --ecc-text */

.ecc[hidden],
.ecc [hidden] {
  display: none !important;
}

.ecc {
  --ecc-radius: 12px;
  --ecc-shadow: 0 10px 40px rgba(15, 20, 45, 0.18);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ecc-text, #1f2330);
}

.ecc *,
.ecc *::before,
.ecc *::after {
  box-sizing: border-box;
}

.ecc-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ecc-text, #1f2330);
}

.ecc-text {
  margin: 0;
  font-size: 14px;
  color: var(--ecc-text, #1f2330);
}

.ecc-links {
  display: inline-block;
  margin-left: 4px;
}

.ecc-links a {
  color: var(--ecc-primary, #373d6d);
  text-decoration: underline;
}

/* ========= Banner ========= */
.ecc-banner {
  position: fixed;
  z-index: 2147483000;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  background: var(--ecc-bg, #fff);
  border-radius: var(--ecc-radius);
  box-shadow: var(--ecc-shadow);
}

.ecc-banner .ecc-title {
  flex-basis: 100%;
  margin-bottom: -18px;
}

.ecc-banner .ecc-text {
  flex: 1 1 420px;
}

/* ========= Botones ========= */
.ecc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.ecc .ecc-btn {
  appearance: none;
  margin: 0;
  padding: 11px 22px;
  min-width: 140px;
  border: 2px solid var(--ecc-primary, #373d6d);
  border-radius: 999px;
  background: var(--ecc-primary, #373d6d);
  color: var(--ecc-primary-text, #fff);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ecc .ecc-btn:hover {
  opacity: 0.88;
}

.ecc .ecc-btn:focus-visible,
.ecc .ecc-panel__close:focus-visible,
.ecc .ecc-switch:focus-visible {
  outline: 3px solid var(--ecc-primary, #373d6d);
  outline-offset: 2px;
}

.ecc .ecc-btn--link {
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--ecc-primary, #373d6d);
  text-decoration: underline;
}

/* ========= Panel ========= */
html.ecc-lock {
  overflow: hidden;
}

.ecc-panel {
  position: fixed;
  z-index: 2147483001;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ecc-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 40, 0.55);
}

.ecc-panel__box {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: var(--ecc-bg, #fff);
  border-radius: var(--ecc-radius);
  box-shadow: var(--ecc-shadow);
}

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

.ecc .ecc-panel__close {
  appearance: none;
  margin: -6px -6px 0 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--ecc-text, #1f2330);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.ecc-cats {
  list-style: none;
  margin: 18px 0;
  padding: 0;
}

.ecc-cat {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.ecc-cat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}

.ecc-cat__label {
  flex: 1 1 auto;
  font-weight: 700;
}

.ecc-cat__always {
  font-size: 12px;
  font-weight: 600;
  color: var(--ecc-primary, #373d6d);
}

.ecc-cat__desc {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.8;
}

/* Interruptor */
.ecc .ecc-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #c8cbd6;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ecc .ecc-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}

.ecc .ecc-switch:checked {
  background: var(--ecc-primary, #373d6d);
}

.ecc .ecc-switch:checked::after {
  transform: translateX(20px);
}

.ecc .ecc-switch:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ecc-panel .ecc-actions {
  justify-content: flex-end;
}

/* ========= Móvil ========= */
@media (max-width: 767px) {
  .ecc-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 16px;
    gap: 14px;
  }

  .ecc-banner .ecc-title {
    margin-bottom: -8px;
  }

  .ecc-banner .ecc-text {
    flex-basis: 100%;
    max-height: 40vh;
    overflow-y: auto;
  }

  .ecc-actions {
    width: 100%;
  }

  .ecc .ecc-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .ecc .ecc-btn--link {
    flex-basis: 100%;
    order: 3;
  }

  .ecc-panel__box {
    padding: 18px;
  }
}
