/* =================================================================
   TCG Stores — frontend storefinder
   Aesthetic: clean, utilitarian, Stockmonster-adjacent (dark accent,
   generous whitespace, rounded cards).
   ================================================================= */

.tcg-storefinder{
  --accent:       #1f3a5f;          /* stockmonster-ish deep navy */
  --accent-ink:   #ffffff;
  --open:         #16a34a;
  --closed:       #9ca3af;
  --bg:           #ffffff;
  --bg-soft:      #f7f8fa;
  --ink:          #0f172a;
  --muted:        #64748b;
  --border:       #e2e8f0;
  --radius:       10px;
  --shadow:       0 1px 2px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.06);

  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: var(--tcg-height, 680px);
  box-shadow: var(--shadow);
}
.tcg-storefinder *, .tcg-storefinder *::before, .tcg-storefinder *::after{ box-sizing: border-box; }
.tcg-storefinder button{ font: inherit; cursor: pointer; }

/* -------- Header -------- */
.sf-header{
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.sf-search{
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
}
.sf-search > span{ color: var(--muted); font-size: 14px; }
.sf-search-input{
  flex: 1; border: 0; background: transparent;
  padding: 10px 8px; font-size: 14px; outline: none; color: var(--ink);
}
.sf-geo{
  border: 0; background: transparent; color: var(--muted);
  font-size: 16px; padding: 6px 8px; border-radius: 6px;
}
.sf-geo:hover{ background: #edf0f4; color: var(--ink); }

.sf-filters{
  display: flex; gap: 6px; flex-wrap: nowrap; align-items: center;
  min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.sf-filters::-webkit-scrollbar{ display: none; }
.chip{
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px;
  font-size: 12px; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
select.chip{ appearance: none; padding-right: 22px; background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%); background-position: right 10px top 12px, right 7px top 12px; background-size: 4px 4px; background-repeat: no-repeat; }
.chip-toggle input{ accent-color: var(--accent); width: 13px; height: 13px; margin: 0; }

/* -------- View container -------- */
.tcg-storefinder .view{ flex: 1; display: flex; min-height: 0; }

/* Split view (list + map) */
.view-split{ flex-direction: row; }
.view-split .list-panel{
  flex: 0 0 var(--list-width, 38%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; min-width: 0; background: #fff;
}
.view-split .map-wrap{ flex: 1; position: relative; }

/* Map element */
.map{
  position: absolute; inset: 0;
  background: #e8eef5;
}

/* Result head */
.result-head{
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}
.result-head .count{ font-weight: 600; color: var(--ink); font-size: 13px; }
.result-head .sort{
  appearance: none; border: 0; background: transparent;
  color: var(--muted); font-size: 12px; padding: 4px 18px 4px 8px;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: right 6px center, right 2px center;
  background-size: 4px 4px; background-repeat: no-repeat;
}

/* -------- Store cards in list -------- */
.store-list{ flex: 1; overflow-y: auto; padding: 6px; }
.store-card{
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s;
  align-items: start;
}
.store-card + .store-card{ border-top: 1px solid var(--border); border-radius: 0; }
.store-card:hover{ background: var(--bg-soft); }
.store-card.is-active{ background: color-mix(in srgb, var(--accent) 8%, white); border-color: color-mix(in srgb, var(--accent) 25%, white); border-radius: 8px; }
.store-card .thumb{
  width: 64px; height: 64px; border-radius: 8px; background: #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 700; font-size: 18px;
  background-size: cover; background-position: center;
  overflow: hidden; flex-shrink: 0;
}
.store-card .body{ min-width: 0; }
.store-card h4{
  margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.store-card .addr{
  margin: 0 0 6px; font-size: 12.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.store-card .meta{ display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; }
.status{
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 600; letter-spacing: .02em;
}
.status::before{
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, white);
}
.status.open{ color: var(--open); }
.status.closed{ color: var(--closed); }
.dot-sep{ color: var(--border); }
.dist{ color: var(--muted); font-variant-numeric: tabular-nums; }
.types{ color: var(--muted); }

.store-card .aside{ text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.store-card .detail-btn{
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.store-card .detail-btn:hover{ border-color: var(--accent); color: var(--accent); }

/* -------- Map popup -------- */
.leaflet-popup-content-wrapper{ border-radius: 10px; padding: 0; }
.leaflet-popup-content{ margin: 0; width: 260px !important; }
.tcg-popup{ padding: 12px 14px; }
.tcg-popup h4{ margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.tcg-popup .addr{ margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.tcg-popup .meta{ display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 10px; }
.tcg-popup .actions{ display: flex; gap: 6px; }
.tcg-popup .actions a{
  flex: 1; text-align: center; font-size: 12px; font-weight: 500;
  padding: 6px 8px; border-radius: 6px; text-decoration: none;
}
.tcg-popup .actions .primary{ background: var(--accent); color: var(--accent-ink); }
.tcg-popup .actions .ghost{ background: var(--bg-soft); color: var(--ink); border: 1px solid var(--border); }

/* Custom pin */
.tcg-pin{
  width: 32px; height: 40px; position: relative;
}
.tcg-pin svg{ width: 100%; height: 100%; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }

/* Loader + empty */
.sf-empty, .sf-loading{
  padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px;
}

/* -------- Single card shortcode -------- */
.tcg-single-card{
  display: flex; gap: 16px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); max-width: 560px;
}
.tcg-single-thumb img{ width: 120px; height: 120px; object-fit: cover; border-radius: 8px; }
.tcg-single-body h3{ margin: 0 0 4px; font-size: 16px; }
.tcg-single-body .addr{ color: var(--muted); margin: 0 0 8px; font-size: 13px; }
.tcg-single-body .chips .chip.open{ color: var(--open); background: color-mix(in srgb, var(--open) 8%, white); border-color: color-mix(in srgb, var(--open) 30%, white); }
.tcg-single-body .chips .chip.closed{ color: var(--closed); }

/* -------- Responsive -------- */
@media (max-width: 720px){
  .tcg-storefinder{ height: auto; }
  .sf-header{ grid-template-columns: 1fr; }
  .view-split{ flex-direction: column; }
  .view-split .list-panel{ flex: 0 0 auto; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .view-split .map-wrap{ height: 50vh; min-height: 320px; position: relative; }
}

/* =================================================================
   Hide redundant region filter when storefinder is preset to a region
   (embedded on a province landing page).
   ================================================================= */
.tcg-storefinder.has-preset-region .sf-filters [data-filter="region"]{ display: none; }

/* =================================================================
   Province / country / type landing pages
   Reuses the same design tokens as the storefinder for visual unity.
   ================================================================= */
.tcg-region-page{
  --accent:  #1f3a5f;
  --ink:     #0f172a;
  --muted:   #64748b;
  --border:  #e2e8f0;
  --bg-soft: #f7f8fa;
  --open:    #16a34a;
  --closed:  #9ca3af;
  --radius:  12px;

  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 72px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

.tcg-region-hero{ margin-bottom: 32px; }
.tcg-crumbs{
  font-size: 13px; color: var(--muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tcg-crumbs a{ color: inherit; text-decoration: none; }
.tcg-crumbs a:hover{ color: var(--accent); text-decoration: underline; }
.tcg-crumbs span{ opacity: .5; }

.tcg-region-title{
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1; letter-spacing: -0.02em;
  margin: 0 0 14px; font-weight: 700; color: var(--ink);
}
.tcg-region-intro{
  font-size: 17px; line-height: 1.55;
  max-width: 720px; color: var(--muted);
  margin: 0;
}
.tcg-region-desc{ margin-top: 14px; max-width: 720px; color: var(--ink); font-size: 15px; line-height: 1.6; }

.tcg-region-map{ margin: 32px 0 44px; }

.tcg-section-head{
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 18px;
}
.tcg-section-head h2{
  font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -0.01em;
}
.tcg-section-count{
  display: inline-flex; align-items: center;
  min-width: 26px; height: 24px; padding: 0 9px;
  font-size: 12px; font-weight: 600;
  background: var(--accent); color: #fff;
  border-radius: 999px;
}

.tcg-region-list{ margin: 0 0 48px; }
.tcg-region-cities{ margin: 0 0 48px; }
.tcg-region-cities h2,
.tcg-region-related h2{
  font-size: 18px; font-weight: 600; margin: 0 0 14px;
  color: var(--ink);
}

/* Store grid */
.tcg-store-grid{
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.tcg-store-card{
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tcg-store-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: 0 6px 20px rgba(15,23,42,.07);
}

.tcg-store-thumb{
  display: block; aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden; position: relative;
}
.tcg-store-thumb img{
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tcg-store-initials{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: var(--muted);
  background: linear-gradient(135deg, var(--bg-soft) 0%, #e2e8f0 100%);
  letter-spacing: -0.02em;
}

.tcg-store-body{
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.tcg-store-name{
  font-size: 16px; font-weight: 600; margin: 0;
  line-height: 1.3; letter-spacing: -0.01em;
}
.tcg-store-name a{ color: var(--ink); text-decoration: none; }
.tcg-store-name a:hover{ color: var(--accent); }

.tcg-store-addr{
  font-size: 13px; color: var(--muted); margin: 0;
  line-height: 1.4;
}
.tcg-store-status{
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
  margin: 2px 0 0;
}
.tcg-dot{
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.tcg-dot--open{
  background: var(--open);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--open) 18%, white);
}
.tcg-dot--closed{
  background: var(--closed);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--closed) 18%, white);
}

.tcg-store-more{
  margin-top: auto; padding-top: 10px;
  font-size: 13px; font-weight: 600;
  color: var(--accent); text-decoration: none;
  align-self: flex-start;
}
.tcg-store-more:hover{ text-decoration: underline; }

/* Pill lists (cities + related taxonomies) */
.tcg-pill-list{
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.tcg-pill{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px; color: var(--ink);
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.tcg-pill--link:hover{
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.tcg-pill--link:hover .tcg-pill-count{
  background: rgba(255,255,255,.2); color: #fff;
}
.tcg-pill-count{
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  font-size: 11px; font-weight: 600;
  background: #fff; color: var(--muted);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tcg-region-empty{
  padding: 56px 20px; text-align: center;
  color: var(--muted); font-size: 15px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.tcg-region-related{
  margin-top: 16px; padding-top: 32px;
  border-top: 1px solid #e2e8f0;
}

/* -------- SEO body copy + FAQ -------- */
.tcg-region-page .tcg-seo-copy{
  margin: 32px 0 8px;
  padding: 24px 28px;
  background: #f7f8fa;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.tcg-region-page .tcg-seo-copy h2{
  margin: 0 0 12px;
  font-size: 22px; font-weight: 600;
  color: #0f172a;
}
.tcg-region-page .tcg-seo-copy p{
  margin: 0 0 12px;
  font-size: 15px; line-height: 1.65; color: #334155;
}
.tcg-region-page .tcg-seo-copy p:last-child{ margin-bottom: 0; }
.tcg-region-page .tcg-seo-copy a{
  color: #1f3a5f; text-decoration: underline; text-underline-offset: 2px;
}

.tcg-region-page .tcg-faq{
  margin: 32px 0 0;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
}
.tcg-region-page .tcg-faq h2{
  margin: 0 0 16px;
  font-size: 22px; font-weight: 600; color: #0f172a;
}
.tcg-faq-item{
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.tcg-faq-item[open]{
  border-color: #c7d2dc;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 10px rgba(15,23,42,.05);
}
.tcg-faq-item > summary{
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 15px; font-weight: 600;
  color: #0f172a;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.tcg-faq-item > summary::-webkit-details-marker{ display: none; }
.tcg-faq-item > summary::after{
  content: "+";
  font-weight: 400; font-size: 22px; line-height: 1; color: #64748b;
  flex-shrink: 0;
  transition: transform .2s;
}
.tcg-faq-item[open] > summary::after{ content: "−"; }
.tcg-faq-a{
  padding: 0 18px 16px;
  font-size: 14.5px; line-height: 1.65; color: #334155;
}
.tcg-faq-a p{ margin: 0 0 10px; }
.tcg-faq-a p:last-child{ margin-bottom: 0; }

@media (max-width: 720px){
  .tcg-region-page{ padding: 24px 16px 56px; }
  .tcg-region-title{ font-size: 28px; }
  .tcg-store-grid{ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .tcg-region-page .tcg-seo-copy{ padding: 20px; }
  .tcg-region-page .tcg-seo-copy h2,
  .tcg-region-page .tcg-faq h2{ font-size: 19px; }
}
