/*!
 * CPCM banner — visual port of the CookieYes notice box (box layout),
 * renamed to the cpcm- prefix. Colors come from CSS custom properties set
 * inline from plugin settings:
 *   --cpcm-bg      box background        (default #ffffff)
 *   --cpcm-text    title/description     (default #212121)
 *   --cpcm-accent  buttons and links     (default #1863dc)
 *   --cpcm-border  box border            (default #f4f4f4)
 */

.cpcm-hide {
  display: none !important;
}

.cpcm-consent-container {
  position: fixed;
  width: 440px;
  box-sizing: border-box;
  z-index: 9999999;
  border-radius: 6px;
}

.cpcm-consent-container * {
  box-sizing: border-box;
}

.cpcm-box-bottom-left {
  bottom: 20px;
  left: 20px;
}
.cpcm-box-bottom-right {
  bottom: 20px;
  right: 20px;
}

.cpcm-consent-container .cpcm-consent-bar {
  background: var(--cpcm-bg, #ffffff);
  border: 1px solid var(--cpcm-border, #f4f4f4);
  box-shadow: 0 -1px 10px 0 #acabab4d;
  border-radius: 6px;
}

.cpcm-consent-bar .cpcm-notice-content-wrapper {
  padding: 24px;
}

.cpcm-notice .cpcm-title {
  color: var(--cpcm-text, #212121);
  font-weight: 700;
  font-size: 18px;
  line-height: 24px;
  margin: 0 0 12px 0;
  word-break: break-word;
}

.cpcm-notice-des {
  color: var(--cpcm-text, #212121);
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
  white-space: pre-line; /* honor newlines from the banner-text setting */
}

.cpcm-notice-des a {
  color: var(--cpcm-accent, #1863dc);
  text-decoration: underline;
  background: transparent;
}

.cpcm-notice-btn-wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.cpcm-btn {
  flex: auto;
  max-width: 100%;
  font-size: 14px;
  font-family: inherit;
  line-height: 24px;
  padding: 8px;
  font-weight: 500;
  margin: 0;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  min-height: 0;
  overflow-wrap: break-word;
  text-shadow: none;
  box-shadow: none;
}

.cpcm-btn:hover {
  opacity: 0.8;
}

.cpcm-btn-optout {
  color: var(--cpcm-accent, #1863dc);
  background: transparent;
  border: 2px solid var(--cpcm-accent, #1863dc);
}

.cpcm-btn-accept {
  background: var(--cpcm-accent, #1863dc);
  color: #ffffff;
  border: 2px solid var(--cpcm-accent, #1863dc);
}

.cpcm-btn:focus-visible,
.cpcm-notice-des a:focus-visible,
.cpcm-preferences-link:focus-visible,
.cpcm-footer-link:focus-visible {
  outline: 2px solid var(--cpcm-accent, #1863dc);
  outline-offset: 2px;
}

/* Reopen links (footer auto-inject + shortcode) */
.cpcm-footer-link-wrapper {
  text-align: center;
  padding: 8px 0;
}

.cpcm-footer-link,
.cpcm-preferences-link {
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

/* Screen-reader-only live region */
.cpcm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- CookieYes responsive behavior, ported verbatim --- */

@media (max-width: 576px) {
  .cpcm-box-bottom-left {
    bottom: 10px;
    left: 10px;
  }
  .cpcm-box-bottom-right {
    bottom: 10px;
    left: 10px;
  }
}

@media (max-width: 440px) {
  .cpcm-box-bottom-left {
    bottom: 0;
    left: 0;
  }
  .cpcm-box-bottom-right {
    bottom: 0;
    left: 0;
  }

  .cpcm-consent-container {
    width: 100%;
    max-width: 100%;
  }
  .cpcm-consent-container .cpcm-consent-bar .cpcm-notice-content-wrapper {
    padding: 24px 0 12px 0;
  }
  .cpcm-notice .cpcm-title,
  .cpcm-notice-des,
  .cpcm-notice-btn-wrapper {
    padding-left: 24px;
    padding-right: 24px;
  }
  .cpcm-notice-des {
    max-height: 40vh;
    overflow-y: auto;
  }
  .cpcm-notice-btn-wrapper {
    gap: 10px;
    flex-direction: column;
    margin-top: 0;
  }
  .cpcm-btn {
    width: 100%;
    margin: 10px 0 0 0;
  }
  .cpcm-notice-btn-wrapper .cpcm-btn-accept {
    order: 1;
    margin-top: 16px;
  }
  .cpcm-notice-btn-wrapper .cpcm-btn-optout {
    order: 2;
  }
}

@media (max-width: 352px) {
  .cpcm-notice .cpcm-title {
    font-size: 16px;
  }
  .cpcm-notice-des,
  .cpcm-btn {
    font-size: 12px;
  }
}

@media (max-height: 480px) {
  .cpcm-consent-container {
    max-height: 100vh;
    overflow-y: auto;
  }
  .cpcm-notice-des {
    max-height: unset;
    overflow-y: unset;
  }
}

@media (min-width: 576px) and (max-height: 660px) {
  .cpcm-notice-des {
    max-height: 40vh;
    overflow-y: auto;
  }
}
