/* ===========================
   COOKIE CONSENT (banner + preferences modal)
   Cumplimiento Ley 21.719 (Chile) sobre Protección de Datos Personales.
=========================== */

.cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background-color: #142b4d;
  color: #fff;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.25);
  padding: 20px 20px;
}

.cookie-consent-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-consent-text {
  flex: 1 1 420px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #d7e0ee;
}

.cookie-consent-text a {
  color: #7db2f5;
  text-decoration: underline;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.cookie-btn {
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.cookie-btn-primary {
  background-color: #2b6cc4;
  color: #fff;
}

.cookie-btn-primary:hover {
  background-color: #235aa3;
}

.cookie-btn-ghost {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.cookie-btn-ghost:hover {
  border-color: #fff;
}

/* Preferences modal */

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 20, 35, 0.6);
}

.cookie-modal-content {
  position: relative;
  background-color: #fff;
  color: #142b4d;
  border-radius: 10px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #8fa2bd;
  cursor: pointer;
}

.cookie-modal-close:hover {
  color: #142b4d;
}

.cookie-modal-content h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
}

.cookie-modal-content > p {
  font-size: 14px;
  color: #4a5c78;
  line-height: 1.6;
  margin-bottom: 20px;
}

.cookie-category {
  border-top: 1px solid #e5eaf2;
  padding: 16px 0;
}

.cookie-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
}

.cookie-category p {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #6b7a92;
  line-height: 1.5;
}

.cookie-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

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

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccd4e0;
  border-radius: 24px;
  transition: 0.2s;
}

.cookie-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.cookie-switch input:checked + .cookie-slider {
  background-color: #2b6cc4;
}

.cookie-switch input:checked + .cookie-slider::before {
  transform: translateX(18px);
}

.cookie-switch input:disabled + .cookie-slider {
  background-color: #2b6cc4;
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
  }

  /* .cookie-consent-text's flex-basis (420px) sizes its WIDTH in the
     desktop row layout above — once the container switches to a column
     here, the same basis is read as a minimum HEIGHT instead, stretching
     the text block far taller than its actual content. Reset it so the
     block just hugs its content on mobile. */
  .cookie-consent-text {
    flex: 1 1 auto;
  }

  .cookie-consent-actions {
    justify-content: stretch;
  }

  .cookie-consent-actions .cookie-btn {
    flex: 1 1 auto;
  }

  .cookie-modal-content {
    padding: 26px 20px;
  }
}
