/* ==========================================================================
   Ag Scoop - deal popup / code-reveal modal
   Two deal types:
     data-deal-type="direct"  → instant click-through (no modal)
     data-deal-type="code"    → opens this modal with a copyable promo code
   Styled to match the crate/paper/green system. No inline handlers (CSP-safe).
   ========================================================================== */

.deal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 30, 21, 0.35);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 300;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.deal-modal-overlay.is-open { display: flex; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .deal-modal-overlay { transition: none; }
}

.deal-modal {
  background: var(--paper);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(34, 30, 21, 0.3);
  overflow: hidden;
  transform: translateY(8px);
  transition: transform 0.16s ease;
}
.deal-modal-overlay.is-open .deal-modal { transform: translateY(0); }

/* Crate-style header band carries the deal's category colour */
.deal-modal-head {
  position: relative;
  padding: 22px 24px;
  display: flex;
  align-items: flex-end;
  min-height: 88px;
  color: #fff;
  background: var(--green);
}
.deal-modal-head.c-green  { background: var(--green); color: #f2efe2; }
.deal-modal-head.c-wheat  { background: var(--wheat); color: #3d2f10; }
.deal-modal-head.c-clay   { background: var(--clay); color: #f6e8de; }
.deal-modal-head.c-olive  { background: #6b6f3f; color: #f1f0dd; }
.deal-modal-head.c-bark   { background: #5a4632; color: #efe6d6; }
.deal-modal-head.c-slate  { background: #4c5a5e; color: #e8edec; }
.deal-modal-head.c-straw  { background: #c8b272; color: #3c3214; }
.deal-modal-head.c-ironbark { background: #3a3128; color: #e9e2d3; }

.deal-modal-meta {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 2px;
}
.deal-modal-title {
  font-family: 'Archivo', sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.deal-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deal-modal-close:hover { background: #fff; }

.deal-modal-body { padding: 24px; }

.deal-modal-desc {
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 20px;
}

.deal-modal-pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 20px;
}
.deal-modal-price { font-family: 'Archivo', sans-serif; font-size: 26px; font-weight: 800; }
.deal-modal-was { font-size: 15px; color: var(--ink-3); text-decoration: line-through; }
.deal-modal-save {
  margin-left: auto;
  font-family: 'Archivo', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--green);
  background: var(--green-tint);
  padding: 5px 11px;
  border-radius: 99px;
}

/* Code box */
.deal-code-label {
  font-family: 'Archivo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.deal-code-box {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.deal-code-value {
  flex: 1;
  font-family: 'Archivo', sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding: 14px 16px;
  background: #fff;
  display: flex;
  align-items: center;
  user-select: all;
}
.deal-code-copy {
  border: none;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Archivo', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.deal-code-copy:hover { background: var(--green-deep); }
.deal-code-copy.copied { background: var(--green); }

.deal-modal-visit { width: 100%; }

.deal-modal-fine {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
  margin-top: 16px;
}

/* Affiliate disclosure line shown in every modal footer */
.deal-modal-disclosure {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
