/* ==========================================================================
   Wholesale enquiry popup
   --------------------------------------------------------------------------
   The shell only. The form inside it is styled by the .wholesale-* rules that
   already ship in wholesale-form.css (products.html, index.html) and blog.css
   (every article page), so nothing about the form itself is restated here.

   Deliberately mirrors the size-guide dialog in products.html: centred sheet
   on desktop, bottom sheet on mobile, same blur, same easing. Two popups on
   the same page that behave differently read as two different websites.
   ========================================================================== */

html.enquiry-modal-open { overflow: hidden; }

.enquiry-modal {
  position: fixed;
  inset: 0;
  z-index: 4200;               /* above the size-guide dialog at 4000 */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 20, 14, .56);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.enquiry-modal.is-open { display: flex; animation: enquiryModalFade .22s ease-out; }

.enquiry-modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 24px;
  background: var(--surface, #fff);
  color: var(--ink, #1B1F24);
  box-shadow: 0 28px 80px rgba(20, 25, 18, .28);
  animation: enquiryModalIn .28s cubic-bezier(.2, .8, .2, 1);
}

/* The form card carries its own margin and rounding for the article page. Inside
   the panel it IS the panel, so both are stripped. */
.enquiry-modal-panel .wholesale-form-card {
  margin-top: 0;
  border: 0;
  border-radius: 24px;
  padding: 28px;
  scroll-margin-top: 0;
}

.enquiry-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 0;
  border-radius: 50%;
  background: #F1F0EB;
  color: var(--ink, #1B1F24);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color .2s ease, transform .2s ease;
}
.enquiry-modal-close:hover { background: #E5E7DF; transform: rotate(5deg); }
.enquiry-modal-close:focus-visible { outline: 3px solid rgba(76, 106, 60, .35); outline-offset: 2px; }

/* Keep the heading clear of the close button. */
.enquiry-modal-panel .wholesale-form-intro { padding-right: 56px; }

/* The heading is pinned to the display face rather than left to inherit. Each
   host page styles h2 differently — products.html forces Archivo on every h2,
   the article pages leave it as Inter — so an inherited heading made the same
   popup look like two different components depending on where it opened. */
.enquiry-modal-panel .wholesale-form-intro h2 {
  margin: .2rem 0 .75rem;
  font-family: 'Archivo', Arial, sans-serif;
  font-stretch: 125%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.1;
  color: var(--ink, #1B1F24);
}
.enquiry-modal-panel .wholesale-form-intro p:last-child { margin-bottom: 1.5rem; }

/* Set by the popup when a specific product card was the entry point. */
.enquiry-modal-context {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 1.25rem;
  padding: .7rem .9rem;
  border-radius: 10px;
  background: #EDF2E9;
  color: #315D24;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.4;
}
.enquiry-modal-context.is-shown { display: flex; }

@keyframes enquiryModalFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes enquiryModalIn {
  from { opacity: 0; transform: translateY(18px) scale(.98) }
  to   { opacity: 1; transform: translateY(0) scale(1) }
}

@media (prefers-reduced-motion: reduce) {
  .enquiry-modal.is-open,
  .enquiry-modal-panel { animation: none; }
}

@media (max-width: 680px) {
  .enquiry-modal { align-items: flex-end; padding: 0; }
  .enquiry-modal-panel {
    width: 100%;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 24px 24px 0 0;
  }
  .enquiry-modal-panel .wholesale-form-card {
    border-radius: 24px 24px 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  }
  .enquiry-modal-close { top: 14px; right: 14px; }
}
