/* ═══════════════════════════════════════════════
   Cozy Hook Patterns — checkout.css
   Styles the PayPal Smart Buttons checkout UI.
   All classes are prefixed chpp- to avoid conflicts.
═══════════════════════════════════════════════ */

/* ── RESET ── */
#chpp-checkout-wrap *,
#chpp-checkout-wrap *::before,
#chpp-checkout-wrap *::after {
  box-sizing: border-box;
}

/* ── OUTER WRAPPER ── */
#chpp-checkout-wrap {
  background: #F2E8D5;
  padding: 80px 60px 100px;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  width: 100%;
}

/* ── SECTION HEADER ── */
.chpp-header {
  text-align: center;
  margin-bottom: 52px;
}

.chpp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(184, 97, 58, .1);
  border: 1px solid rgba(184, 97, 58, .22);
  color: #B8613A;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.chpp-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 900;
  line-height: 1.06;
  color: #3A2010;
  margin: 0 0 8px;
}

.chpp-header h2 em {
  font-style: italic;
  color: #B8613A;
}

.chpp-header p {
  font-family: Lora, Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: #8A7A6A;
  margin: 0;
}

/* ── TWO-COLUMN GRID ── */
.chpp-grid {
  max-width: 1060px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 30px;
  align-items: start;
}

/* ── FORM CARD ── */
.chpp-form-card {
  background: #fff;
  border: 1px solid #E4D5BC;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 44px rgba(58, 32, 16, .11);
}

.chpp-form-head {
  background: #3A2010;
  padding: 22px 28px;
}

.chpp-form-head h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 700;
  color: #FAF4EB;
  margin: 0 0 4px;
}

.chpp-form-head p {
  font-size: 12px;
  color: rgba(250, 244, 235, .5);
  margin: 0;
}

.chpp-form-body {
  padding: 28px;
}

/* ── FORM FIELDS ── */
.chpp-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.chpp-field {
  margin-bottom: 14px;
}

.chpp-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #8A7A6A;
  margin-bottom: 6px;
}

.chpp-field input,
.chpp-field select {
  width: 100%;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #3A2010;
  background: #fff;
  border: 1.5px solid #E4D5BC;
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}

.chpp-field input:focus,
.chpp-field select:focus {
  border-color: #B8613A;
  box-shadow: 0 0 0 3px rgba(184, 97, 58, .1);
}

.chpp-field input::placeholder {
  color: #C4B4A4;
}

.chpp-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238A7A6A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}

/* ── DIVIDER ── */
.chpp-divider {
  height: 1px;
  background: #E4D5BC;
  margin: 18px 0;
}

/* ── COUPON ── */
.chpp-coupon-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#chpp-coupon-input {
  flex: 1;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #3A2010;
  background: #F2E8D5;
  border: 1.5px solid #E4D5BC;
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s;
  text-transform: uppercase;
  letter-spacing: .05em;
}

#chpp-coupon-input:focus { border-color: #B8613A; }
#chpp-coupon-input::placeholder { color: #C4B4A4; text-transform: none; letter-spacing: 0; }

#chpp-coupon-btn {
  background: #F2E8D5;
  border: 1.5px solid #E4D5BC;
  color: #5C3418;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
#chpp-coupon-btn:hover { background: #E4D5BC; }

.chpp-coupon-msg {
  font-size: 12px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  display: block;
}
.chpp-coupon-msg--success { background: #EAF3DE; color: #27500A; }
.chpp-coupon-msg--error   { background: #FCEBEB; color: #501313; }
.chpp-coupon-msg--        { display: none; }

/* ── CHECKBOXES ── */
.chpp-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 11px;
}

.chpp-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #B8613A;
  cursor: pointer;
}

.chpp-check-row label {
  font-size: 12px;
  color: #8A7A6A;
  line-height: 1.55;
  cursor: pointer;
}

.chpp-check-row label a {
  color: #B8613A;
  text-decoration: none;
}

/* ── FORM ERROR ── */
#chpp-form-error {
  display: none;
  background: #FCEBEB;
  border: 1px solid #F09595;
  color: #501313;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}

/* ── LOADING STATE ── */
#chpp-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  font-size: 14px;
  color: #8A7A6A;
}

