/* ============================================================
   MyWsM 4.0 - brand, phone-first layout
   Loaded after the original stylesheets; overrides only.
   ============================================================ */

/*  Logo  */
.mw-mark { background: none !important; width: auto !important; height: auto !important; border-radius: 0 !important; overflow: visible !important; }
.mw-mark::after { display: none !important; }
.mw-mark svg { display: block; }
.site-logo-text .logo-name em { color: var(--wsm-blue); font-weight: 600; }
.site-logo-text .logo-name { color: var(--wsm-blue-dark); }
.footer-logo-text .logo-name em { color: var(--wsm-yellow); font-weight: 600; }

/*  Category tiles (replace the marquee)  */
.mw-cats { padding: 28px 0 8px; background: var(--wsm-white); }
.mw-cats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mw-cats-head h2 { font-size: 1.6rem; margin: 0; }
.mw-link { color: var(--wsm-blue); font-weight: 600; text-decoration: none; white-space: nowrap; }
.mw-cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.mw-cat {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 14px 8px; border: 1px solid var(--wsm-border); border-radius: var(--wsm-radius-lg);
  background: var(--wsm-white); color: var(--wsm-text); text-decoration: none; min-height: 44px;
  transition: border-color .15s, transform .15s;
}
.mw-cat:hover, .mw-cat:focus-visible { border-color: var(--wsm-blue); transform: translateY(-2px); }
.mw-cat-icon {
  width: 48px; height: 48px; border-radius: 50%; background: var(--wsm-blue-light); color: var(--wsm-blue);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.mw-cat-icon svg, .mw-cat-icon img { width: 28px; height: 28px; object-fit: cover; }
.mw-cat-icon img { width: 100%; height: 100%; }
.mw-cat-name {
  font-family: var(--font-display); font-weight: 700; font-size: .95rem; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 900px) { .mw-cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) {
  .mw-cat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mw-cat { padding: 12px 4px; }
  .mw-cats-head h2 { font-size: 1.35rem; }
}

/*  Bottom bar on phones  */
.mw-tabbar { display: none; }
@media (max-width: 900px) {
  .mw-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: var(--wsm-white); border-top: 1px solid var(--wsm-border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px rgba(0,0,0,.06);
  }
  .mw-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 58px; padding: 6px 2px; background: none; border: 0; cursor: pointer;
    color: var(--wsm-text-muted); text-decoration: none; font: 600 .7rem/1 var(--font-body);
  }
  .mw-tab svg { width: 22px; height: 22px; }
  .mw-tab.is-current { color: var(--wsm-blue); }
  .mw-plus {
    width: 30px; height: 30px; border-radius: 50%; background: var(--wsm-yellow); color: var(--wsm-dark);
    display: flex; align-items: center; justify-content: center; font: 800 1.4rem/1 var(--font-display);
  }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .site-footer { padding-bottom: 12px; }
}

/*  Business page action bar  */
.mw-actionbar { display: none; }
@media (max-width: 900px) {
  .mw-actionbar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; z-index: 899;
    bottom: calc(58px + env(safe-area-inset-bottom));
    padding: 8px 12px; background: rgba(255,255,255,.97); border-top: 1px solid var(--wsm-border);
  }
  .mw-act {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
    border-radius: var(--wsm-radius); background: var(--wsm-blue-light); color: var(--wsm-blue);
    font: 700 .95rem/1 var(--font-body); text-decoration: none;
  }
  .mw-act-call { background: var(--wsm-blue); color: var(--wsm-white); }
  body.wsm-single-business { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
}

/*  Hero on phones  */
@media (max-width: 600px) {
  .hero { padding: 36px 0 48px; }
  .hero .display-xl { font-size: 2.6rem; }
  .hero-desc { font-size: 1rem; }
  .hero-stats { gap: 16px; }
}

