/* =====================================================================
   Where to Buy — page-specific styles only — theme tokens come from
   design-system.css (mobile boundary: 900px — see --eralux-mobile-breakpoint)
   ===================================================================== */

:root {
  --ink: var(--ews-ink);
  --paper: var(--ews-paper);
  --paper-2: var(--ews-paper-2);
  --muted: var(--ews-muted);
  --line: var(--ews-line-strong);
  --accent: var(--ews-accent);
  --accent-soft: var(--ews-accent-soft);
  --card: var(--paper);
  --shadow: var(--ews-shadow);
  --gut: var(--ews-gutter);
  --max: none;
  --placeholder-tone: var(--ews-placeholder-tone);
}

/* This page's universal reset is scoped to its own CONTENT (<main>) on
   purpose. It used to sit on the BODY class, which meant it also stripped
   the shared header's and footer's margins and paddings — that is why the
   footer rendered differently here than on every other page. */
.eralux-where-to-buy-page {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* :where(main) keeps this rule at exactly the specificity the old
   body-wide reset had (0,1,0), so every later rule in this file still
   wins over it — it only narrows WHAT the reset reaches. */
.eralux-where-to-buy-page :where(main),
.eralux-where-to-buy-page :where(main) * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html:has(.eralux-where-to-buy-page) {
  scroll-behavior: smooth;
  background: var(--paper);
}

.eralux-where-to-buy-page {
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

.eralux-where-to-buy-page main,
.eralux-where-to-buy-page .eralux-where-to-buy-locator,
.eralux-where-to-buy-page .eralux-where-to-buy-results,
.eralux-where-to-buy-page .eralux-where-to-buy-control-panel,
.eralux-where-to-buy-page .eralux-where-to-buy-agent-card {
  background: var(--paper);
}

/*
 * The heading gets background-color only — the `background:` shorthand
 * would implicitly reset background-size/position and stop the
 * admin-set heading background image from covering the full width.
 */
.eralux-where-to-buy-page .eralux-where-to-buy-heading {
  background-color: var(--paper);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.eralux-where-to-buy-page a {
  color: inherit;
  text-decoration: none;
}

.eralux-where-to-buy-page button {
  color: inherit;
}

.eralux-where-to-buy-page :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* This page's universal reset (margin/padding 0) loads after
   design-system.css, so the shared heading and button paddings must be
   re-asserted here to keep the heading aligned with every other page
   (e.g. the Career page). */
.eralux-where-to-buy-heading-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--eralux-heading-padding-vertical) var(--eralux-page-padding-horizontal);
}

/* Match the Contact Us heading rhythm (this page's universal reset strips
   the browser's default h1 margins, which the Contact page keeps). */
.eralux-where-to-buy-heading-inner h1 {
  margin: clamp(28px, 4vw, 59px) 0 0;
}

.eralux-where-to-buy-heading-inner p {
  margin: 20px 0 clamp(28px, 4vw, 59px);
}

.eralux-where-to-buy-page .eralux-button {
  padding: 0 22px;
}

.eralux-where-to-buy-locator {
  max-width: var(--max);
  margin: auto;
  padding: clamp(70px, 8vw, 120px) var(--gut);
}

.eralux-where-to-buy-locator-shell {
  background: var(--card);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.65fr);
  min-height: 720px;
  box-shadow: var(--shadow);
}

.eralux-where-to-buy-map-panel {
  position: relative;
  min-height: 720px;
  background: var(--paper);
  overflow: hidden;
}

#chartdiv {
  width: 100%;
  height: 100%;
  min-height: 720px;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#chartdiv.is-dragging {
  cursor: grabbing;
}

.eralux-where-to-buy-map-zoom-controls {
  position: absolute !important;
  right: 20px !important;
  top: 20px !important;
  z-index: 10 !important;
  display: grid !important;
  gap: 8px;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.eralux-where-to-buy-map-zoom-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: rgba(var(--ews-paper-rgb), 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.45rem;
  font-weight: var(--ews-weight-medium);
  line-height: 1;
  display: grid;
  place-items: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.eralux-where-to-buy-map-zoom-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ews-contrast-ink);
}

