/* ==========================================================================
   12-COOKIES.CSS — US PRIVACY & COOKIE CONSENT STYLES
   Lead Systems Architect Specification
   ========================================================================== */

.cookie-banner {
  position: fixed;
  bottom: var(--space-md);
  left: var(--space-md);
  right: var(--space-md);
  max-width: 720px;
  margin: 0 auto;
  z-index: 1000 !important;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-glass);
  backdrop-filter: blur(var(--glass-blur-lg));
  -webkit-backdrop-filter: blur(var(--glass-blur-lg));
  border: 1px solid var(--glass-border-hover);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  transform: translateY(120%);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-expo);
}

.cookie-banner.active {
  transform: translateY(0);
  opacity: 1;
}

.cookie-text {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.6;
}

.cookie-text strong {
  color: var(--text-main);
  font-family: var(--font-display);
}

.cookie-text a {
  color: var(--advisory-cyan);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.cookie-actions .btn {
  padding: 8px 16px;
  font-size: var(--fs-xs);
}

/* Modal de Preferencias de Cookies & Backdrop Safety */
#cookie-modal-backdrop:not(.active),
.modal-backdrop:not(.active) {
  display: none !important;
}

#cookie-modal-backdrop.active,
.modal-backdrop.active {
  display: flex !important;
}

.cookie-preference-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--glass-border);
}

.cookie-pref-info {
  display: flex;
  flex-direction: column;
}

.cookie-pref-title {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--text-main);
}

.cookie-pref-desc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  transition: var(--duration-fast);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: var(--duration-fast);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--advisory-blue);
  border-color: var(--advisory-blue);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #FFFFFF;
}

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

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: var(--space-xs);
    left: var(--space-xs);
    right: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }

  .cookie-text {
    font-size: var(--fs-2xs);
    line-height: 1.45;
  }

  .cookie-actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }

  .cookie-actions .btn {
    flex: 1 1 auto;
    padding: 8px 12px;
  }
}

/* W-V4 (2026-10-20): on desktop the notice is a slim bottom bar so it never covers the hero calls to action. */
@media (min-width: 769px) {
  .cookie-banner {
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 10px max(24px, calc((100vw - 1200px) / 2));
  }

  .cookie-text {
    line-height: 1.45;
  }
}
