/* ==========================================================================
   Cookie Consent Banner & Settings Panel
   Cumplimiento LSSI-CE / RGPD — jjasoluciones.es
   ========================================================================== */

/* --- Banner overlay container --- */
.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--jja-navy-deep, #0E2138);
  border-top: 3px solid var(--jja-accent, #F2541B);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .35);
  padding: 24px 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
}

.cc-banner.cc-visible {
  transform: translateY(0);
}

.cc-banner.cc-hidden {
  transform: translateY(100%);
  pointer-events: none;
}

/* Inner container */
.cc-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Banner main layout --- */
.cc-main {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.cc-text {
  flex: 1;
}

.cc-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cc-title::before {
  content: "🍪";
  font-size: 20px;
}

.cc-description {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .75);
  margin: 0;
}

.cc-description a {
  color: var(--jja-accent, #F2541B);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-description a:hover {
  color: #ff7a52;
}

/* --- Buttons container --- */
.cc-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

/* --- All buttons share the same base style --- */
.cc-btn {
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  font-weight: 600;
  font-size: 13px;
  padding: 12px 22px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
  text-decoration: none;
  line-height: 1.2;
}

.cc-btn:hover {
  transform: translateY(-1px);
}

.cc-btn:active {
  transform: translateY(0);
}

/* Accept — solid accent */
.cc-btn-accept {
  background: var(--jja-accent, #F2541B);
  color: #FFFFFF;
}

.cc-btn-accept:hover {
  background: var(--jja-accent-deep, #C7420E);
}

/* Reject — IDENTICAL size & prominence to Accept */
.cc-btn-reject {
  background: var(--jja-accent, #F2541B);
  color: #FFFFFF;
}

.cc-btn-reject:hover {
  background: var(--jja-accent-deep, #C7420E);
}

/* Customize — outlined, same dimensions */
.cc-btn-settings {
  background: transparent;
  color: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .3);
}

.cc-btn-settings:hover {
  border-color: rgba(255, 255, 255, .7);
  color: #FFFFFF;
}

/* ==========================================================================
   Settings Panel (Personalizar)
   ========================================================================== */

.cc-panel {
  display: none;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  animation: ccSlideDown 0.35s ease-out;
}

.cc-panel.cc-panel-open {
  display: block;
}

@keyframes ccSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cc-panel-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 16px;
}

/* --- Cookie category row --- */
.cc-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.cc-category:last-of-type {
  border-bottom: none;
}

.cc-category-info {
  flex: 1;
}

.cc-category-name {
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
}

.cc-category-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, .6);
  margin: 0;
  line-height: 1.45;
}

/* --- Toggle switch --- */
.cc-toggle {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 26px;
}

.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cc-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .15);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.cc-toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.cc-toggle input:checked + .cc-toggle-slider {
  background: var(--jja-accent, #F2541B);
}

.cc-toggle input:checked + .cc-toggle-slider::after {
  transform: translateX(22px);
}

.cc-toggle input:disabled + .cc-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.cc-toggle input:disabled:checked + .cc-toggle-slider {
  background: #4A8C5C;
  opacity: 0.8;
}

/* Always-on label for necessary cookies */
.cc-always-on {
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  font-size: 11px;
  color: #4A8C5C;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid rgba(74, 140, 92, .4);
  border-radius: 4px;
}

/* Panel save button */
.cc-panel-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.cc-btn-save {
  background: var(--jja-accent, #F2541B);
  color: #FFFFFF;
}

.cc-btn-save:hover {
  background: var(--jja-accent-deep, #C7420E);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .cc-banner {
    padding: 20px 0;
  }

  .cc-main {
    flex-direction: column;
    gap: 16px;
  }

  .cc-actions {
    width: 100%;
    flex-direction: column;
  }

  .cc-btn {
    width: 100%;
    text-align: center;
    padding: 14px 20px;
  }

  .cc-category {
    flex-direction: column;
    gap: 10px;
  }

  .cc-panel-actions {
    justify-content: stretch;
  }

  .cc-panel-actions .cc-btn {
    flex: 1;
  }
}
