/* ==============================================
   Cookie Consent Banner — Embasa Web
   ============================================== */

/* Overlay */
#cookie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9990;
  display: none;
}

/* ---- Compact Banner ---- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 680px;
  margin: 0 auto;
  z-index: 9991;
  background: #fff;
  border-radius: 12px 12px 0 0;
  padding: 24px 28px 28px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
  display: none;
  flex-direction: column;
  font-family: 'Fira Sans', sans-serif;
}

@media (max-width: 680px) {
  #cookie-banner {
    border-radius: 0;
    max-width: 100%;
  }
}

.cookie-banner__title {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-banner__body {
  font-size: 14px;
  color: #444;
  line-height: 1.55;
  margin-bottom: 18px;
  margin-top: 0;
}

.cookie-banner__actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cookie-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid;
  transition: opacity 0.2s;
  text-align: center;
  font-family: 'Fira Sans', sans-serif;
}
.cookie-btn:hover { opacity: 0.82; }

.cookie-btn--accept {
  background: #D8232A;
  color: #fff;
  border-color: #D8232A;
}

.cookie-btn--reject {
  background: transparent;
  color: #D8232A;
  border-color: #D8232A;
}

.cookie-btn--configure {
  background: transparent;
  color: #555;
  border-color: #ccc;
  font-weight: 400;
}

.cookie-banner__privacy {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 0;
}

.cookie-banner__privacy a {
  color: #D8232A;
  text-decoration: underline;
}

/* Mobile: stack buttons */
@media (max-width: 480px) {
  .cookie-banner__actions {
    flex-direction: column;
  }
  .cookie-btn--configure {
    order: 3;
    border: none;
    flex: none;
    text-align: center;
    padding: 4px 0;
    font-weight: 400;
  }
}

/* ---- Preferences Panel ---- */
#cookie-preferences-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: calc(100vw - 24px);
  max-height: 90vh;
  overflow-y: auto;
  z-index: 9992;
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  display: none;
  flex-direction: column;
  font-family: 'Fira Sans', sans-serif;
}

.cookie-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
}

.cookie-panel__title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.cookie-panel__close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  padding: 0;
}

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

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

.cookie-category__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.cookie-category__name {
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.cookie-category__description {
  font-size: 13px;
  color: #666;
  line-height: 1.45;
  margin: 0;
}

/* Toggle switch */
.cookie-toggle-wrapper {
  flex-shrink: 0;
  position: relative;
}

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

.cookie-toggle-label {
  display: block;
  width: 46px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.cookie-toggle-label::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-toggle:checked + .cookie-toggle-label {
  background: #D8232A;
}

.cookie-toggle:checked + .cookie-toggle-label::after {
  transform: translateX(20px);
}

.cookie-toggle:disabled + .cookie-toggle-label {
  background: #BACF47;
  cursor: not-allowed;
}

.cookie-toggle-always {
  font-size: 12px;
  color: #BACF47;
  font-weight: 600;
  white-space: nowrap;
  padding-top: 4px;
}

.cookie-panel__actions {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}

.cookie-btn--panel-save {
  flex: 1;
  padding: 11px 16px;
  background: #D8232A;
  color: #fff;
  border: 2px solid #D8232A;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Fira Sans', sans-serif;
}
.cookie-btn--panel-save:hover { opacity: 0.85; }

.cookie-btn--panel-reject {
  flex: 1;
  padding: 11px 16px;
  background: transparent;
  color: #D8232A;
  border: 2px solid #D8232A;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: 'Fira Sans', sans-serif;
}
.cookie-btn--panel-reject:hover { opacity: 0.82; }

/* "Gestionar cookies" link in footer */
.cookie-manage-link {
  color: #D8232A;
  text-decoration: underline;
  cursor: pointer;
  font-size: 14px;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Fira Sans', sans-serif;
  display: inline;
}

@media (max-width: 480px) {
  .cookie-panel__actions {
    flex-direction: column;
  }
}
