/* PD Consent Mode – banner styles */

/* Reset & base */
#pdcm-banner,
#pdcm-banner * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* -------------------------------------------------------------------------
   Banner positioning
   ------------------------------------------------------------------------- */
#pdcm-banner {
  position: fixed;
  z-index: 99999;
  width: 100%;
  left: 0;
  bottom: 0;
  background: #ffffff;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Show state – JS removes [hidden] and adds .pdcm-visible */
#pdcm-banner.pdcm-visible {
  transform: translateY(0);
}

/* Bottom-right corner variant */
#pdcm-banner.pdcm-position-bottom-right {
  width: 380px;
  max-width: calc(100vw - 32px);
  left: auto;
  right: 16px;
  bottom: 16px;
  border-radius: 12px;
}

/* -------------------------------------------------------------------------
   Inner container
   ------------------------------------------------------------------------- */
.pdcm-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px;
}

#pdcm-banner.pdcm-position-bottom-right .pdcm-banner__inner {
  max-width: 100%;
  padding: 20px;
}

/* -------------------------------------------------------------------------
   Content
   ------------------------------------------------------------------------- */
.pdcm-banner__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.pdcm-banner__body {
  margin: 0 0 16px;
  color: #444;
}

/* -------------------------------------------------------------------------
   Action buttons row
   ------------------------------------------------------------------------- */
.pdcm-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.pdcm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

/* Primary – dark fill */
.pdcm-btn--primary {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
}

.pdcm-btn--primary:hover,
.pdcm-btn--primary:focus {
  background: #333;
  border-color: #333;
  outline: none;
}

/* Outline – reject */
.pdcm-btn--outline {
  background: transparent;
  color: #1a1a1a;
  border-color: #1a1a1a;
}

.pdcm-btn--outline:hover,
.pdcm-btn--outline:focus {
  background: #f5f5f5;
  outline: none;
}

/* Ghost – manage preferences */
.pdcm-btn--ghost {
  background: transparent;
  color: #555;
  border-color: transparent;
  padding-left: 4px;
  padding-right: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pdcm-btn--ghost:hover,
.pdcm-btn--ghost:focus {
  color: #1a1a1a;
  outline: none;
}

/* -------------------------------------------------------------------------
   Preferences panel
   ------------------------------------------------------------------------- */
.pdcm-preferences {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e5;
}

.pdcm-preferences__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.pdcm-preferences__footer {
  display: flex;
  justify-content: flex-end;
}

/* Toggle row */
.pdcm-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

/* Hide native checkbox */
.pdcm-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom track */
.pdcm-toggle__track {
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  transition: background 0.2s;
  margin-top: 2px;
}

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

.pdcm-toggle input[type="checkbox"]:checked + .pdcm-toggle__track {
  background: #1a1a1a;
}

.pdcm-toggle input[type="checkbox"]:checked + .pdcm-toggle__track::after {
  transform: translateX(18px);
}

.pdcm-toggle input[type="checkbox"]:focus-visible + .pdcm-toggle__track {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

/* Toggle label text */
.pdcm-toggle__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #1a1a1a;
}

.pdcm-toggle__label strong {
  font-size: 13px;
}

.pdcm-toggle__label span {
  font-size: 12px;
  color: #666;
}

/* -------------------------------------------------------------------------
   Banner footer (privacy policy link)
   ------------------------------------------------------------------------- */
.pdcm-banner__footer {
  margin-top: 12px;
  font-size: 12px;
}

.pdcm-banner__footer a {
  color: #555;
  text-decoration: underline;
}

.pdcm-banner__footer a:hover {
  color: #1a1a1a;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .pdcm-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pdcm-btn {
    width: 100%;
    justify-content: center;
  }

  .pdcm-preferences__grid {
    grid-template-columns: 1fr;
  }

  #pdcm-banner.pdcm-position-bottom-right {
    width: 100%;
    right: 0;
    bottom: 0;
    border-radius: 12px 12px 0 0;
  }
}
