/* General Body Style */
body {
  font-family: "Inter", sans-serif;
  margin: 0;
  padding: 0;
  /* Ensure banner doesn't cover content */
  /*padding-bottom: 250px;*/
}

/* Cookie Banner Styling */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 550px;
  width: 90%;
  background-color: #d8f3fa;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: visible;
  text-align: center;
}

.cookie-banner-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  padding-top: 85px;
}

.cookie-image {
  width: 150px;
  position: absolute;
  top: -75px;
  left: 50%;
  transform: translateX(-50%);
}

.cookie-banner-text-content p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

.cookie-banner-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
}

.cookie-btn-primary,
.cookie-btn-secondary {
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, text-decoration 0.3s;
}

.cookie-btn-primary {
  background-color: #38bdf8;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cookie-btn-primary:hover {
  background-color: #0ea5e9;
}

.cookie-btn-secondary {
  background-color: transparent;
  color: #38bdf8;
  padding: 0;
  font-weight: normal;
  border-radius: 0;
  box-shadow: none;
}

.cookie-btn-secondary:hover {
  text-decoration: underline;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 2000;
  padding-left: 20px;
  box-sizing: border-box;
}

.cb-modal-content {
  background-color: #e6f7fb;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccecf4;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.close-button {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #555;
  padding: 0;
  line-height: 1;
  box-shadow: none;
  text-shadow: none;
  -webkit-appearance: none;
}

.close-button:hover {
  color: #000;
}

.cb-modal-body {
  overflow-y: auto;
  padding-right: 10px;
  margin-right: -10px;
}

.cb-modal-body p {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.cookie-option {
  background-color: #d1eef6;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
}

.cookie-option label {
  font-size: 14px;
  color: #333;
  cursor: pointer;
  padding-right: 10px;
}

.cookie-option input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-option .checkmark {
  position: relative;
  height: 20px;
  width: 20px;
  background-color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.2s;
}

.cookie-option input[type="checkbox"]:focus-visible ~ .checkmark {
  box-shadow: 0 0 0 2px #38bdf8;
}

.cookie-option input[type="checkbox"]:checked ~ .checkmark {
  background-color: #38bdf8;
  border-color: #38bdf8;
}

/* This adds the checkmark symbol inside the custom checkbox */
.cookie-option input[type="checkbox"]:checked ~ .checkmark::after {
  content: "";
  position: absolute;
  display: block;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.cookie-option input[type="checkbox"]:disabled ~ .checkmark {
  background-color: #38bdf8; /* Ensures disabled but checked looks checked */
  border-color: #38bdf8;
  cursor: not-allowed;
}

/* This ensures the checkmark also appears on the disabled "necessary" checkbox */
.cookie-option input[type="checkbox"]:disabled ~ .checkmark::after {
  content: "";
  position: absolute;
  display: block;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.cookie-option[data-disabled="true"] {
  cursor: not-allowed;
}

.modal-footer {
  display: flex;
  justify-content: flex-start;
  gap: 20px;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #ccecf4;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
  .cookie-banner {
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: calc(100% - 20px);
  }

  .modal-overlay {
    padding: 10px;
    justify-content: center;
    align-items: center;
  }

  .cb-modal-content {
    width: 100%;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .modal-footer button.cookie-btn-secondary {
    text-align: center;
    padding: 15px 0;
    border: none;
    font-weight: normal;
    -webkit-tap-highlight-color: transparent;
  }

  .modal-footer button.cookie-btn-secondary:hover {
    background-color: transparent;
    text-decoration: none;
  }

  /* Reorder buttons */
  .modal-footer #accept-all-cookies-modal {
    order: 1;
  }
  .modal-footer #save-cookie-settings {
    order: 2;
  }
  .modal-footer #reject-all-cookies-modal {
    order: 3;
  }
}