.chpp-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #E4D5BC;
  border-top-color: #B8613A;
  border-radius: 50%;
  animation: chppSpin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes chppSpin { to { transform: rotate(360deg); } }

/* ── PAYPAL BUTTONS CONTAINER ── */
#chpp-paypal-buttons {
  margin-top: 4px;
}

.chpp-pp-missing {
  background: #FAEEDA;
  border: 1px solid #FAC775;
  color: #412402;
  font-size: 13px;
  padding: 14px 16px;
  border-radius: 10px;
  line-height: 1.6;
}

.chpp-pp-note {
  text-align: center;
  font-size: 11px;
  color: #C4B4A4;
  margin-top: 10px;
}

/* ── TRUST ROW ── */
.chpp-trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chpp-trust-item {
  font-size: 11px;
  color: #8A7A6A;
}

/* ── SUCCESS SCREEN ── */
#chpp-success {
  display: none;
  text-align: center;
  padding: 48px 32px;
}

.chpp-success-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.chpp-success-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 900;
  font-style: italic;
  color: #3A2010;
  margin-bottom: 12px;
}

.chpp-success-text {
  font-family: Lora, Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: #8A7A6A;
  line-height: 1.7;
  margin-bottom: 8px;
}

.chpp-success-email {
  font-weight: 600;
  color: #B8613A;
  font-style: normal;
}

.chpp-success-order {
  font-size: 12px;
  color: #C4B4A4;
  margin-top: 6px;
}

/* ── ORDER SUMMARY COLUMN ── */
.chpp-summary-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Summary card */
.chpp-sum-card {
  background: #fff;
  border: 1px solid #E4D5BC;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(58, 32, 16, .07);
}

.chpp-sum-head {
  background: #3A2010;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chpp-sum-yarn { font-size: 32px; }

.chpp-sum-badge {
  display: inline-block;
  background: #C49A52;
  color: #3A2010;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 100px;
  margin-bottom: 3px;
}

.chpp-sum-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: #FAF4EB;
  font-style: italic;
}

.chpp-sum-sub {
  font-size: 10px;
  color: rgba(250, 244, 235, .42);
  margin-top: 1px;
}

.chpp-sum-body { padding: 18px 22px; }

.chpp-sum-items {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chpp-sum-items li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #5C3418;
}

.chpp-sum-cnt {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #B8613A;
}

.chpp-sum-cnt-g { color: #6B8C6A; }

.chpp-sum-divider {
  height: 1px;
  background: #E4D5BC;
  margin: 10px 0;
}

.chpp-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
}

.chpp-sum-row-label { color: #8A7A6A; }
.chpp-sum-row-val   { font-weight: 600; color: #3A2010; }
.chpp-sum-row-val.strike { text-decoration: line-through; color: #C4B4A4; font-weight: 400; }
.chpp-sum-row-val.green  { color: #6B8C6A; font-weight: 700; }

.chpp-sum-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 2px solid #E4D5BC;
}

.chpp-sum-total-label {
  font-size: 13px;
  font-weight: 700;
  color: #3A2010;
}

.chpp-sum-total-val {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 900;
  color: #B8613A;
}

/* Guarantee card */
.chpp-guarantee {
  background: #3A2010;
  border-radius: 18px;
  padding: 18px 20px;
}

.chpp-guarantee-icon  { font-size: 26px; margin-bottom: 6px; }

.chpp-guarantee-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  color: #FAF4EB;
  margin-bottom: 5px;
}

.chpp-guarantee-text {
  font-family: Lora, Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(250, 244, 235, .55);
  line-height: 1.6;
  margin: 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */

/* Tablet 769–1024px */
@media (max-width: 1024px) and (min-width: 769px) {
  #chpp-checkout-wrap { padding: 60px 40px 80px; }
  .chpp-grid { grid-template-columns: 1fr 320px; gap: 22px; }
}

/* Mobile <768px */
@media (max-width: 768px) {
  #chpp-checkout-wrap { padding: 48px 18px 64px; }
  .chpp-grid          { grid-template-columns: 1fr; }
  .chpp-row-2         { grid-template-columns: 1fr; }

  .chpp-header h2 { font-size: 28px; }

  .chpp-summary-col {
    flex-direction: column;
  }
}
