/* ===== Overlay ===== */
#cpg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 999999;
}

#cpg-overlay.cpg-show {
  display: block;
}

.cpg-hidden {
  display: none;
}

/* ===== Modal ===== */
.cpg-modal {
  max-width: 520px;
  width: calc(100% - 32px);
  margin: 7vh auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .25);
  position: relative;
  overflow: hidden;
  animation: cpg-pop .25s ease-out;
}

@keyframes cpg-pop {
  from {
    transform: translateY(8px) scale(.98);
    opacity: .0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.cpg-body {
  padding: 40px 26px 70px;
}

/* ===== Close button ===== */
.cpg-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: var(--brand-color-v4);
  color: #222;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  transition: transform .12s ease, filter .2s ease;
}

.cpg-close:hover {
  transform: scale(1.05);
  filter: brightness(1.02);
}

/* ===== Header / Title ===== */
.cpg-head {
  text-align: center;
  margin-bottom: 14px;
}

.cpg-head img {
  max-width: 120px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}

.cpg-title {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
  color: #1b2737;
  text-align: left;
  letter-spacing: .1px;
  font-family: var(--Montserrat-family);
}

/* ===== Code + Copy group ===== */
.cpg-codewrap {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin: 18px auto 8px;
  gap: 0;
  max-width: 360px;
}

.cpg-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding: 12px 16px;
  min-width: 140px;
  border: 2px dashed #e0e0e0;
  border-right: none;
  background: #fafafa;
  color: #222;
  font-weight: 800;
  font-size: 18px;
  text-align: center;
  border-radius: 10px 0 0 10px;
}

.cpg-copy {
  padding: 12px 16px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .4px;
  background-color: var(--brand-color-v4);
  color: #1b2737;
  border-radius: 0 10px 10px 0;
  box-shadow: 0 6px 18px rgba(255, 211, 77, .35) inset, 0 2px 10px rgba(0, 0, 0, .06);
  transition: transform .08s ease, filter .2s ease, box-shadow .2s ease;
  font-family: var(--Montserrat-family);
}

.cpg-copy:hover {
  filter: brightness(1.03);
}

.cpg-copy:active {
  transform: translateY(1px);
}

/* little helper text under code */
.cpg-note {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
  font-family: var(--Montserrat-family);
  font-weight: 500;
}

/* ===== CTA ===== */
.cpg-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.cpg-gostore {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 10px;
  background: #1b2737;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(27, 39, 55, .25);
  transition: transform .08s ease, filter .2s ease;
  font-family: var(--Montserrat-family);
}

.cpg-gostore:hover {
  filter: brightness(1.05);
}

.cpg-gostore:active {
  transform: translateY(1px);
}

.cpg-more {
  opacity: .7;
  font-size: 13px;
}

/* ===== Copies counter ===== */
.cpg-copies {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: var(--myshadow);
  font-family: var(--Montserrat-family);
}

#cpg-copies-num {
  font-weight: 800;
  color: #111827;
}

/* ===== Divider & footer (optional) ===== */
.cpg-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #eee, transparent);
  margin: 18px 0 12px;
}

.cpg-footer {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

.cpg-footer a {
  color: #111827;
  font-weight: 700;
  text-decoration: none;
}

.cpg-footer a:hover {
  text-decoration: underline;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 420px) {
  .cpg-modal {
    border-radius: 16px;
  }

  .cpg-body {
    padding: 22px 18px 26px;
  }

  .cpg-title {
    font-size: 18px;
  }

  .cpg-code {
    font-size: 16px;
    min-width: 120px;
  }

  .cpg-copy {
    font-size: 12px;
    padding: 10px 14px;
  }

  .cpg-gostore {
    padding: 10px 18px;
  }
}

a.cpg-gostore {
  color: white !important;
}