/* Consentimiento de cookies UE - estilos */
:root { --cc-primary: #53b230; --cc-bg: rgba(43, 43, 43, .97); --cc-fg: #fff; }

.cc-banner[hidden], .cc-modal[hidden] { display: none !important; }
.cc-banner, .cc-banner *, .cc-modal, .cc-modal * { box-sizing: border-box; }

/* ---------- Banner ---------- */
.cc-banner {
  position: fixed; z-index: 2147483000; left: 0; right: 0; bottom: 0;
  max-height: 92vh; overflow-y: auto;
  padding: 20px 24px; background: var(--cc-bg); color: var(--cc-fg);
  font-size: 15px; line-height: 1.5;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .35);
}
.cc-inner { display: flex; align-items: center; gap: 32px; max-width: 1200px; margin: 0 auto; }
.cc-content { flex: 1 1 auto; }
.cc-text { margin: 0 0 10px; }
.cc-links { margin: 0; }
.cc-links a, .cc-linkbtn {
  display: inline; margin: 0 20px 0 0; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-decoration: underline; cursor: pointer;
}
.cc-buttons { display: flex; flex: 0 0 auto; gap: 12px; }

/* Aceptar y rechazar con el mismo peso visual (exigencia AEPD / EDPB) */
.cc-btn {
  min-width: 160px; padding: 14px 22px; border: 2px solid var(--cc-primary); border-radius: 4px;
  background: var(--cc-primary); color: #fff; font: inherit; font-weight: 600;
  text-transform: uppercase; letter-spacing: .02em; cursor: pointer;
}
.cc-btn:hover { filter: brightness(.92); }
.cc-btn:focus-visible, .cc-linkbtn:focus-visible, .cc-links a:focus-visible,
.cc-modal__close:focus-visible, .cc-switch input:focus-visible + .cc-switch__track {
  outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px #000;
}

/* Cajas flotantes */
.cc-banner--bottom-left, .cc-banner--bottom-right {
  bottom: 20px; max-width: 440px; border-radius: 10px;
}
.cc-banner--bottom-left { left: 20px; right: auto; }
.cc-banner--bottom-right { right: 20px; left: auto; }
.cc-banner--bottom-left .cc-inner, .cc-banner--bottom-right .cc-inner { flex-direction: column; align-items: stretch; gap: 16px; }
.cc-banner--bottom-left .cc-buttons, .cc-banner--bottom-right .cc-buttons { flex-direction: column; }

/* ---------- Modal ---------- */
.cc-modal { position: fixed; z-index: 2147483001; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cc-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.cc-modal__dialog {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 640px; max-height: 100%;
  background: #fff; color: #222; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); outline: 0;
}
.cc-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #e3e3e3; }
.cc-modal__head h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.cc-modal__close { padding: 0 6px; border: 0; background: none; color: #222; font-size: 30px; line-height: 1; cursor: pointer; }
.cc-modal__body { flex: 1 1 auto; overflow-y: auto; padding: 18px 24px; font-size: 15px; line-height: 1.5; }
.cc-modal__intro { margin-top: 0; }
.cc-cat { padding: 14px 0; border-bottom: 1px solid #eee; }
.cc-cat p { margin: 6px 0 0; color: #555; }
.cc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cc-cat__row label { margin: 0; cursor: pointer; }
.cc-cat__always { color: #2c7a12; font-weight: 600; font-size: 14px; }
.cc-modal__policy { margin: 16px 0 0; }
.cc-modal__policy a { color: #222; text-decoration: underline; }
.cc-modal__foot { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 24px; border-top: 1px solid #e3e3e3; }
.cc-modal__foot .cc-btn { flex: 1 1 150px; }

/* Resumen + listado desplegable de cookies */
.cc-cat__more { margin: 8px 0 0; font-size: 14px; color: #1d5fa8; }
.cc-cat__list[hidden] { display: none !important; }
.cc-cat__list p { margin: 10px 0 0; font-size: 14px; }
.cc-cookies { margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.cc-cookies li { margin: 0 0 6px; padding: 9px 12px; border-radius: 6px; background: #f4f4f4; color: #333; }
.cc-cookies span { display: block; }
.cc-cookies__meta { color: #666; font-size: 13px; }
.cc-modal .cc-linkbtn:focus-visible { outline: 3px solid #222; box-shadow: none; }

/* Interruptor */
.cc-switch { position: relative; display: inline-block; flex: 0 0 auto; width: 48px; height: 26px; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cc-switch__track { position: absolute; inset: 0; border-radius: 26px; background: #b5b5b5; transition: background .15s; }
.cc-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.cc-switch input:checked + .cc-switch__track { background: var(--cc-primary); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(22px); }

.cc-footer-link { margin: 10px 0; }

body.cc-modal-open { overflow: hidden; }

@media (max-width: 767px) {
  .cc-banner, .cc-banner--bottom-left, .cc-banner--bottom-right {
    left: 0; right: 0; bottom: 0; max-width: none; border-radius: 12px 12px 0 0; padding: 18px 16px;
  }
  .cc-inner { flex-direction: column; align-items: stretch; gap: 16px; }
  .cc-buttons { flex-direction: column; }
  .cc-btn { width: 100%; }
  .cc-modal { padding: 0; align-items: flex-end; }
  .cc-modal__dialog { max-height: 94vh; border-radius: 12px 12px 0 0; }
  .cc-modal__foot .cc-btn { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-switch__track, .cc-switch__track::after { transition: none; }
}

/* Refuerzo frente a estilos del tema (colores heredados de p, a, button, h2...) */
.cc-banner, .cc-banner .cc-text, .cc-banner .cc-links, .cc-banner p { color: #fff !important; opacity: 1 !important; }
.cc-banner .cc-text { display: block !important; margin: 0 0 10px !important; font-size: 15px !important; line-height: 1.5 !important; }
.cc-banner .cc-links a, .cc-banner .cc-linkbtn {
  color: #fff !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
  padding: 0 !important; margin: 0 20px 0 0 !important; font: inherit !important; text-transform: none !important;
  text-decoration: underline !important; display: inline !important; width: auto !important; min-width: 0 !important;
}
.cc-banner .cc-btn, .cc-modal .cc-btn { color: #fff !important; background: var(--cc-primary) !important; border-color: var(--cc-primary) !important; }
.cc-modal__dialog, .cc-modal__dialog p, .cc-modal__dialog label, .cc-modal__dialog strong, .cc-modal__dialog h2 { color: #222 !important; }
.cc-modal__dialog .cc-cat p, .cc-modal__dialog .cc-cookies__meta { color: #555 !important; }
.cc-modal__dialog .cc-cat__always { color: #2c7a12 !important; }
.cc-modal__dialog .cc-cat__more, .cc-modal__dialog .cc-modal__policy a {
  color: #1d5fa8 !important; background: transparent !important; border: 0 !important; padding: 0 !important;
  text-decoration: underline !important; text-transform: none !important; width: auto !important; min-width: 0 !important;
}
.cc-modal__dialog .cc-modal__close { background: transparent !important; border: 0 !important; color: #222 !important; width: auto !important; min-width: 0 !important; }
