/*
 * Drivetel Consent Manager - first-party styles.
 * Reuses the site's existing design tokens (--accent-color, --heading-color,
 * --default-font, --surface-color from assets/css/main.css) with fallbacks
 * so this file has no build-time dependency on main.css load order.
 */

.drivetel-consent-banner,
.drivetel-consent-modal,
.drivetel-consent-overlay {
  box-sizing: border-box;
}

.drivetel-consent-banner *,
.drivetel-consent-modal *,
.drivetel-consent-overlay * {
  box-sizing: border-box;
}

/* ---------- Banner ---------- */

.drivetel-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12000;
  background: var(--surface-color, #ffffff);
  color: var(--default-color, #003152);
  border-top: 1px solid rgba(0, 49, 82, 0.12);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  padding: 1rem;
  font-family: var(--default-font, 'Montserrat', sans-serif);
}

.drivetel-consent-banner[hidden] {
  display: none;
}

.drivetel-consent-banner__inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.drivetel-consent-banner__text {
  flex: 1 1 320px;
  min-width: 0;
}

.drivetel-consent-banner__title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-family: var(--heading-font, 'Montserrat', sans-serif);
  color: var(--heading-color, #003152);
  font-size: 1rem;
}

.drivetel-consent-banner__body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--default-color, #003152);
}

.drivetel-consent-banner__link {
  color: var(--accent-color, #62AD46);
  text-decoration: underline;
  white-space: nowrap;
}

.drivetel-consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 0 0 auto;
}

/* ---------- Buttons ---------- */

.drivetel-consent-btn {
  font-family: var(--default-font, 'Montserrat', sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 50px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.drivetel-consent-btn--primary {
  background-color: var(--accent-color, #62AD46);
  color: #ffffff;
  border-color: var(--accent-color, #62AD46);
}

.drivetel-consent-btn--primary:hover,
.drivetel-consent-btn--primary:focus-visible {
  background-color: #558f3b;
  border-color: #558f3b;
}

.drivetel-consent-btn--outline {
  background-color: transparent;
  color: var(--heading-color, #003152);
  border-color: rgba(0, 49, 82, 0.35);
}

.drivetel-consent-btn--outline:hover,
.drivetel-consent-btn--outline:focus-visible {
  border-color: var(--heading-color, #003152);
}

.drivetel-consent-btn--ghost {
  background-color: transparent;
  color: var(--default-color, #003152);
  border-color: transparent;
  text-decoration: underline;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.drivetel-consent-btn:focus-visible,
.drivetel-consent-modal__close:focus-visible,
.drivetel-consent-switch__input:focus-visible + .drivetel-consent-switch__track {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* ---------- Overlay + Modal ---------- */

.drivetel-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 12010;
  background: rgba(0, 20, 35, 0.55);
}

.drivetel-consent-overlay[hidden],
.drivetel-consent-modal[hidden] {
  display: none;
}

.drivetel-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 12020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: var(--default-font, 'Montserrat', sans-serif);
}

.drivetel-consent-modal__dialog {
  background: var(--surface-color, #ffffff);
  color: var(--default-color, #003152);
  border-radius: 1rem;
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.drivetel-consent-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.drivetel-consent-modal__title {
  margin: 0;
  font-family: var(--heading-font, 'Montserrat', sans-serif);
  color: var(--heading-color, #003152);
  font-size: 1.25rem;
  font-weight: 700;
}

.drivetel-consent-modal__close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--default-color, #003152);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
}

.drivetel-consent-modal__intro {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0.75rem 0 1rem;
}

.drivetel-consent-categories {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drivetel-consent-category {
  border: 1px solid rgba(0, 49, 82, 0.12);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}

.drivetel-consent-category__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drivetel-consent-category__label {
  font-weight: 600;
  color: var(--heading-color, #003152);
  font-size: 0.95rem;
}

.drivetel-consent-category__description {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--default-color, #003152);
}

.drivetel-consent-category__badge {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-color, #62AD46);
}

.drivetel-consent-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ---------- Toggle switch ---------- */

.drivetel-consent-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.drivetel-consent-switch__input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}

.drivetel-consent-switch__input:disabled {
  cursor: not-allowed;
}

.drivetel-consent-switch__track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 49, 82, 0.25);
  display: inline-block;
  position: relative;
  transition: background-color 0.15s ease;
}

.drivetel-consent-switch__track::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.drivetel-consent-switch__input:checked + .drivetel-consent-switch__track {
  background: var(--accent-color, #62AD46);
}

.drivetel-consent-switch__input:checked + .drivetel-consent-switch__track::before {
  transform: translateX(20px);
}

.drivetel-consent-switch__input:disabled + .drivetel-consent-switch__track {
  opacity: 0.6;
}

/* ---------- Blocked embed placeholder (e.g. Google Maps) ---------- */

.drivetel-consent-blocked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem 1rem;
  min-height: 220px;
  background: rgba(0, 49, 82, 0.04);
  border: 1px dashed rgba(0, 49, 82, 0.25);
  border-radius: 0.75rem;
  font-family: var(--default-font, 'Montserrat', sans-serif);
  font-size: 0.875rem;
  color: var(--default-color, #003152);
}

/* ---------- Footer preferences link ---------- */

#drivetel-consent-open-preferences {
  cursor: pointer;
}

/* ---------- Responsive ---------- */

@media (max-width: 576px) {
  .drivetel-consent-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .drivetel-consent-banner__actions {
    justify-content: stretch;
  }

  .drivetel-consent-banner__actions .drivetel-consent-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
