/* Townica NOW Directory (Townica-only styling) */

:root {
  --tn-gap: 18px;
  --tn-radius: 18px;
  --tn-border: #e3e6ea;
  --tn-accent: #d71f3f;
}

/* ===== Wrapper ===== */
.townica-now-wrap {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

/* ===== Filters Bar ===== */
.townica-now-bar {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

@media (max-width: 900px) {
  .townica-now-bar {
    grid-template-columns: 1fr;
  }
}

.townica-now-bar input.townica-now-zip,
.townica-now-bar select.townica-now-type,
.townica-now-bar select.townica-now-subcat {
  width: 100%;
  height: 44px;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 16px;
  background: #fff;
}

/* ===== Split Layout (List + Sticky Map) ===== */
.townica-now-layout {
  display: grid;
  grid-template-columns: 35fr 65fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 980px) {
  .townica-now-layout {
    grid-template-columns: 1fr;
  }
}

/* Left column: scrollable list */
.townica-now-left {
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 8px;
}

/* Nicer scrollbar (supported browsers only) */
.townica-now-left {
  scrollbar-width: thin;
  scrollbar-color: #cfd6dd transparent;
}
.townica-now-left::-webkit-scrollbar { width: 10px; }
.townica-now-left::-webkit-scrollbar-thumb {
  background: #cfd6dd;
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* Right column: sticky map */
.townica-now-right {
  position: sticky;
  top: 120px;
}

@media (max-width: 980px) {
  .townica-now-left {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .townica-now-right {
    position: relative;
    top: auto;
  }
}

/* ===== Cards (Stacked List) ===== */
.townica-now-cards {
  display: flex;
  flex-direction: column;
  gap: var(--tn-gap);
  padding: 2px; /* prevents shadow clipping */
}

.townica-now-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--tn-border);
  border-radius: var(--tn-radius);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;

  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: start;
}

.townica-now-card:hover {
  transform: translateY(-2px);
  border-color: #d6dbe1;
  box-shadow: 0 14px 30px rgba(0,0,0,0.08);
}

.townica-now-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 1px solid var(--tn-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.townica-now-card-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.townica-now-card-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 6px;
}


.townica-now-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  gap:12px;
  margin: 0 0 8px;
}

.townica-now-card-titles{
  min-width:0;
}

.townica-now-card-title{
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 3px;
}

.townica-now-card-venue{
  font-size: 14px;
  font-weight: 600;
  color: #5f6b76;
  margin: 0;
}


.townica-now-badge {
  flex-shrink: 0;
  display: inline-block;
  background: var(--tn-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 0;
}

.townica-now-card-address {
  font-size: 14px;
  color: #444;
  margin: 0 0 6px;
  line-height: 1.35;
}

.townica-now-card-distance {
  font-size: 13px;
  color: #666;
  margin: 0 0 8px;
}

.townica-now-card-meta {
  font-size: 13px;
  color: #666;
  line-height: 1.35;
}

.townica-now-card-meta strong {
  color: #333;
  font-weight: 800;
}

.townica-now-card-link {
  color: var(--tn-accent);
  text-decoration: none;
}
.townica-now-card-link:hover {
  text-decoration: underline;
}

/* ===== Map ===== */
.townica-now-map {
  width: 100%;
  height: calc(100vh - 220px);
  min-height: 420px;
  border-radius: var(--tn-radius);
  overflow: hidden;
  border: 1px solid var(--tn-border);
}

@media (max-width: 980px) {
  .townica-now-map {
    height: 520px;
  }
}

/* Recenter button */
.townica-now-recenter-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #d9dee4;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 8px 18px rgba(0,0,0,0.10);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.townica-now-recenter-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--tn-accent);
}

/* ===== Modal ===== */
.townica-now-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.townica-now-modal.is-open {
  display: flex;
}

.townica-now-modal-inner {
  width: min(860px, 96vw);
  background: #fff;
  border-radius: var(--tn-radius);
  padding: 18px 18px 20px;
  position: relative;
}

.townica-now-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #d71f3f;
  background: #d71f3f;
  color: var(--tn-accent);
  font-size: 18px;
  font-weight: 900;
  font-color: #fff;
  cursor: pointer;
  line-height: 1;
}
.townica-now-modal-close:hover{
  background:#d71f3f;
  font-color: #fff;
  border-color:#d71f3f;
}

