/* ============================================================
   JH Cookie Banner — diseno premium glassmorphism
   Paleta: negro #111, dorado #f6c34f / #d4a040, glass blur
   ============================================================ */

.jh-cc[hidden] { display: none !important; }
.jh-cc {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #111;
  --jh-cc-gold: #f6c34f;
  --jh-cc-gold-dark: #d4a040;
  --jh-cc-bg: rgba(255, 255, 255, .85);
  --jh-cc-shadow: 0 -10px 40px rgba(0, 0, 0, .12);
}

/* ============================================================
   BANNER (estado inicial pidiendo consentimiento)
   ============================================================ */
.jh-cc__banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 99999;
  background: var(--jh-cc-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 20px;
  box-shadow: 0 12px 60px rgba(0, 0, 0, .18), 0 4px 12px rgba(0, 0, 0, .08);
  padding: 22px 26px;
  max-width: 1200px;
  margin: 0 auto;
  animation: jhCcSlideUp .5s cubic-bezier(.4, 0, .2, 1);
}
@keyframes jhCcSlideUp {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.jh-cc__banner-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}
.jh-cc__banner-text {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.jh-cc__banner-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--jh-cc-gold), var(--jh-cc-gold-dark));
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jh-cc__banner-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.jh-cc__banner-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #444;
}
.jh-cc__banner-link {
  color: #111;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.jh-cc__banner-link:hover { color: var(--jh-cc-gold-dark); }

.jh-cc__banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Buttons base */
.jh-cc__btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .2s ease, border-color .2s ease, transform .12s ease, color .2s ease;
  white-space: nowrap;
  letter-spacing: .01em;
}
.jh-cc__btn--ghost {
  background: rgba(0, 0, 0, .04);
  color: #111;
  border-color: rgba(0, 0, 0, .08);
}
.jh-cc__btn--ghost:hover {
  background: rgba(0, 0, 0, .08);
  border-color: rgba(0, 0, 0, .15);
}
.jh-cc__btn--primary {
  background: #111;
  color: #fff;
  border-color: #111;
}
.jh-cc__btn--primary:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.jh-cc__btn:active { transform: translateY(0); }

/* ============================================================
   MODAL DE PERSONALIZACIÓN
   ============================================================ */
