csck-cookie {
  display: block;
}

/* Banner principal */
.csck-banner {
  background: #000;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 700px;
  width: 90%;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  padding: 1.5rem;
  z-index: 9999;
  animation: csck-fadeIn 0.5s ease-out;
  color: #d3c2c2;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.csck-banner p {
  margin: 0 0 1rem 0;
  color: #d3c2c2;
  line-height: 1.5;
}

.csck-banner .csck-read-more {
  color: #4db8ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.csck-banner .csck-read-more:hover,
.csck-banner .csck-read-more:focus {
  color: #83ceff;
}

/* Botones del banner */
.csck-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.csck-buttons button,
.csck-actions button {
  font: inherit;
  background-color: #007cba;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease, opacity 0.25s ease;
}

.csck-buttons button:hover,
.csck-buttons button:focus,
.csck-actions button:hover,
.csck-actions button:focus {
  background-color: #005fa3;
}

.csck-buttons button:active,
.csck-actions button:active {
  transform: scale(0.98);
}

/* Botón de preferencias algo distinto, sin quitar peso a aceptar/rechazar */
csck-cookie #csck-preferences {
  background: transparent;
  color: #d3c2c2;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

csck-cookie #csck-preferences:hover,
csck-cookie #csck-preferences:focus {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Fondo del modal */
.csck-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 1rem;
}

.csck-modal.open {
  display: flex;
}

/* Caja del modal */
.csck-modal-content {
  background: #000;
  color: #d3c2c2;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 640px;
  min-width: 300px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.csck-modal-content:focus {
  outline: none;
}

.csck-modal-content h2 {
  color: #d3c2c2;
}

/* Cabecera del modal */
.csck-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.csck-modal-header h2 {
  margin: 0 0 8px;
}

.csck-modal-description {
  margin: 0;
  color: #b9abab;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Botón cerrar */
.csck-modal-close {
  border: 0;
  background: transparent;
  color: #d3c2c2;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.csck-modal-close:hover,
.csck-modal-close:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Categorías */
.csck-category {
  display: grid;
  gap: 12px;
}

.csck-category label {
  color: #d3c2c2;
}

.csck-category-item {
  display: block;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #101010;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.csck-category-item:hover {
  background: #151515;
  border-color: rgba(77, 184, 255, 0.45);
}

.csck-category-item-required {
  cursor: default;
  opacity: 0.9;
}

.csck-category-item-required:hover {
  background: #101010;
  border-color: rgba(255, 255, 255, 0.14);
}

.csck-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.csck-category-header input {
  accent-color: #007cba;
}

.csck-category-title {
  color: #f1e7e7;
  font-weight: 600;
}

.csck-category-desc {
  display: block;
  margin-top: 7px;
  padding-left: 28px;
  color: #b9abab;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* Acciones del modal */
.csck-actions {
  margin-top: 18px;
  text-align: right;
}

/* Foco accesible, limitado al plugin */
csck-cookie button:focus-visible,
csck-cookie a:focus-visible,
.csck-preferences-link:focus-visible,
.csck-iframe-placeholder button:focus-visible {
  outline: 2px solid #4db8ff;
  outline-offset: 2px;
}

/* Enlace fijo para reabrir preferencias */
.csck-preferences-link-wrap {
  display: none;
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 999999;
}

.csck-preferences-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: #2471a3;
  color: #ffffff !important;
  font-size: 14px;
  line-height: 1;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.csck-preferences-link:hover,
.csck-preferences-link:focus {
  color: #ffffff !important;
  text-decoration: none !important;
  opacity: 0.9;
}

/* Aviso sin JavaScript */
.csck-noscript {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 999999;
  background: #000;
  color: #d3c2c2;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.csck-noscript a {
  color: #4db8ff;
}

/* Placeholder de iframes bloqueados */
.csck-iframe-placeholder {
  box-sizing: border-box;
  width: 100%;
  min-height: 220px;
  padding: 24px;
  margin: 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: #101010;
  color: #d3c2c2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.csck-iframe-placeholder p {
  margin: 0;
  max-width: 560px;
  color: #d3c2c2;
  line-height: 1.5;
}

.csck-iframe-placeholder strong {
  color: #f1e7e7;
}

.csck-iframe-placeholder button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: #007cba;
  color: #fff;
  font-weight: 600;
  transition: background 0.25s ease, transform 0.15s ease;
}

.csck-iframe-placeholder button:hover,
.csck-iframe-placeholder button:focus {
  background: #005fa3;
}

.csck-iframe-placeholder button:active {
  transform: scale(0.98);
}

/* Animación */
@keyframes csck-fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Respeta usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .csck-banner {
    animation: none;
  }

  .csck-buttons button,
  .csck-actions button,
  .csck-iframe-placeholder button {
    transition: none;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .csck-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    max-width: none;
    padding: 1.1rem;
    border-radius: 10px;
  }

  .csck-banner p {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .csck-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    text-align: initial;
  }

  .csck-buttons button {
    width: 100%;
    margin-left: 0;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
  }

  .csck-modal {
    align-items: flex-end;
    padding: 0;
  }

  .csck-modal-content {
    width: 100%;
    max-width: none;
    min-width: 0;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    padding: 1.3rem;
  }

  .csck-modal-header {
    gap: 12px;
  }

  .csck-modal-header h2 {
    font-size: 1.25rem;
  }

  .csck-modal-description {
    font-size: 0.92rem;
  }

  .csck-category {
    gap: 10px;
  }

  .csck-category-item {
    padding: 12px 13px;
  }

  .csck-category-desc {
    padding-left: 0;
    font-size: 0.88rem;
  }

  .csck-actions {
    margin-top: 16px;
  }

  .csck-actions button {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .csck-preferences-link-wrap {
    left: 12px;
    bottom: 12px;
  }

  .csck-preferences-link {
    padding: 9px 12px;
    font-size: 13px;
  }

  .csck-iframe-placeholder {
    min-height: 180px;
    padding: 18px;
    border-radius: 10px;
  }

  .csck-iframe-placeholder p {
    font-size: 0.92rem;
  }

  .csck-iframe-placeholder button {
    width: 100%;
    max-width: 260px;
  }
}