/* ════════════════════════════════════════════════════════════════
   HORNS & HERITAGE — Detail popups (Shop + Cattle) & cart row upgrade
   Additive only. Inherits brand tokens from the page :root.
   ════════════════════════════════════════════════════════════════ */

/* ---------- Overlay + shell ---------- */
.hh-modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(35, 28, 18, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.hh-modal-overlay.open { opacity: 1; pointer-events: auto; }

.hh-modal {
  position: relative;
  width: min(940px, 100%);
  max-height: min(90vh, 760px);
  background: var(--bg-card, #fff);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(35, 28, 18, 0.35), 0 4px 14px rgba(35, 28, 18, 0.18);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  transform: translateY(14px) scale(.965);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2,.9,.3,1.2), opacity .26s ease;
}
.hh-modal-overlay.open .hh-modal { transform: translateY(0) scale(1); opacity: 1; }

/* Close button */
.hh-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(253, 248, 240, 0.92);
  color: var(--text-primary, #3D2A1A);
  box-shadow: 0 2px 8px rgba(35, 28, 18, 0.18);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.hh-modal-close:hover { background: #fff; transform: rotate(90deg); }
.hh-modal-close svg { width: 18px; height: 18px; }

/* ---------- Media column ---------- */
.hh-modal-media {
  position: relative;
  background: var(--bg-alt, #F0E6D8);
  min-height: 280px;
}
.hh-modal-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.hh-modal-media .hh-media-tag {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  font-family: var(--sans, sans-serif);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(45, 74, 58, 0.86);
  color: var(--cream, #FEF3D6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* ---------- Body column ---------- */
.hh-modal-body {
  padding: clamp(24px, 3.4vw, 40px);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.hh-modal-body::-webkit-scrollbar { width: 8px; }
.hh-modal-body::-webkit-scrollbar-thumb { background: var(--border-soft, #E8DDD0); border-radius: 8px; }

.hh-modal-eyebrow {
  font-family: var(--sans, sans-serif);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dark, #B8891A);
  margin-bottom: 10px;
}
.hh-modal-title {
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 600; line-height: 1.08;
  color: var(--text-primary, #3D2A1A);
  letter-spacing: -0.01em;
}
.hh-modal-desc {
  margin-top: 14px;
  font-family: var(--sans, sans-serif);
  font-size: 0.98rem; line-height: 1.62;
  color: var(--text-secondary, #6B5744);
}

/* Price block (product) */
.hh-modal-price {
  margin-top: 22px; padding-top: 20px;
  border-top: 1px solid var(--border-soft, #E8DDD0);
  font-family: var(--serif, serif);
  font-size: 1.7rem; font-weight: 600;
  color: var(--terracotta, #C9714C);
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.hh-modal-price small {
  font-family: var(--sans, sans-serif);
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-muted, #9B8A77);
}

/* Quantity + add row */
.hh-modal-buy {
  margin-top: 22px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.hh-qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-soft, #E8DDD0);
  border-radius: 999px; overflow: hidden;
  background: var(--bg-main, #FDF8F0);
}
.hh-qty button {
  width: 42px; height: 46px;
  background: transparent; border: none; cursor: pointer;
  font-size: 1.3rem; line-height: 1;
  color: var(--text-primary, #3D2A1A);
  transition: background .15s;
}
.hh-qty button:hover { background: var(--bg-alt, #F0E6D8); }
.hh-qty button:disabled { opacity: .35; cursor: not-allowed; }
.hh-qty .hh-qty-val {
  min-width: 46px; text-align: center;
  font-family: var(--sans, sans-serif);
  font-size: 1.05rem; font-weight: 700;
  color: var(--text-primary, #3D2A1A);
}

.hh-modal-add {
  flex: 1 1 200px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  border: none; border-radius: 999px; cursor: pointer;
  background: var(--primary-green, #2D6A4F);
  color: var(--cream, #FEF3D6);
  font-family: var(--sans, sans-serif);
  font-size: 0.98rem; font-weight: 600;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.hh-modal-add:hover { background: #1B4D3E; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(45,106,79,.28); }
.hh-modal-add:active { transform: translateY(0); }
.hh-modal-add.added { background: var(--gold, #D4A02B); color: var(--text-primary, #3D2A1A); }
.hh-modal-add svg { width: 18px; height: 18px; }

.hh-modal-note {
  margin-top: 14px;
  font-family: var(--sans, sans-serif);
  font-size: 0.78rem; color: var(--text-muted, #9B8A77);
}

/* ---------- Cattle: heritage story + spec sheet ---------- */
.hh-story {
  margin-top: 16px;
  font-family: var(--serif, serif);
  font-style: italic;
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  line-height: 1.5;
  color: var(--text-secondary, #6B5744);
  padding-left: 16px;
  border-left: 3px solid var(--gold, #D4A02B);
}
.hh-specs {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border-soft, #E8DDD0);
  display: flex; flex-direction: column; gap: 1px;
}
.hh-spec {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft, #E8DDD0);
}
.hh-spec:last-child { border-bottom: none; }
.hh-spec .hh-spec-label {
  font-family: var(--sans, sans-serif);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-muted, #9B8A77);
}
.hh-spec .hh-spec-val {
  font-family: var(--sans, sans-serif);
  font-size: 0.92rem; font-weight: 600;
  color: var(--text-primary, #3D2A1A);
  text-align: right;
}
.hh-spec .hh-spec-val.ok { color: var(--primary-green, #2D6A4F); }
.hh-spec .hh-spec-val.ok::before {
  content: "✓ "; font-weight: 700;
}

.hh-wa {
  margin-top: 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px;
  border-radius: 999px;
  background: #1FA855; color: #fff;
  font-family: var(--sans, sans-serif);
  font-size: 1rem; font-weight: 600;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.hh-wa:hover { background: #178A45; color: #fff; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(31,168,85,.3); }
.hh-wa svg { width: 20px; height: 20px; }

/* ---------- Clickable affordance on cards ---------- */
#shop .product-card,
#cattle .product-card { cursor: pointer; }

/* ---------- Cart row upgrade: hover highlight + trash icon ---------- */
.cart-item {
  border-radius: 12px;
  padding: 8px;
  margin: 0 -8px;
  transition: background .18s, box-shadow .18s;
}
.cart-item:hover {
  background: var(--bg-secondary, #F5EDE0);
  box-shadow: inset 0 0 0 1px rgba(212,160,43,.45);
}
.ci-remove.is-trash {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--text-muted, #9B8A77);
  padding: 0;
  transition: color .18s, background .18s;
}
.ci-remove.is-trash svg { width: 17px; height: 17px; }
.ci-remove.is-trash:hover { color: var(--rust, #B8512C); background: rgba(184,81,44,.1); }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .hh-modal {
    grid-template-columns: 1fr;
    max-height: 92vh;
  }
  .hh-modal-media { min-height: 200px; max-height: 38vh; }
  .hh-modal-media img { position: relative; height: 100%; }
  .hh-modal-body { padding: 22px 20px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .hh-modal-overlay, .hh-modal { transition: opacity .15s; }
  .hh-modal { transform: none; }
  .hh-modal-close:hover { transform: none; }
}
