/* ═══════════════════════════════════════════
   COZY HOOK – FREE PATTERN GIFT POPUP v2
   Scroll-triggered · All devices
════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;0,700;1,600&family=Jost:wght@300;400;500;600&display=swap');

/* ══════════════════════════════════════
   MOBILE HIDDEN — Desktop & Tablet only
   Popup is completely disabled on phones
   (screens 767px wide and below)
══════════════════════════════════════ */
@media (max-width: 767px) {
  #chpop-overlay {
    display: none !important;
    pointer-events: none !important;
  }
}

/* ── Overlay ── */
#chpop-overlay {
  position: fixed; inset: 0;
  background: rgba(20,16,12,.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease;
}
#chpop-overlay.chpop-show {
  opacity: 1; pointer-events: all;
}

/* ── Modal ── */
#chpop-modal {
  background: #fff;
  border-radius: 22px;
  width: 100%; max-width: 500px;
  position: relative; overflow: hidden;
  box-shadow: 0 28px 90px rgba(20,16,12,.40);
  transform: scale(.9) translateY(28px);
  opacity: 0;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
}
#chpop-overlay.chpop-show #chpop-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Gradient top strip */
#chpop-modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg,#bf6840,#d4845e,#7a9e7e);
  z-index: 2;
}

/* ── Close ── */
#chpop-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #ede4d6; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #6b5d52; z-index: 10;
  transition: background .2s, color .2s, transform .25s;
  line-height: 1;
}
#chpop-close:hover { background: #bf6840; color: #fff; transform: rotate(90deg); }

/* ── Hero ── */
#chpop-hero {
  background: #f4ece0;
  padding: 38px 34px 26px;
  text-align: center;
  border-bottom: 1px solid #e6d4bc;
  position: relative; overflow: hidden;
}
/* Big faint yarn background decoration */
#chpop-hero::before {
  content: '🧶';
  position: absolute; right: -18px; bottom: -18px;
  font-size: 100px; opacity: .06;
  pointer-events: none;
}
#chpop-hero::after {
  content: '🧶';
  position: absolute; left: -18px; top: -18px;
  font-size: 80px; opacity: .04;
  pointer-events: none; transform: scaleX(-1);
}

.chpop-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(191,104,64,.13); color: #bf6840;
  border: 1px solid rgba(191,104,64,.28); border-radius: 30px;
  padding: 5px 14px;
  font-family: 'Jost',sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  margin-bottom: 14px;
  animation: chpopFloat 2.4s ease-in-out infinite;
}
@keyframes chpopFloat {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.chpop-big-emoji {
  font-size: 58px; display: block; margin-bottom: 10px;
  animation: chpopWiggle 3s ease-in-out infinite;
}
@keyframes chpopWiggle {
  0%,100% { transform: rotate(-6deg) scale(1); }
  50%      { transform: rotate(6deg) scale(1.1); }
}

#chpop-headline {
  font-family: 'Cormorant Garamond',Georgia,serif;
  font-size: 26px; font-weight: 700;
  color: #3d2b1f; line-height: 1.2;
  margin: 0 0 10px;
}
#chpop-subhead {
  font-family: 'Jost',sans-serif;
  font-size: 14px; color: #6b5d52; font-weight: 300; line-height: 1.65;
  margin: 0 0 14px;
}

/* Social proof row */
.chpop-proof {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap;
}
.chpop-chip {
  display: flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid #e6d4bc; border-radius: 20px;
  padding: 4px 11px;
  font-family: 'Jost',sans-serif;
  font-size: 11px; color: #6b5d52; font-weight: 500;
}

/* ── Form body ── */
#chpop-body { padding: 24px 34px 28px; }

