/**
 * Cookie banner.
 * Moved from the agency code pasted into astra/footer.php.
 */

/* Encapsulamos todo bajo el ID para ganar especificidad sin !important */

#cookie-banner,
#cookie-banner * {
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
}

#cookie-float-btn,
#cookie-float-btn * {
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
}

/* ── Overlay ── */
#cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
#cookie-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Banner ── */
#cookie-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(92vw, 520px);
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
  border: none;
  outline: none;
  margin: 0;
  padding: 0;
}
#cookie-banner.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: all;
}

#cookie-banner .cookie-topbar {
  height: 4px;
  background: #3fb7cf;
  width: 100%;
  border-radius: 10px 10px 0 0;
}

#cookie-banner .cookie-body {
  padding: 1.5rem 1.75rem 0;
}

#cookie-banner .cookie-logo {
  display: block;
  margin: 0 auto 1.1rem;
  height: 52px;
  width: auto;
  object-fit: contain;
  border: none;
  box-shadow: none;
}

#cookie-banner .cookie-title {
  font-size: 1rem;
  font-weight: 700;
  color: #3fb7cf;
  margin: 0 0 0.5rem;
  text-align: center;
  line-height: 1.4;
}

#cookie-banner .cookie-text {
  font-size: 0.8rem;
  color: #333333;
  line-height: 1.6;
  text-align: center;
  margin: 0 0 1.1rem;
  font-weight: 400;
}

#cookie-banner .cookie-text a,
#cookie-banner .cookie-text a:visited {
  color: #3fb7cf;
  text-decoration: underline;
  font-weight: 500;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
}
#cookie-banner .cookie-text a:hover,
#cookie-banner .cookie-text a:focus {
  color: #2fa0b8;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  text-decoration: underline;
}

/* ── Tabs ── */
#cookie-banner .cookie-tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  margin: 0;
  padding: 0;
  list-style: none;
}

#cookie-banner .cookie-tabs .cookie-tab {
  flex: 1;
  padding: 0.55rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #999;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s;
  box-shadow: none;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.4;
}
#cookie-banner .cookie-tabs .cookie-tab:hover {
  color: #3fb7cf;
  background: none;
  border-color: transparent;
  box-shadow: none;
  transform: none;
  text-decoration: none;
}
#cookie-banner .cookie-tabs .cookie-tab:focus {
  outline: none;
  box-shadow: none;
  background: none;
}
#cookie-banner .cookie-tabs .cookie-tab.active {
  color: #3fb7cf;
  border-bottom: 2px solid #3fb7cf;
  background: none;
}
#cookie-banner .cookie-tabs .cookie-tab.active:hover {
  border-bottom: 2px solid #3fb7cf;
  background: none;
}

/* ── Paneles ── */
#cookie-banner .cookie-panel {
  display: none;
  padding: 0.9rem 0 0.4rem;
  font-size: 0.79rem;
  color: #555;
  line-height: 1.6;
  min-height: 60px;
  font-weight: 400;
}
#cookie-banner .cookie-panel.active {
  display: block;
}

/* Toggle row */
#cookie-banner .cookie-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: #f5f5f5;
  border-radius: 6px;
}
#cookie-banner .cookie-toggle-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: #333;
}
#cookie-banner .cookie-toggle-label span {
  display: block;
  font-weight: 400;
  color: #999;
  font-size: 0.7rem;
  margin-top: 1px;
}

/* Toggle switch */
#cookie-banner .toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
#cookie-banner .toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
#cookie-banner .toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
}
#cookie-banner .toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
#cookie-banner .toggle-switch input:checked + .toggle-slider { background: #3fb7cf; }
#cookie-banner .toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
#cookie-banner .toggle-switch input:disabled + .toggle-slider { opacity: 0.55; cursor: not-allowed; }

/* ── Botones ── */
#cookie-banner .cookie-actions {
  display: flex;
  gap: 0.55rem;
  padding: 1.1rem 1.75rem 1.4rem;
  flex-wrap: wrap;
  margin: 0;
}

#cookie-banner .cookie-actions .btn-cookie {
  flex: 1;
  min-width: 90px;
  padding: 0.58rem 0.8rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s, box-shadow 0.2s;
  outline: none;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin: 0;
  display: inline-block;
}
#cookie-banner .cookie-actions .btn-cookie:focus {
  outline: none;
  box-shadow: none;
}

#cookie-banner .cookie-actions .btn-reject {
  background: #f5f5f5;
  color: #555555;
  border: 1px solid #e0e0e0;
  box-shadow: none;
}
#cookie-banner .cookie-actions .btn-reject:hover,
#cookie-banner .cookie-actions .btn-reject:focus {
  background: #ebebeb;
  color: #555555;
  border: 1px solid #e0e0e0;
  box-shadow: none;
  transform: scale(1.02);
  text-decoration: none;
}

#cookie-banner .cookie-actions .btn-save {
  background: #ffffff;
  color: #3fb7cf;
  border: 1.5px solid #3fb7cf;
  box-shadow: none;
}
#cookie-banner .cookie-actions .btn-save:hover,
#cookie-banner .cookie-actions .btn-save:focus {
  background: rgba(63,183,207,0.07);
  color: #3fb7cf;
  border: 1.5px solid #3fb7cf;
  box-shadow: none;
  transform: scale(1.02);
  text-decoration: none;
}

#cookie-banner .cookie-actions .btn-accept {
  background: #3fb7cf;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(63,183,207,0.3);
}
#cookie-banner .cookie-actions .btn-accept:hover,
#cookie-banner .cookie-actions .btn-accept:focus {
  background: #2fa0b8;
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(63,183,207,0.4);
  transform: scale(1.02);
  text-decoration: none;
}

/* ── Botón flotante ── */
#cookie-float-btn {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 48px;
  height: 48px;
  background: #3fb7cf;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 99997;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(63,183,207,0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  outline: none;
  padding: 0;
  margin: 0;
}
#cookie-float-btn:hover,
#cookie-float-btn:focus {
  transform: scale(1.1);
  box-shadow: 0 6px 22px rgba(63,183,207,0.55);
  background: #3fb7cf;
  border: none;
  outline: none;
}
#cookie-float-btn svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
}
#cookie-float-btn.show { display: flex; }

#cookie-float-btn::after {
  content: 'Gestionar cookies';
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%);
  background: #222;
  color: #fff;
  font-size: 0.7rem;
  font-family: 'Montserrat', sans-serif;
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#cookie-float-btn:hover::after { opacity: 1; }

/* ── Responsive ── */
@media (max-width: 600px) {
  #cookie-banner {
    width: 96vw;
    max-height: 95vh;
  }
  #cookie-banner .cookie-body {
    padding: 1.25rem 1.25rem 0;
  }
  #cookie-banner .cookie-actions {
    flex-direction: column;
    padding: 1rem 1.25rem 1.25rem;
  }
  #cookie-banner .cookie-actions .btn-cookie {
    flex: unset;
    width: 100%;
  }
  #cookie-banner .cookie-tabs .cookie-tab {
    font-size: 0.65rem;
    padding: 0.5rem 0.2rem;
  }
}
