/* Cookie consent banner + settings modal (Google Consent Mode v2) */

/* Card #66: compact bottom banner — minimal height on mobile (~140px), the
   hero/form/Quick Call stay visible; Accept all is the visual primary,
   Manage choices secondary, Reject non-essential a discreet text link. */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--white);
  border-top: 1px solid var(--grey-200);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  padding: 12px 16px 10px;
  font-family: var(--font);
}

#cookie-banner.hidden { display: none; }

#cookie-banner h4 {
  color: var(--grey-800);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 2px;
}

#cookie-banner p {
  color: var(--grey-600);
  font-size: 0.75rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.cookie-banner__actions {
  display: flex;
  gap: 8px;
}

.cookie-banner__actions button {
  flex: 1;
  border: none;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease;
}

#accept-all-cookies {
  background: var(--green-500);
  color: var(--white);
}
#accept-all-cookies:hover { background: var(--green-600); }

#open-cookie-settings {
  background: var(--grey-100);
  color: var(--grey-800);
}
#open-cookie-settings:hover { background: var(--grey-200); }

.cookie-banner__reject {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  padding: 2px 6px;
  color: var(--grey-600);
  font-family: var(--font);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}
.cookie-banner__reject:hover { color: var(--grey-800); }

@media (min-width: 640px) {
  #cookie-banner {
    left: auto;
    right: 24px;
    bottom: 24px;
    max-width: 380px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px 12px;
  }
}

/* ----- Settings modal ----- */

#cookie-settings {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(20, 22, 27, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--font);
}

#cookie-settings.hidden { display: none; }

.cookie-settings__panel {
  background: var(--white);
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.cookie-settings__header {
  padding: 20px;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cookie-settings__header h3 {
  color: var(--grey-800);
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.cookie-settings__header p {
  color: var(--grey-600);
  font-size: 0.8125rem;
}

.cookie-settings__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--grey-400);
  cursor: pointer;
  padding: 0;
}
.cookie-settings__close:hover { color: var(--grey-800); }

.cookie-settings__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cookie-settings__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--grey-100);
}
.cookie-settings__row:last-child { border-bottom: none; padding-bottom: 0; }

.cookie-settings__row h5 {
  color: var(--grey-800);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.cookie-settings__row p {
  color: var(--grey-600);
  font-size: 0.75rem;
  line-height: 1.5;
}

.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  margin-top: 2px;
}

.cookie-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cookie-toggle__track {
  display: block;
  width: 40px;
  height: 24px;
  background: var(--grey-200);
  border-radius: 999px;
  transition: background-color .15s ease;
}

.cookie-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease;
}

.cookie-toggle input:checked + .cookie-toggle__track { background: var(--green-500); }
.cookie-toggle input:checked ~ .cookie-toggle__thumb { transform: translateX(16px); }
.cookie-toggle input:disabled { cursor: default; }
.cookie-toggle input:disabled + .cookie-toggle__track { background: var(--green-500); opacity: .6; }

.cookie-settings__footer {
  padding: 20px;
  border-top: 1px solid var(--grey-200);
  display: flex;
  gap: 10px;
}

.cookie-settings__footer button {
  flex: 1;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease;
}

#reject-optional-cookies {
  background: var(--grey-100);
  color: var(--grey-800);
}
#reject-optional-cookies:hover { background: var(--grey-200); }

#save-cookie-settings {
  background: var(--green-500);
  color: var(--white);
}
#save-cookie-settings:hover { background: var(--green-600); }