.jh-cc__modal[hidden] { display: none !important; }
.jh-cc__modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.jh-cc__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 20, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: jhCcFadeIn .25s ease;
}
@keyframes jhCcFadeIn { from { opacity: 0; } to { opacity: 1; } }
.jh-cc__modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  overflow: hidden;
  animation: jhCcModalIn .35s cubic-bezier(.4, 0, .2, 1);
}
@keyframes jhCcModalIn {
  from { transform: scale(.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}

.jh-cc__modal-head {
  padding: 24px 28px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.jh-cc__modal-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.jh-cc__modal-sub {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}
.jh-cc__modal-close {
  flex-shrink: 0;
  background: #f4f4f4;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease;
}
.jh-cc__modal-close:hover {
  background: #111;
  color: #fff;
}

.jh-cc__modal-body {
  padding: 18px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Categoria card */
.jh-cc__cat {
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 16px 18px;
  transition: border-color .2s ease;
}
.jh-cc__cat:hover { border-color: #d8d8d8; }
.jh-cc__cat-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.jh-cc__cat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff8e7;
  color: var(--jh-cc-gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.jh-cc__cat-info { min-width: 0; }
.jh-cc__cat-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 700;
}
.jh-cc__cat-desc {
  margin: 0;
  font-size: 12.5px;
  color: #666;
  line-height: 1.45;
}

/* Toggle (iOS-style) */
.jh-cc__toggle {
  position: relative;
  width: 44px;
  height: 26px;
  cursor: pointer;
  display: inline-block;
  flex-shrink: 0;
}
.jh-cc__toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}
.jh-cc__toggle-track {
  position: absolute;
  inset: 0;
  background: #d4d4d8;
  border-radius: 999px;
  transition: background .25s ease;
}
.jh-cc__toggle-track::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.jh-cc__toggle input:checked ~ .jh-cc__toggle-track {
  background: linear-gradient(135deg, var(--jh-cc-gold), var(--jh-cc-gold-dark));
}
.jh-cc__toggle input:checked ~ .jh-cc__toggle-track::after {
  transform: translateX(18px);
}
/* Locked toggle (necesarias) */
.jh-cc__toggle--locked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: auto;
}
.jh-cc__toggle--locked .jh-cc__toggle-track {
  position: relative;
  width: 44px;
  height: 26px;
  background: linear-gradient(135deg, #16a34a, #15803d);
}
.jh-cc__toggle--locked .jh-cc__toggle-track::after {
  transform: translateX(18px);
}
.jh-cc__toggle-label {
  font-size: 11px;
  font-weight: 700;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Cookie details (acordeón) */
.jh-cc__cat-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e6e6e6;
}
.jh-cc__cat-details summary {
  cursor: pointer;
  font-size: 12px;
  color: #888;
  font-weight: 600;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.jh-cc__cat-details summary::-webkit-details-marker { display: none; }
.jh-cc__cat-details summary::after {
  content: '▾';
  font-size: 10px;
  transition: transform .2s ease;
}
.jh-cc__cat-details[open] summary::after { transform: rotate(180deg); }
.jh-cc__cat-details summary:hover { color: #111; }
.jh-cc__cookies-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 12px;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.jh-cc__cookies-list strong {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  color: #111;
  background: #f4f4f4;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.jh-cc__modal-foot {
  padding: 18px 28px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  background: #fafafa;
}

/* ============================================================
   FAB (botón flotante para reabrir consentimiento)
   ============================================================ */
.jh-cc__fab[hidden] { display: none !important; }
.jh-cc__fab {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 9998;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .1);
  color: var(--jh-cc-gold-dark);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
  opacity: .9;
}
.jh-cc__fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
  opacity: 1;
}

/* ============================================================
   Mobile responsive
   ============================================================ */
@media (max-width: 768px) {
  .jh-cc__banner {
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 18px 20px;
    border-radius: 16px;
  }
  .jh-cc__banner-content {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .jh-cc__banner-icon {
    width: 40px;
    height: 40px;
  }
  .jh-cc__banner-icon svg { width: 24px; height: 24px; }
  .jh-cc__banner-title { font-size: 16px; }
  .jh-cc__banner-desc { font-size: 13px; }
  .jh-cc__banner-actions {
    width: 100%;
    flex-direction: column-reverse;
  }
  .jh-cc__banner-actions .jh-cc__btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
  }

  .jh-cc__modal { padding: 0; align-items: flex-end; }
  .jh-cc__modal-content {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    animation: jhCcModalInMobile .35s cubic-bezier(.4, 0, .2, 1);
  }
  @keyframes jhCcModalInMobile {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .jh-cc__modal-head { padding: 20px 22px 16px; }
  .jh-cc__modal-title { font-size: 19px; }
  .jh-cc__modal-body { padding: 14px 22px; gap: 12px; }
  .jh-cc__modal-foot {
    padding: 16px 22px;
    flex-direction: column-reverse;
  }
  .jh-cc__modal-foot .jh-cc__btn {
    width: 100%;
    justify-content: center;
  }
  .jh-cc__cat { padding: 14px; }
  .jh-cc__cat-head { gap: 10px; }
  .jh-cc__cat-icon { width: 34px; height: 34px; }

  .jh-cc__fab { bottom: 12px; left: 12px; }
}

/* Focus visible (a11y) */
.jh-cc__btn:focus-visible,
.jh-cc__modal-close:focus-visible,
.jh-cc__fab:focus-visible {
  outline: 2px solid var(--jh-cc-gold-dark);
  outline-offset: 2px;
}
.jh-cc__toggle input:focus-visible ~ .jh-cc__toggle-track {
  box-shadow: 0 0 0 3px rgba(244, 195, 79, .35);
}

/* No-scroll cuando modal abierto */
body.jh-cc-modal-open {
  overflow: hidden;
}

/* ============================================================
   Footer legal bar (links a paginas legales + gestionar cookies)
   ============================================================ */
.jh-footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 14px 20px;
  font-size: 12.5px;
  color: #888;
  border-top: 1px solid #ececec;
  margin-top: 8px;
}
.jh-footer-legal a {
  color: #555 !important;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s ease;
}
.jh-footer-legal a:hover { color: #111 !important; }
.jh-footer-legal > span { color: #ccc; user-select: none; }
.jh-footer-legal__sep-bar { color: #ddd; }
.jh-footer-legal__btn {
  background: transparent;
  border: 1px solid rgba(0,0,0,.1);
  color: #555;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.jh-footer-legal__btn:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}
@media (max-width: 600px) {
  .jh-footer-legal { gap: 6px 10px; font-size: 12px; }
  .jh-footer-legal__sep-bar { display: none; }
}