.chpop-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chpop-field { margin-bottom: 12px; }
.chpop-field label {
  display: block;
  font-family: 'Jost',sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: #6b5d52; margin-bottom: 5px;
}
.chpop-field input,
.chpop-field select {
  width: 100%; height: 45px; padding: 0 13px;
  border: 1.5px solid #e6d4bc; border-radius: 9px;
  font-family: 'Jost',sans-serif; font-size: 14px;
  color: #3d2b1f; background: #faf5ee;
  outline: none; box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.chpop-field input:focus,
.chpop-field select:focus {
  border-color: #bf6840;
  box-shadow: 0 0 0 3px rgba(191,104,64,.14);
  background: #fff;
}
.chpop-field input::placeholder { color: #a8998c; }

/* ── Error ── */
#chpop-error {
  display: none;
  background: rgba(180,40,40,.08);
  border: 1px solid rgba(180,40,40,.22);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: 'Jost',sans-serif;
  font-size: 12px; color: #9b2c2c; margin-bottom: 12px; line-height: 1.5;
}

/* ── Submit button ── */
#chpop-submit {
  width: 100%; height: 52px;
  background: linear-gradient(135deg,#bf6840,#9e4f28);
  color: #fff; border: none; border-radius: 11px;
  font-family: 'Jost',sans-serif;
  font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 6px 22px rgba(158,79,40,.30);
  transition: all .25s; letter-spacing: .01em;
  margin-top: 4px;
}
#chpop-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(158,79,40,.38);
}
#chpop-submit:active { transform: translateY(0); }
#chpop-submit:disabled { opacity: .7; cursor: not-allowed; }

/* Spinner */
.chpop-spin {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: chpopSpin .65s linear infinite;
  display: inline-block;
}
@keyframes chpopSpin { to { transform: rotate(360deg); } }

/* Privacy */
.chpop-privacy {
  text-align: center;
  font-family: 'Jost',sans-serif;
  font-size: 11px; color: #a8998c; margin-top: 9px; line-height: 1.5;
}
.chpop-privacy a { color: #bf6840; text-decoration: none; }

/* No thanks */
#chpop-nothanks {
  display: block; width: 100%; text-align: center;
  font-family: 'Jost',sans-serif;
  font-size: 12px; color: #a8998c; margin-top: 10px;
  cursor: pointer; background: none; border: none;
  transition: color .2s;
}
#chpop-nothanks:hover { color: #6b5d52; text-decoration: underline; }

/* ══════════════════════════════════════
   SUCCESS SCREEN
══════════════════════════════════════ */
#chpop-success {
  display: none;
  padding: 40px 34px 36px;
  text-align: center;
}

.chpop-success-emoji {
  font-size: 66px; display: block; margin-bottom: 12px;
  animation: chpopPop .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes chpopPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.chpop-success-title {
  font-family: 'Cormorant Garamond',Georgia,serif;
  font-size: 28px; font-weight: 700; color: #3d2b1f;
  margin-bottom: 8px;
}
.chpop-success-body {
  font-family: 'Jost',sans-serif;
  font-size: 14px; color: #6b5d52; font-weight: 300;
  line-height: 1.7; margin-bottom: 20px;
}

/* Download button */
#chpop-download-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg,#5c7a5e,#7a9e7e);
  color: #fff; border-radius: 10px; padding: 14px 28px;
  font-family: 'Jost',sans-serif; font-weight: 600; font-size: 14px;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 6px 18px rgba(92,122,94,.28);
  transition: all .2s; margin-bottom: 10px;
}
#chpop-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(92,122,94,.36);
  color: #fff;
}

/* Coupon box */
.chpop-coupon-box {
  background: #f4ece0;
  border: 2px dashed #bf6840;
  border-radius: 12px; padding: 16px 18px;
  margin: 14px 0;
}
.chpop-coupon-label {
  font-family: 'Jost',sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: #6b5d52; margin-bottom: 5px;
}
.chpop-coupon-code {
  font-family: 'Cormorant Garamond',Georgia,serif;
  font-size: 34px; font-weight: 700;
  color: #bf6840; letter-spacing: .05em; display: block;
}
.chpop-coupon-note {
  font-family: 'Jost',sans-serif;
  font-size: 12px; color: #6b5d52; margin-top: 4px;
}

#chpop-close-success {
  display: block; background: none; border: none;
  font-family: 'Jost',sans-serif;
  font-size: 12px; color: #a8998c;
  cursor: pointer; margin: 8px auto 0; text-decoration: underline;
}
#chpop-close-success:hover { color: #6b5d52; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 520px) {
  #chpop-hero   { padding: 30px 20px 22px; }
  #chpop-body   { padding: 20px 20px 24px; }
  #chpop-success{ padding: 30px 20px 28px; }
  #chpop-headline { font-size: 22px; }
  .chpop-big-emoji { font-size: 46px; }
  .chpop-row2   { grid-template-columns: 1fr; }
  .chpop-success-title { font-size: 24px; }
  .chpop-coupon-code   { font-size: 28px; }
  #chpop-modal  { border-radius: 16px; }
}
@media (max-width: 360px) {
  .chpop-proof  { flex-direction: column; gap: 6px; }
}
