/* HM Salon Suite — on-screen popups. Uses the HM Salon theme colours when present. */
.hm-pop {
  --pop-bg: var(--paper, #FFFDF9);
  --pop-ink: var(--espresso, #342A27);
  --pop-soft: var(--ink-soft, #66574F);
  --pop-accent: var(--rose-deep, #8F5E5A);
  --pop-tint: var(--blush, #F2E6DE);
  --pop-line: var(--line-strong, rgba(52, 42, 39, .38));
  position: fixed;
  z-index: 100000;
  color: var(--pop-ink);
  font-family: var(--f-body, "DM Sans", Arial, sans-serif);
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}
.hm-pop.is-open { opacity: 1; }
.hm-pop:focus { outline: none; }
.hm-pop-box { position: relative; background: var(--pop-bg); box-shadow: 0 18px 50px rgba(30, 22, 20, .25); border-radius: var(--radius, 2px); }
.hm-pop-content { padding: 28px 28px 24px; }
.hm-pop-title {
  margin: 0 40px 10px 0;
  font-family: var(--f-display, Georgia, serif);
  font-size: var(--fs-display-sm, 1.75rem);
  line-height: 1.15;
  font-weight: 500;
}
.hm-pop-body { color: var(--pop-soft); }
.hm-pop-body p { margin: 0 0 .75em; }
.hm-pop-body a { color: var(--pop-accent); }
.hm-pop-close {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--pop-ink); cursor: pointer;
}
.hm-pop-close:hover { background: var(--pop-tint); }
.hm-pop-close:focus-visible, .hm-pop-copy:focus-visible, .hm-pop-later:focus-visible { outline: 2px solid var(--pop-accent); outline-offset: 2px; }
.has-img .hm-pop-close { background: rgba(255, 253, 249, .9); }

.hm-pop-coupon {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin: 14px 0 4px; padding: 12px 14px;
  border: 1px dashed var(--pop-line); background: var(--pop-tint);
}
.hm-pop-price { flex-basis: 100%; font-family: var(--f-display, Georgia, serif); font-size: 1.4rem; line-height: 1.1; }
.hm-pop-code-label { font-size: var(--fs-xs, .8125rem); text-transform: uppercase; letter-spacing: .08em; color: var(--pop-soft); }
.hm-pop-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; font-weight: 600; letter-spacing: .06em; background: none; padding: 0; color: var(--pop-ink); }
.hm-pop-copy {
  margin-left: auto; min-height: 44px; min-width: 64px; padding: 0 14px;
  border: 1px solid var(--pop-line); background: var(--pop-bg); color: var(--pop-ink);
  font: inherit; font-size: var(--fs-sm, .9375rem); cursor: pointer; border-radius: var(--radius, 2px);
}
.hm-pop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 18px 0 0; }
.hm-pop-btn { text-decoration: none; }
.hm-pop .btn { white-space: normal; }
.hm-pop-later {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  color: var(--pop-soft); font: inherit; font-size: var(--fs-sm, .9375rem); text-decoration: underline; text-underline-offset: 3px;
}
.hm-pop-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hm-pop-media img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Fallback button look when the HM Salon theme isn't active. */
body:not(.hm-theme) .hm-pop .hm-pop-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.5rem; background: var(--pop-accent); color: var(--ivory, #FAF7F2); font-weight: 500; }

/* ---------- Centred popup ---------- */
.hm-pop--modal {
  inset: 0; display: grid; place-items: center; padding: 16px;
  background: rgba(30, 22, 20, .55);
  overflow-y: auto; overscroll-behavior: contain;
}
.hm-pop--modal .hm-pop-box { width: 100%; max-width: 480px; transform: translateY(12px) scale(.98); transition: transform .25s var(--ease, ease); }
.hm-pop--modal.is-open .hm-pop-box { transform: none; }
.hm-pop--modal.has-img .hm-pop-box { max-width: 760px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.hm-pop--modal.has-img .hm-pop-media { min-height: 100%; }
@media (max-width: 640px) {
  .hm-pop--modal { align-items: end; padding: 12px; }
  .hm-pop--modal.has-img .hm-pop-box { grid-template-columns: 1fr; }
  .hm-pop--modal.has-img .hm-pop-media { height: 160px; }
  .hm-pop-content { padding: 22px 20px 20px; }
}
html.hm-pop-lock, html.hm-pop-lock body { overflow: hidden; }

/* ---------- Bottom bar ---------- */
.hm-pop--bar { left: 0; right: 0; bottom: 0; transform: translateY(100%); }
.hm-pop--bar.is-open { transform: none; }
.hm-pop--bar .hm-pop-box { border-radius: 0; box-shadow: 0 -6px 24px rgba(30, 22, 20, .15); border-top: 1px solid var(--pop-line); }
.hm-pop--bar .hm-pop-content {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  max-width: var(--wrap, 1280px); margin: 0 auto;
  padding: 12px 60px max(12px, env(safe-area-inset-bottom)) 16px;
}
.hm-pop--bar .hm-pop-title { margin: 0; font-size: 1.25rem; }
.hm-pop--bar .hm-pop-body { flex: 1 1 260px; }
.hm-pop--bar .hm-pop-body p { margin: 0; }
.hm-pop--bar .hm-pop-coupon { margin: 0; padding: 4px 4px 4px 12px; }
.hm-pop--bar .hm-pop-price { flex-basis: auto; font-size: 1.1rem; }
.hm-pop--bar .hm-pop-actions { margin: 0; }
.hm-pop--bar .hm-pop-close { top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .hm-pop--bar .hm-pop-close { top: 4px; transform: none; }
  .hm-pop--bar .hm-pop-body { display: none; } /* keep the bar short on phones: heading, code, button */
  .hm-pop--bar .hm-pop-title { font-size: 1.125rem; }
  .hm-pop--bar .hm-pop-content { gap: 8px 12px; }
}

/* ---------- Corner box ---------- */
.hm-pop--corner { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: min(360px, calc(100vw - 32px)); transform: translateY(16px); }
.hm-pop--corner.is-open { transform: none; }
.hm-pop--corner .hm-pop-media { height: 140px; }
.hm-pop--corner .hm-pop-content { padding: 22px 20px 20px; }
.hm-pop--corner .hm-pop-title { font-size: 1.4rem; }
@media (max-width: 480px) { .hm-pop--corner { right: 12px; left: 12px; width: auto; } }

@media (prefers-reduced-motion: reduce) {
  .hm-pop, .hm-pop .hm-pop-box { transition: none !important; transform: none !important; }
}
@media print { .hm-pop { display: none !important; } }