.eralux-where-to-buy-map-zoom-button:active {
  background: var(--accent);
  border-color: var(--accent);
}

.eralux-where-to-buy-map-note {
  position: absolute;
  left: 24px;
  bottom: 20px;
  z-index: 5;
  padding: 10px 13px;
  background: rgba(var(--ews-paper-rgb), 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.eralux-where-to-buy-control-panel {
  border-left: 1px solid var(--line);
  padding: clamp(28px, 4vw, 52px);
  display: flex;
  flex-direction: column;
}

.eralux-where-to-buy-field {
  margin-bottom: 20px;
}

.eralux-where-to-buy-field label {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.eralux-where-to-buy-search-wrap {
  position: relative;
}

.eralux-where-to-buy-page select,
.eralux-where-to-buy-page input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0 16px;
  color: var(--ink);
  border-radius: 0;
  outline: none;
}

.eralux-where-to-buy-page select:focus,
.eralux-where-to-buy-page input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--ews-accent-rgb), 0.1);
}

.eralux-where-to-buy-search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}

.eralux-where-to-buy-panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

/* The Clear All button uses the shared .eralux-button classes and fills
   the space previously shared with the removed "Find an Agent" button. */
.eralux-where-to-buy-panel-actions .eralux-button {
  flex: 1;
  width: 100%;
}

.eralux-where-to-buy-quick-stats {
  margin-top: auto;
  padding-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.eralux-where-to-buy-stat {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.eralux-where-to-buy-stat strong {
  font-size: 1.6rem;
  font-weight: var(--ews-weight-medium);
}

.eralux-where-to-buy-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 5px;
}

.eralux-where-to-buy-results {
  padding-top: 70px;
}

.eralux-where-to-buy-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

/* Map selections scroll to the sub-heading itself. Leave room for the
   sticky header plus a small visual gap instead of landing on a result card. */
.eralux-where-to-buy-results-toolbar h3 {
  scroll-margin-top: calc(var(--ews-header-overlay, 0px) + var(--ews-scroll-target-gap));
}

.eralux-where-to-buy-count {
  font-size: 0.76rem;
  color: var(--muted);
}

.eralux-where-to-buy-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.eralux-where-to-buy-agent-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 20px 28px 28px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.eralux-where-to-buy-agent-card:hover {
  transform: translateY(-4px);
  border-color: var(--placeholder-tone);
  box-shadow: var(--shadow);
}

.eralux-where-to-buy-agent-card.is-selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px var(--accent-soft),
    var(--shadow);
}

.eralux-where-to-buy-territory {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.eralux-where-to-buy-card-meta {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  color: var(--ews-ink);
  font-size: 0.88rem;
  line-height: 1.5;
}

.eralux-where-to-buy-card-meta-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: start;
}

.eralux-where-to-buy-card-meta-row a,
.eralux-where-to-buy-card-meta-row a:visited {
  color: var(--ews-ink) !important;
}

.eralux-where-to-buy-card-meta-row a:hover {
  color: var(--accent) !important;
}

.eralux-where-to-buy-card-meta svg {
  margin-top: 2px;
}

.eralux-where-to-buy-card-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.eralux-where-to-buy-card-foot a,
.eralux-where-to-buy-card-foot a:visited {
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink) !important;
}

.eralux-where-to-buy-card-foot a:hover,
.eralux-where-to-buy-card-foot a:focus-visible {
  color: var(--accent) !important;
}

.eralux-where-to-buy-arrow {
  color: var(--accent);
  font-size: 1.2rem;
}