/*  Directory: results visible on the first screen  */
@media (max-width: 768px) {
  .wsm-directory-header { padding: 20px 0 16px !important; }
  .wsm-directory-header h1 { font-size: 1.8rem; margin-bottom: 4px; }
  .wsm-directory-header > .container > p { display: none; }
  .wsm-dir-search-bar { display: grid !important; grid-template-columns: 1fr auto; gap: 8px !important; }
  .wsm-dir-search-field { grid-column: 1 / -1; }
  .wsm-dir-cat-select, .wsm-dir-open-label, .wsm-dir-search-btn { min-height: 44px; font-size: 16px; }
  .wsm-dir-cat-select { grid-column: 1 / 2; width: 100%; }
  .wsm-dir-open-label { grid-column: 2 / 3; padding: 0 12px !important; white-space: nowrap; }
  .wsm-dir-search-btn { grid-column: 1 / -1; }
  .wsm-dir-search-input { font-size: 16px; }
  .wsm-dir-quick-tags { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
  .wsm-dir-quick-tags::-webkit-scrollbar { display: none; }
  .wsm-dir-quick-tag { flex-shrink: 0; }

  /* Compact listing cards: photo left, details right */
  #wsm-dir-results.grid-3 { grid-template-columns: 1fr !important; gap: 10px; }
  .wsm-result-card { display: grid !important; grid-template-columns: 96px 1fr; align-items: start; }
  .wsm-result-card .card-img-link { grid-row: 1 / 3; }
  .wsm-result-card .card-img { height: 96px !important; aspect-ratio: auto; border-radius: var(--wsm-radius) 0 0 var(--wsm-radius); }
  .wsm-result-card .card-img img { height: 96px; object-fit: cover; }
  .wsm-result-card .card-body { padding: 10px 12px 4px; }
  .wsm-result-card .card-title { font-size: 1.05rem; }
  .wsm-result-card .card-desc { display: none; }
  .wsm-result-card .wsm-card-actions { grid-column: 2; padding: 0 12px 10px; }
  .wsm-card-btn { min-height: 36px; }
}

/*  What's On filters: thumb-sized  */
@media (max-width: 768px) {
  .wsm-results-bar, .wsm-events-filter-inner { display: flex; flex-wrap: wrap; gap: 8px; }
  .wsm-time-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .wsm-time-tab { min-height: 40px; display: inline-flex; align-items: center; flex-shrink: 0; }
  .wsm-filter-select, .wsm-filter-search { flex: 1 1 45%; min-height: 44px; }
  .wsm-filter-select, .wsm-filter-search input { font-size: 16px; }
  .wsm-filter-search { display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--wsm-border); border-radius: var(--wsm-radius); background: var(--wsm-white); }
  .wsm-filter-search input { min-height: 42px; width: 100%; border: 0; outline-offset: 2px; }
  .wsm-results-bar .btn, .wsm-events-filter-inner .btn { width: 100%; justify-content: center; min-height: 44px; }
}

/*  Less motion for people who ask for it  */
@media (prefers-reduced-motion: reduce) {
  .teb-ticker { animation: none !important; }
  .mw-cat { transition: none; }
}

/*  "Get listed" box: buttons stack on phones (was 120px too wide)  */
@media (max-width: 600px) {
  .add-business-cta > div:last-child { flex-shrink: 1 !important; width: 100%; }
  .add-business-cta .btn { width: 100%; justify-content: center; }
}

/*  Hero numbers clear of the curve on phones  */
@media (max-width: 600px) {
  .hero { padding-bottom: 72px; }
  .hero-stat-label { font-size: .68rem; }
}

/* Claimed badge (owner looks after the listing) */
.badge-claimed { display: inline-flex; align-items: center; gap: 4px; background: #E8F5E9; color: #1B5E20; vertical-align: middle; }
.card-body .badge-claimed { margin: -2px 0 8px; }
.wsm-single-hero .badge-claimed { background: #E8F5E9; margin-left: 8px; }

/* Page buttons (wsm_pager) */
.wsm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin: 2rem 0 1rem; }
.wsm-pager--top { margin: 0 0 1.25rem; justify-content: space-between; }
.wsm-pager-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--wsm-blue); color: #fff; font-weight: 700; text-decoration: none; font-size: 1rem; }
.wsm-pager-btn:hover { background: var(--wsm-dark, #002a5c); color: #fff; }
.wsm-pager-btn.is-disabled { background: #e5e7eb; color: #9ca3af; cursor: default; }
.wsm-pager--top .wsm-pager-btn { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.wsm-pager-info { color: var(--wsm-text-muted); font-size: .95rem; }
.wsm-pager-pages { flex-basis: 100%; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.wsm-pager-num { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--wsm-border); background: #fff; color: var(--wsm-blue); font-weight: 600; text-decoration: none; }
.wsm-pager-num:hover { border-color: var(--wsm-blue); }
.wsm-pager-num.is-current { background: var(--wsm-blue); border-color: var(--wsm-blue); color: #fff; }
.wsm-pager-dots { line-height: 40px; color: var(--wsm-text-muted); }
.wsm-pager-jump { font-size: .9rem; color: var(--wsm-text-muted); display: inline-flex; align-items: center; gap: 6px; }
.wsm-pager-jump select { min-height: 40px; border-radius: 8px; border: 1px solid var(--wsm-border); padding: 0 8px; font-size: 1rem; }
@media (max-width: 600px) {
  .wsm-pager { display: grid; grid-template-columns: 1fr 1fr; }
  .wsm-pager-info { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .wsm-pager-btn { width: 100%; }
  .wsm-pager-pages { display: none; }
  .wsm-pager-jump { grid-column: 1 / -1; justify-content: center; }
}
