/* ==========================================================================
   Banner de consentimiento de cookies — Javi Villanueva Web
   Módulo independiente: no depende de clases de style.css, solo reutiliza
   las variables de marca (colores/tipografía) definidas aquí mismo.
   ========================================================================== */

#cookie-consent-banner,
#cookie-consent-modal {
  --cc-bg: #ffffff;
  --cc-text: #111111;
  --cc-text-secondary: #555555;
  --cc-border: #e5e7eb;
  --cc-primary: #2563eb;
  --cc-primary-hover: #1d4ed8;
  --cc-font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--cc-font);
  box-sizing: border-box;
}
#cookie-consent-banner *,
#cookie-consent-modal * {
  box-sizing: border-box;
}

/* ---------------------------------------------------------------------
   Banner inferior
   --------------------------------------------------------------------- */
#cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--cc-bg);
  border-top: 1px solid var(--cc-border);
  box-shadow: 0 -8px 24px rgba(17, 17, 17, 0.08);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transform: translateY(110%);
  transition: transform 0.35s ease;
}
#cookie-consent-banner.is-visible {
  transform: translateY(0);
}

.cc-banner-text {
  flex: 1 1 380px;
  min-width: 260px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cc-text-secondary);
  margin: 0;
}
.cc-banner-text a {
  color: var(--cc-primary);
  text-decoration: underline;
}
.cc-banner-text a:hover {
  color: var(--cc-primary-hover);
}

.cc-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.cc-btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cc-btn-primary {
  background: var(--cc-primary);
  color: #fff;
}
.cc-btn-primary:hover {
  background: var(--cc-primary-hover);
}
.cc-btn-secondary {
  background: transparent;
  color: var(--cc-text);
  border-color: var(--cc-border);
}
.cc-btn-secondary:hover {
  background: #f7f7f7;
}
.cc-btn-text {
  background: transparent;
  color: var(--cc-text-secondary);
  border-color: transparent;
  text-decoration: underline;
  text-transform: none;
  font-weight: 600;
  padding: 12px 8px;
}
.cc-btn-text:hover {
  color: var(--cc-primary);
}

@media (max-width: 640px) {
  #cookie-consent-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 20px;
  }
  .cc-banner-actions {
    justify-content: stretch;
  }
  .cc-banner-actions .cc-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* ---------------------------------------------------------------------
   Modal "Configurar"
   --------------------------------------------------------------------- */
#cookie-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.5);
}
#cookie-consent-modal.is-open {
  display: flex;
}

.cc-modal-box {
  background: var(--cc-bg);
  border-radius: 12px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 24px 60px -20px rgba(17, 17, 17, 0.35);
}

.cc-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-text);
  margin: 0 0 12px;
}
.cc-modal-intro {
  font-size: 14px;
  color: var(--cc-text-secondary);
  line-height: 1.6;
  margin: 0 0 24px;
}

.cc-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--cc-border);
}
.cc-option:first-of-type {
  border-top: none;
}
.cc-option-info {
  flex: 1;
}
.cc-option-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cc-text);
  margin: 0 0 4px;
}
.cc-option-desc {
  font-size: 13px;
  color: var(--cc-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Switch estilo toggle */
.cc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  margin-top: 2px;
}
.cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cc-switch-track {
  position: absolute;
  inset: 0;
  background: var(--cc-border);
  border-radius: 999px;
  transition: background 0.2s ease;
  cursor: pointer;
}
.cc-switch-track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.25);
}
.cc-switch input:checked + .cc-switch-track {
  background: var(--cc-primary);
}
.cc-switch input:checked + .cc-switch-track::before {
  transform: translateX(18px);
}
.cc-switch input:disabled + .cc-switch-track {
  background: var(--cc-primary);
  opacity: 0.5;
  cursor: not-allowed;
}

.cc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}
