/* XPENG cookie consent — banner + settings modal */

.xp-cc-banner,
.xp-cc-modal-overlay {
  display: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  line-height: 1.5;
}

.xp-cc-banner.is-open,
.xp-cc-modal-overlay.is-open {
  display: block;
}

/* ---------- Bottom banner (first-visit prompt) ---------- */

.xp-cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid #e3e3e3;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
  padding: 18px 20px;
  z-index: 2147483000;
}

.xp-cc-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.xp-cc-banner__text {
  flex: 1 1 340px;
  font-size: 14px;
  color: #333;
}

.xp-cc-banner__text a {
  color: #1a6dde;
  text-decoration: underline;
}

.xp-cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* ---------- Modal overlay (detailed settings) ---------- */

.xp-cc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2147483001;
  padding: 24px;
  overflow-y: auto;
}

.xp-cc-modal {
  background: #ffffff;
  max-width: 760px;
  margin: 40px auto;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.xp-cc-modal__body {
  padding: 28px 32px 20px;
  font-size: 14px;
  color: #333;
}

.xp-cc-modal__body p {
  margin: 0 0 14px;
}

.xp-cc-modal__body a {
  color: #1a6dde;
  text-decoration: underline;
}

/* ---------- Preference rows ---------- */

.xp-cc-prefs {
  margin-top: 10px;
  border: 1px solid #e3e3e3;
  border-radius: 6px;
  overflow: hidden;
  background: #fafafa;
}

.xp-cc-pref {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #ececec;
}

.xp-cc-pref:last-child {
  border-bottom: 0;
}

.xp-cc-pref__label {
  font-weight: 600;
  font-size: 14px;
  color: #222;
}

.xp-cc-pref__always {
  color: #1a6dde;
  font-weight: 600;
  font-size: 13px;
}

/* iOS-style toggle */
.xp-cc-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.xp-cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.xp-cc-toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cfd4db;
  transition: background 0.2s ease;
  border-radius: 24px;
}

.xp-cc-toggle__slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  transition: transform 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.xp-cc-toggle input:checked + .xp-cc-toggle__slider {
  background: #2f7df4;
}

.xp-cc-toggle input:checked + .xp-cc-toggle__slider::before {
  transform: translateX(20px);
}

.xp-cc-toggle input:focus-visible + .xp-cc-toggle__slider {
  outline: 2px solid #1a6dde;
  outline-offset: 2px;
}

/* ---------- Footer buttons ---------- */

.xp-cc-modal__footer {
  padding: 18px 32px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #ececec;
}

.xp-cc-btn {
  display: inline-block;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
  line-height: 1.2;
  white-space: nowrap;
}

.xp-cc-btn--primary {
  background: #9acb3b;
  color: #1a1a1a;
  border-color: #9acb3b;
}

.xp-cc-btn--primary:hover {
  filter: brightness(0.95);
}

.xp-cc-btn--dark {
  background: #111;
  color: #fff;
  border-color: #111;
}

.xp-cc-btn--dark:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
}

.xp-cc-btn--outline {
  background: #fff;
  color: #111;
  border-color: #111;
}

.xp-cc-btn--outline:hover {
  background: #f3f3f3;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .xp-cc-banner__inner,
  .xp-cc-modal__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .xp-cc-banner__actions .xp-cc-btn,
  .xp-cc-modal__footer .xp-cc-btn {
    width: 100%;
    text-align: center;
  }

  .xp-cc-modal__body {
    padding: 22px 20px 14px;
  }

  .xp-cc-modal__footer {
    padding: 16px 20px 20px;
  }

  .xp-cc-pref {
    padding: 14px 16px;
  }
}