.eralux-where-to-buy-empty {
  grid-column: 1/-1;
  padding: 70px 20px;
  text-align: center;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* Keep the shared custom footer on the same horizontal grid as this page. */
@media (max-width: 1100px) {
  .eralux-where-to-buy-locator-shell {
    grid-template-columns: 1fr;
  }

  .eralux-where-to-buy-control-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .eralux-where-to-buy-quick-stats {
    margin-top: 28px;
  }

  .eralux-where-to-buy-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====================================================================
   Mobile (900px boundary — see --eralux-mobile-breakpoint)
   ===================================================================== */

@media (max-width: 900px) {
  .eralux-where-to-buy-locator {
    padding: 54px var(--gut) 70px;
  }

  .eralux-where-to-buy-locator-shell {
    min-height: 0;
  }

  .eralux-where-to-buy-map-panel,
  #chartdiv {
    min-height: 390px;
  }

  .eralux-where-to-buy-map-zoom-controls {
    right: 12px;
    top: 12px;
    gap: 6px;
  }

  .eralux-where-to-buy-map-zoom-button {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }

  .eralux-where-to-buy-map-note {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
    font-size: 0.6rem;
  }

  .eralux-where-to-buy-control-panel {
    padding: 30px 20px;
  }

  .eralux-where-to-buy-page select,
  .eralux-where-to-buy-page input {
    height: var(--ews-control-height);
    font-size: 16px;
  }

  .eralux-where-to-buy-panel-actions {
    flex-direction: column;
  }

  /* In the column layout the desktop rule "flex: 1" would apply to the
     VERTICAL axis (flex-basis: 0 beats the height property), collapsing
     the Clear All button to its text height. Restore a fixed basis so
     the shared 52px control height applies again. */
  .eralux-where-to-buy-panel-actions .eralux-button {
    flex: 0 0 auto;
    width: 100%;
    height: var(--ews-control-height);
  }

  .eralux-where-to-buy-quick-stats {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .eralux-where-to-buy-stat strong {
    font-size: 1.35rem;
  }

  .eralux-where-to-buy-results {
    padding-top: 52px;
  }

  .eralux-where-to-buy-results-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .eralux-where-to-buy-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .eralux-where-to-buy-agent-card {
    min-height: 0;
    padding: 23px 20px;
  }

  .eralux-where-to-buy-card-meta-row {
    min-width: 0;
  }

  .eralux-where-to-buy-card-meta-row span,
  .eralux-where-to-buy-card-meta-row a {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .eralux-where-to-buy-card-foot {
    margin-top: 28px;
  }
}

@media (max-width: 390px) {
  .eralux-where-to-buy-map-panel,
  #chartdiv {
    min-height: 330px;
  }

  .eralux-where-to-buy-quick-stats {
    grid-template-columns: 1fr;
  }
}

/* Agent search box (matches the agent name, website URL, and each
   office's address, managed territories, phone and email). */
.eralux-where-to-buy-search-wrap input {
  padding-right: 44px;
}

/* The page's universal reset (* { padding: 0 }) loads after the design
   system and stripped the heading glass panel's padding — re-assert it,
   matching the News & Events panel. */
.eralux-where-to-buy-page .eralux-page-heading-panel {
  padding: clamp(22px, 3vw, 40px) clamp(24px, 3.2vw, 48px);
}

.eralux-where-to-buy-page .eralux-page-heading-panel h1 {
  margin: 0;
}

.eralux-where-to-buy-page .eralux-page-heading-panel p {
  margin: 18px 0 0;
}

/* =====================================================================
   Styled select dropdowns — replaces the browser-default look with the
   theme's control styling: card background, thin border, custom chevron,
   accent focus ring.
   ===================================================================== */

.eralux-where-to-buy-page select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0 46px 0 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--card);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%230d0d0c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.eralux-where-to-buy-page select:hover {
  border-color: var(--ink);
}

.eralux-where-to-buy-page select:focus {
  border-color: var(--accent);
}

.eralux-where-to-buy-page select option {
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
}
