/* ===========================================================================
   hh-2026-fixes.css — July 2026 fixes (ADDITIVE, loaded last so it wins)
   ---------------------------------------------------------------------------
   1) Buy & Sell Cattle popup: scrollable content, sticky head/foot, visible
      styled scrollbar.
   2) Phone-view responsiveness: fluid clamp() typography + per-width tiers,
      menu bar fit, ≥44px touch targets, no horizontal scroll. Desktop (≥768px)
      is untouched.
   3) Chat bot: minimize (—) and close (✕) buttons forced white.
   4) Video Gallery slideshow (hhg-*) styles + blurred empty placeholder.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1) POPUPS — scrollable content
   --------------------------------------------------------------------------- */
/* Buy & Sell Cattle / Shop detail popup (hh-popups.js) */
.hh-modal-body {
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-green, #2D6A4F) var(--bg-alt, #F0E6D8);
}
.hh-modal-body::-webkit-scrollbar { width: 10px; }
.hh-modal-body::-webkit-scrollbar-track { background: var(--bg-alt, #F0E6D8); border-radius: 8px; }
.hh-modal-body::-webkit-scrollbar-thumb { background: var(--primary-green, #2D6A4F); border-radius: 8px; border: 2px solid var(--bg-alt, #F0E6D8); }
/* Header (eyebrow + title) stays pinned while the body scrolls */
.hh-modal-body > .hh-modal-eyebrow {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg-card, #fff);
  padding-top: 4px; margin-top: -4px;
}
.hh-modal-body > .hh-modal-title {
  position: sticky; top: 20px; z-index: 3;
  background: var(--bg-card, #fff);
  box-shadow: 0 8px 8px -8px rgba(35, 28, 18, .12);
}
/* Footer (qty + Add to Cart) stays pinned at the bottom */
.hh-modal-body > .hh-modal-buy {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--bg-card, #fff);
  padding-bottom: 8px;
  box-shadow: 0 -10px 10px -10px rgba(35, 28, 18, .18);
}

/* Cattle auction detail popup (hh-cattle.js) — same treatment */
.hhc-modal-scroll {
  max-height: 70vh;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-green, #2D6A4F) var(--bg-alt, #F0E6D8);
}
.hhc-modal-scroll::-webkit-scrollbar { width: 10px; }
.hhc-modal-scroll::-webkit-scrollbar-track { background: var(--bg-alt, #F0E6D8); border-radius: 8px; }
.hhc-modal-scroll::-webkit-scrollbar-thumb { background: var(--primary-green, #2D6A4F); border-radius: 8px; border: 2px solid var(--bg-alt, #F0E6D8); }
.hhc-modal-scroll .hhc-modal-name {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg-card, #fff);
  box-shadow: 0 8px 8px -8px rgba(35, 28, 18, .12);
}
/* .hhc-modal-foot is already outside the scroll area, so it is naturally fixed */

/* ---------------------------------------------------------------------------
   2) PHONE VIEW — fluid type, menu fit, touch targets (<768px ONLY)
   --------------------------------------------------------------------------- */
/* Width tiers (rem-based scaling: most site sizes are in rem) */
@media (max-width: 374px) { html { font-size: 87.5%; } }               /* ~12–13% smaller */
@media (min-width: 429px) and (max-width: 767px) { html { font-size: 106%; } }

@media (max-width: 767px) {
  html, body { overflow-x: hidden; max-width: 100vw; }

  /* Fluid typography */
  body, .hero p.lede, p, li, .desc, .btn { font-size: clamp(14px, 3vw, 18px); }
  h1, h2, h3, .hh-modal-title, .hhc-modal-name, .section-head h2 {
    font-size: clamp(18px, 5vw, 32px) !important;
    line-height: 1.2 !important;
    overflow-wrap: break-word;
  }
  small, .eyebrow, .tag, label, .f-contact, .footer-bot, .mng-hint,
  .hh-modal-eyebrow, .hh-modal-note, .price small, .rating {
    font-size: clamp(12px, 2.5vw, 16px);
  }

  /* Never overflow the viewport */
  img, video, iframe, svg, .container, section, .product-card { max-width: 100%; }
  img, video { height: auto; }

  /* Tighter spacing to maximise content space */
  .container { padding-left: 16px; padding-right: 16px; }
  .section { padding: 44px 0; }
  .section-head { margin-bottom: 28px; gap: 16px; }

  /* Menu bar: brand visible, hamburger + icons comfortably tappable */
  .nav-inner { gap: 10px; min-height: 60px; flex-wrap: nowrap; }
  .nav-inner .brand { flex-shrink: 0; min-width: 0; }
  .nav-inner .brand-logo { width: 44px; height: 44px; }
  .hamburger, .nav-cta button, .nav-cta a, .chat-fab,
  .mobile-sheet .panel summary, .mobile-sheet .panel a {
    min-height: 44px; min-width: 44px;
  }
  .mobile-sheet .panel summary, .mobile-sheet .panel a { display: flex; align-items: center; }
  .btn, .qbtn, .tab { min-height: 44px; }

  /* Chat widget fits small screens */
  .chat-widget { width: min(340px, calc(100vw - 24px)); right: 12px; }

  /* Popups fill small screens sensibly */
  .hh-modal-body, .hhc-modal-scroll { max-height: 62vh; }
}

/* ---------------------------------------------------------------------------
   3) CHAT BOT — minimize / close buttons WHITE and visible
   --------------------------------------------------------------------------- */
html body .chat-header button,
html body .chat-header #chatMin,
html body .chat-header #chatClose {
  color: #FFFFFF !important;
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 1 !important;
}
html body .chat-header #chatMin:hover,
html body .chat-header #chatClose:hover {
  color: #FFFFFF !important;
  background: rgba(255, 255, 255, .22) !important;
}

/* ---------------------------------------------------------------------------
   4) VIDEO GALLERY — slideshow (rendered by hh-gallery.js)
   --------------------------------------------------------------------------- */
.hhg-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #10150F;
  box-shadow: var(--shadow-card, 0 10px 30px rgba(0,0,0,.15));
  aspect-ratio: 16 / 9;
  max-height: 540px;
}
.hhg-track { position: absolute; inset: 0; }
.hhg-slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .6s ease;
}
.hhg-slide.is-active { opacity: 1; pointer-events: auto; }
.hhg-slide img, .hhg-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hhg-slide .hhg-media-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-green, #2D6A4F), #1B4D3E);
  color: var(--cream, #F4F7F3);
  font-family: var(--serif, Georgia, serif);
  font-size: 1.3rem; padding: 24px; text-align: center;
}
.hhg-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 48px 20px 16px;
  background: linear-gradient(to top, rgba(10, 14, 10, .82), rgba(10, 14, 10, 0));
  color: #fff;
}
.hhg-caption strong {
  display: block;
  font-family: var(--serif, Georgia, serif);
  font-size: 1.15rem;
}
.hhg-caption span { display: block; font-size: .85rem; opacity: .85; margin-top: 2px; }
.hhg-featured {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--gold, #D4A02B); color: #3D2A1A;
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.hhg-watch {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: .8rem; font-weight: 600;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .35);
  text-decoration: none;
}
.hhg-watch:hover { background: rgba(0, 0, 0, .75); }

.hhg-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .85); color: var(--primary-green, #2D6A4F);
  display: grid; place-items: center; font-size: 1.15rem; line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
  transition: background .2s, transform .2s;
}
.hhg-arrow:hover { background: #fff; }
.hhg-prev { left: 12px; }
.hhg-next { right: 12px; }

.hhg-dots {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: 3;
  display: flex; justify-content: center; gap: 8px;
  padding: 6px;
}
.hhg-dot {
  width: 10px; height: 10px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .45); padding: 0;
  transition: background .2s, transform .2s;
}
.hhg-dot.is-active { background: var(--gold, #D4A02B); transform: scale(1.25); }
/* generous invisible hit area for dots on touch */
.hhg-dot::after { content: ''; display: block; margin: -12px; padding: 12px; }

/* Empty state — blurred placeholder */
.hhg-empty { position: relative; }
.hhg-empty-bg {
  position: absolute; inset: -20px;
  background:
    radial-gradient(60% 80% at 20% 30%, rgba(212, 160, 43, .55), transparent 70%),
    radial-gradient(70% 90% at 80% 70%, rgba(45, 106, 79, .8), transparent 75%),
    linear-gradient(135deg, #24402F, #6B4A26);
  filter: blur(10px);
}
.hhg-empty-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center; text-align: center;
  background: rgba(14, 18, 14, .38);
  color: #fff; padding: 24px;
}
.hhg-empty-overlay strong {
  display: block;
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
}
.hhg-empty-overlay span { display: block; margin-top: 8px; font-size: .92rem; opacity: .85; }

@media (max-width: 767px) {
  .hhg-stage { aspect-ratio: 4 / 3; }
  .hhg-caption strong { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hhg-slide { transition: none; }
}