.townica-now-modal-title {
  font-size: 22px;
  font-weight: 900;
  margin: 6px 0 6px;
}

.townica-now-modal-biz {
  font-size: 16px;
  color: #444;
  margin-bottom: 12px;
}

.townica-now-modal-meta {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
}

.townica-now-modal-desc {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin-bottom: 12px;
}

.townica-now-modal-addr {
  font-size: 14px;
  color: #444;
  margin-bottom: 10px;
}


/* ===== Modal v0.2.3 (enhanced) ===== */

.tnm{display:block}
.tnm-top{display:flex; align-items:flex-start; justify-content:flex-start; gap:14px; padding-right:44px;}
.tnm-title{font-size:24px; font-weight:900; line-height:1.15; margin:2px 0 4px;}
.tnm-venue{font-size:15px; font-weight:700; color:#5f6b76; margin:0 0 2px;}
.tnm-badge{display:inline-flex; align-items:center; justify-content:center; background:var(--tn-accent); color:#fff; font-size:12px; font-weight:800; padding:7px 12px; border-radius:999px; white-space:nowrap; letter-spacing:.3px; text-transform:uppercase;}
.tnm-body{display:grid; grid-template-columns: 280px 1fr; gap:18px; margin-top:14px;}
@media (max-width: 860px){ .tnm-body{grid-template-columns:1fr;} .tnm-top{padding-right:0;} }
.tnm-media{display:flex; flex-direction:column; gap:12px;}
.tnm-img{width:100%; height:170px; object-fit:cover; border-radius:16px; border:1px solid #eef2f6; background:#f7f8fb;}
.tnm-img--placeholder{display:flex; align-items:center; justify-content:center;}
.tnm-ph{font-size:12px; font-weight:800; letter-spacing:.5px; color:#6b7785;}
.tnm-actions{display:flex; gap:10px; flex-wrap:wrap;}
.tnm-btn{display:inline-flex; align-items:center; justify-content:center; padding:10px 12px; border-radius:12px; border:1px solid #e7ebf0; text-decoration:none; font-weight:800; font-size:13px;}
.tnm-btn-primary{background:var(--tn-accent); border-color:var(--tn-accent); color:#fff;}
.tnm-btn-ghost{background:#fff; color:#26313b;}
.tnm-btn:hover{filter:brightness(0.98)}
.tnm-chips{display:flex; gap:8px; flex-wrap:wrap;}
.tnm-chip{display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; background:#f3f6f9; border:1px solid #e7ebf0; font-weight:800; font-size:12px; color:#2e3a45;}
.tnm-details{display:flex; flex-direction:column; gap:14px;}
.tnm-meta{display:grid; gap:8px; background:#fbfcfe; border:1px solid #eef2f6; border-radius:16px; padding:12px 14px;}
.tnm-meta-row{display:grid; grid-template-columns: 88px 1fr; gap:10px;}
.tnm-meta-k{font-size:12px; font-weight:900; color:#6a7683; text-transform:uppercase; letter-spacing:.4px;}
.tnm-meta-v{font-size:14px; font-weight:700; color:#1f2a33; line-height:1.35;}
.tnm-desc{font-size:14px; color:#2b3640; line-height:1.55;}


/* ===== Modal v0.2.4 (Townica NOW style) ===== */
.townica-now-modal-inner {
  width: 88%;
  max-width: 760px;
  margin: 6vh auto;
}

.tnm2{display:block}
.tnm2-head{
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  gap:14px;
  padding-right:48px; /* room for close button */
}
.tnm2-titleline{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.tnm2-title{
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
  margin: 2px 0 6px;
  color: var(--tn-accent);
}
.tnm2-venue{
  font-size: 16px;
  font-weight: 800;
  color:#5f6b76;
  margin: 0;
}
.tnm2-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: var(--tn-accent);
  color:#fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .35px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: -10px;
}
.tnm2-grid{
  display:grid;
  grid-template-columns: 118px 1fr 240px;
  grid-template-rows: auto auto;
  gap: 16px 18px;
  margin-top: 14px;
  align-items: start;
}
@media (max-width: 920px){
  .tnm2-grid{ grid-template-columns: 1fr; }
  .tnm2-head{ padding-right:0; }
}

.tnm2-icon{
  width: 104px;
  height: 104px;
  border-radius: 8px;
  border: 1px solid #e7ebf0;
  background: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.tnm2-icon img{
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.tnm2-meta{
  background: #fbfcfe;
  border: 1px solid #eef2f6;
  border-radius: 16px;
  padding: 14px 16px;
}
.tnm2-row{
  display:grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding: 6px 0;
}
.tnm2-row + .tnm2-row{
  border-top: 1px solid #eef2f6;
}
.tnm2-k{
  font-size: 12px;
  font-weight: 900;
  color:#6a7683;
  text-transform: uppercase;
  letter-spacing: .45px;
}
.tnm2-v{
  font-size: 15px;
  font-weight: 600;
  color:#1f2a33;
  line-height: 1.35;
}

.tnm2-mapwrap{
  display:flex;
  flex-direction:column;
  gap: 10px;
  align-items: stretch;
}
.tnm2-map{
  width: 100%;
  height: 150px;
  border-radius: 14px;
  border: 1px solid #eef2f6;
  overflow:hidden;
  background:#f7f8fb;
}
.tnm2-map--placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#6b7785;
  font-weight:800;
  font-size: 12px;
}
.tnm2-directions{
  font-size: 9px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #e7ebf0;
  background: #fff;
  font-weight: 900;
  text-decoration:none;
  color:#1f2a33;
}
.tnm2-directions:hover{ filter: brightness(0.98); }

.tnm2-desc{
  grid-column: 2 / 4;
  font-size: 14px;
  color:#2b3640;
  line-height: 1.6;
  padding-top: 2px;
}
@media (max-width: 920px){
  .tnm2-desc{ grid-column: auto; }
}


/* Modal animation */
.townica-now-modal{opacity:0;transition:opacity 160ms ease;}
.townica-now-modal.is-open{opacity:1;}
.townica-now-modal-inner{transform:translateY(6px) scale(.99);transition:transform 180ms ease;}
.townica-now-modal.is-open .townica-now-modal-inner{transform:translateY(0) scale(1);}

/* Townica NOW modal title color */
.townica-now-modal .tnm2-title{color: var(--tn-accent);}

.tnm2-desc{white-space: pre-wrap;}

.tnm2-actions{display:flex;gap:10px;flex-wrap:wrap;}
.tnm2-iconbtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  height:42px;
  padding:0 14px;
  border-radius:12px;
  border: 1px solid #d71f3f;
  background: #d71f3f;
  font-weight:500;
  text-decoration:none;
  color: #ffffff;
  cursor:pointer;
  font-size: 12px;
  transition: all 150ms ease;
}
.tnm2-iconbtn svg{width:18px;height:18px;fill:currentColor;}
.tnm2-iconbtn-primary{background:var(--tn-accent);border-color:var(--tn-accent);color:#fff;}

.tnm2-icon-btn:hover {
  background: #ffffff;
  color: #d71f3f;
  border: 1px solid #d71f3f;
}

.tnm2-iconbtn.s-copied{background:#f3f6f9;}
.tnm2-iconbtn-copied{font-weight:900;}

/* Base button style (both Directions + Share) */
.tnm2-actions .tnm2-iconbtn {
  background: #d71f3f;
  color: #ffffff;
  border: 2px solid #d71f3f;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

/* Make sure SVG icons inherit text color */
.tnm2-actions .tnm2-iconbtn svg {
  fill: currentColor;
  width: 18px;
  height: 18px;
}

/* Hover state (both buttons identical) */
.tnm2-actions .tnm2-iconbtn:hover,
.tnm2-actions .tnm2-iconbtn:focus {
  background: #ffffff;
  color: #d71f3f;
  border-color: #d71f3f;
}

/* Remove any strange default overrides */
.tnm2-actions .tnm2-iconbtn-primary {
  background: #d71f3f;
  color: #ffffff;
  border: 2px solid #d71f3f;
}

/* Modal Close Button - Match Action Buttons */
.townica-now-modal-close {
  background: #d71f3f;
  color: #ffffff;
  border: 2px solid #d71f3f;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover state */
.townica-now-modal-close:hover,
.townica-now-modal-close:focus {
  background: #ffffff;
  color: #d71f3f;
  border-color: #d71f3f;
}

/* Remove default button styles if any */
.townica-now-modal-close:focus {
  outline: none;
}