/* ============================================================
   AllNaijaMarket Homepage Marketplace Showcase
   Scoped to .anm-home-discovery to avoid affecting feeds,
   dashboards, sticky header, popup or other pages.
============================================================ */

.anm-home-discovery{
  width:min(1180px,calc(100% - 24px));
  margin:16px auto 30px;
  color:#e5e7eb;
}

.anm-home-shortcuts{
  position:relative;
  display:grid;
  grid-template-columns:repeat(6,minmax(112px,1fr));
  gap:9px;
  margin-bottom:10px;
  padding:6px;
  overflow-x:auto;
  scrollbar-width:none;
  border:1px solid rgba(255,255,255,.09);
  border-radius:22px;
  background:linear-gradient(145deg,rgba(15,23,42,.97),rgba(6,78,59,.42));
  box-shadow:0 18px 50px rgba(0,0,0,.22);
}
.anm-home-shortcuts::-webkit-scrollbar{display:none}

.anm-home-shortcut{
  min-width: 60px;
  min-height:41px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  padding:5px 4px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  background:rgba(2,6,23,.55);
  color:#f8fafc;
  text-decoration:none;
  font-size:6px;
  font-weight:350;
  text-align:center;
  transition:transform .2s ease,border-color .2s ease,background .2s ease;
}
.anm-home-shortcut:hover{
  transform:translateY(-2px);
  border-color:rgba(250,204,21,.55);
  background:rgba(6,95,70,.62);
}
.anm-home-shortcut__icon{
  display:grid;
  place-items:center;
  width:17px;
  height:17px;
  border-radius:6px;
  background:linear-gradient(145deg,#166534,#064e3b);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.1);
  font-size:10px;
}

/* =====================================================
   Shop Directory Navigation
===================================================== */

.shop-directory-shortcuts{
    grid-template-columns:repeat(3,minmax(170px,1fr));
    margin:10px auto;
    width:min(650px,calc(100% - 10px));
}

.shop-directory-shortcuts .anm-home-shortcut{
    min-height:43px;
}

.shop-directory-shortcuts .anm-home-shortcut.is-active{
    background:linear-gradient(145deg,#0b6b4f,#15966d);
    border-color:#22c55e;
    color:#fff;
    transform:translateY(-2px);
    box-shadow:0 12px 28px rgba(21,150,109,.35);
}

.shop-directory-shortcuts .anm-home-shortcut.is-active
.anm-home-shortcut__icon{
    background:linear-gradient(145deg,#facc15,#eab308);
    color:#111827;
}

.shop-directory-shortcuts .anm-home-shortcut:hover{
    transform:translateY(-2px);
}

@media (max-width:700px){

    .shop-directory-shortcuts{
        grid-template-columns:repeat(3,75px);
        overflow-x:auto;
        scrollbar-width:none;
    }

    .shop-directory-shortcuts::-webkit-scrollbar{
        display:none;
    }

    .shop-directory-shortcuts .anm-home-shortcut{
        min-width:75px;
        min-height:41px;
    }

}

.anm-showcase-section{
  scroll-margin-top:100px;
  margin:0 0 22px;
  padding:18px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:24px;
  background:
    radial-gradient(circle at 90% 0,rgba(34,197,94,.13),transparent 28%),
    linear-gradient(155deg,rgba(15,23,42,.98),rgba(2,6,23,.98));
  box-shadow:0 16px 44px rgba(0,0,0,.18);
}

.anm-showcase-heading{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction: row;
  margin: 0 auto;
  text-align: center;
}
.anm-showcase-heading__eyebrow{
  display:inline-block;
  margin-bottom:4px;
  color:#86efac;
  font-size:11px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.anm-showcase-heading h2{
  color:#f8fafc;
  font-size:clamp(22px,4vw,31px);
  line-height:1;
  text-align: center;
}
.anm-showcase-heading p{
  max-width:680px;
  margin:6px 0 0;
  color:#aeb9c8;
  font-size:14px;
  line-height:1.5;
}
.anm-showcase-heading__link{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:40px;
  padding:9px 13px;
  border:1px solid rgba(250,204,21,.35);
  border-radius:999px;
  background:rgba(250,204,21,.09);
  color:#ebc403;
  text-decoration:none;
  font-size:13px;
  font-weight:900;
}

.anm-showcase-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:13px;
}
.anm-showcase-grid--markets{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.anm-discovery-card{
  position:relative;
  min-width:0;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.1);
  border-radius:19px;
  background:linear-gradient(180deg,rgba(30,41,59,.96),rgba(15,23,42,.99));
  box-shadow:0 12px 28px rgba(0,0,0,.2);
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}
.anm-discovery-card:hover{
  transform:translateY(-3px);
  border-color:rgba(74,222,128,.38);
  box-shadow:0 17px 34px rgba(0,0,0,.26);
}
.anm-discovery-card--premium{
  border-color:rgba(250,204,21,.5);
  box-shadow:0 0 0 1px rgba(250,204,21,.08),0 15px 32px rgba(0,0,0,.22);
}

.anm-discovery-card__media{
  position:relative;
  display:block;
  aspect-ratio:16/10;
  overflow:hidden;
  background:#0f172a;
}
.anm-discovery-card--product .anm-discovery-card__media{
  aspect-ratio:1/1;
}
.anm-discovery-card__media img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  transition:transform .35s ease;
}
.anm-discovery-card:hover .anm-discovery-card__media img{transform:scale(1.035)}
.anm-discovery-card__media::after{
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:45%;
  background:linear-gradient(transparent,rgba(2,6,23,.86));
  pointer-events:none;
}

.anm-discovery-card__type{
  position:absolute;
  z-index:2;
  left:9px;
  bottom:9px;
  max-width:calc(100% - 18px);
  padding:5px 8px;
  border-radius:999px;
  background:rgba(6,95,70,.9);
  color:#fff;
  font-size:10px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
  backdrop-filter:blur(8px);
}
.anm-discovery-card__verified{
  position:absolute;
  z-index:3;
  top:9px;
  right:9px;
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border:2px solid #fff;
  border-radius:50%;
  background:#16a34a;
  color:#fff;
  font-size:14px;
  font-weight:1000;
  box-shadow:0 5px 15px rgba(0,0,0,.3);
}
.anm-discovery-card__premium{
  position:absolute;
  z-index:3;
  top:9px;
  left:9px;
  padding:5px 8px;
  border-radius:999px;
  background:linear-gradient(135deg,#facc15,#eab308);
  color:#10210f;
  font-size:9px;
  font-weight:1000;
  box-shadow:0 5px 16px rgba(0,0,0,.28);
}

.anm-discovery-card__body{
  display:flex;
  min-height:190px;
  flex-direction:column;
  padding:12px;
}
.anm-discovery-card__body h3{
    display:-webkit-box;
    margin:0 0 5px;
    overflow:hidden;
    color:#f8fafc;
    font-size:15px;
    line-height:1.28;
    -webkit-box-orient:vertical;
    line-clamp:2;
    -webkit-line-clamp:2;
}

.anm-discovery-card__body h3 a{color:inherit;text-decoration:none}
.anm-discovery-card__meta,
.anm-discovery-card__location,
.anm-discovery-card__service-area,
.anm-discovery-card__distance{
  margin:0 0 5px;
  color:#b9c4d2;
  font-size:11.5px;
  line-height:1.38;
}
.anm-discovery-card__location{color:#d5b78d}
.anm-discovery-card__service-area{color:#c4b5fd}
.anm-discovery-card__distance{
  color:#fbbf24;
  font-weight:800;
}
.anm-discovery-card__price{
  margin:0 0 6px;
  color:#fde047;
  font-size:16px;
  font-weight:1000;
}
.anm-card-rating{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:5px;
  margin:3px 0 9px;
  color:#cbd5e1;
  font-size:10.5px;
}
.anm-card-rating__stars{color:#facc15}
.anm-discovery-card__action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:37px;
  margin-top:auto;
  padding:8px 10px;
  border-radius:11px;
  background:linear-gradient(135deg,#facc15,#eab308);
  color:#10210f;
  text-decoration:none;
  font-size:12px;
  font-weight:1000;
  box-shadow:0 7px 18px rgba(234,179,8,.16);
}

.anm-showcase-empty{
  padding:24px 16px;
  border:1px dashed rgba(255,255,255,.15);
  border-radius:16px;
  background:rgba(255,255,255,.025);
  color:#aeb9c8;
  text-align:center;
}

@media(max-width:920px){
  .anm-showcase-grid,
  .anm-showcase-grid--markets{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:680px){
  .anm-home-discovery{
    width:min(100% - 16px,1180px);
    margin-top:10px;
  }
  .anm-home-shortcuts{
    grid-template-columns:repeat(6,104px);
    gap:8px;
    padding:9px;
    border-radius:18px;
  }
  .anm-home-shortcut{
    min-width:104px;
    min-height:72px;
    border-radius:14px;
    font-size:10px;
  }
  .anm-home-shortcut__icon{
    width:34px;
    height:34px;
    font-size:18px;
  }
  .anm-showcase-section{
    margin-bottom:13px;
    padding:12px;
    border-radius:18px;
  }
  .anm-showcase-heading{
    align-items:center;
    margin-bottom:5px;
  }
  .anm-showcase-heading h2{font-size:21px}
  .anm-showcase-heading p{
  
    font-size:11.5px;
  }
  .anm-showcase-heading__link{
    min-height:34px;
    padding:7px 10px;
    font-size:12px;
  }
  .anm-showcase-grid,
  .anm-showcase-grid--markets,
  .anm-showcase-grid--products{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .anm-discovery-card{border-radius:14px}
  .anm-discovery-card__media{aspect-ratio:4/3}
  .anm-discovery-card--product .anm-discovery-card__media{aspect-ratio:1/1}
  .anm-discovery-card__body{
    min-height:162px;
    padding:9px;
  }
  .anm-discovery-card__body h3{
    margin-bottom:4px;
    font-size:12.5px;
  }
  .anm-discovery-card__meta,
  .anm-discovery-card__location,
  .anm-discovery-card__service-area,
  .anm-discovery-card__distance{
    margin-bottom:4px;
    font-size:9.5px;
  }
  .anm-discovery-card__price{font-size:14px}
  .anm-card-rating{
    margin:2px 0 7px;
    font-size:9px;
  }
  .anm-discovery-card__action{
    min-height:32px;
    border-radius:9px;
    padding:6px 7px;
    font-size:10px;
  }
  .anm-discovery-card__type{
    left:6px;
    bottom:6px;
    padding:4px 6px;
    font-size:8px;
  }
  .anm-discovery-card__premium{
    top:6px;
    left:6px;
    padding:4px 6px;
    font-size:7px;
  }
  .anm-discovery-card__verified{
    top:6px;
    right:6px;
    width:23px;
    height:23px;
    font-size:11px;
  }
}

@media(max-width:360px){
  .anm-showcase-grid,
  .anm-showcase-grid--markets,
  .anm-showcase-grid--products{
    grid-template-columns:1fr;
  }
}

@media(prefers-reduced-motion:reduce){
  .anm-home-shortcut,
  .anm-discovery-card,
  .anm-discovery-card__media img{transition:none}
}


/* Horizontal homepage discovery rails: 10 records + final View All card */
.anm-showcase-scroll{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(230px,270px);
  gap:13px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:2px 2px 12px;
  scroll-snap-type:x proximity;
  scrollbar-width:thin;
  scrollbar-color:rgba(74,222,128,.55) rgba(255,255,255,.05);
  overscroll-behavior-inline:contain;
}
.anm-showcase-scroll::-webkit-scrollbar{height:8px}
.anm-showcase-scroll::-webkit-scrollbar-track{background:rgba(255,255,255,.05);border-radius:999px}
.anm-showcase-scroll::-webkit-scrollbar-thumb{background:rgba(74,222,128,.55);border-radius:999px}
.anm-showcase-scroll>.anm-discovery-card,
.anm-showcase-scroll>.anm-view-all-card{scroll-snap-align:start}
.anm-showcase-scroll .anm-discovery-card{height:100%}

.anm-view-all-card{
  min-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:22px 16px;
  border:1px dashed rgba(250,204,21,.55);
  border-radius:19px;
  background:
    radial-gradient(circle at 50% 10%,rgba(250,204,21,.18),transparent 42%),
    linear-gradient(155deg,rgba(6,78,59,.92),rgba(2,6,23,.98));
  color:#fff;
  text-align:center;
  text-decoration:none;
  scroll-snap-align:start;
}
.anm-view-all-card:hover{border-style:solid;transform:translateY(-2px)}
.anm-view-all-card__icon{
  display:grid;place-items:center;width:58px;height:58px;border-radius:18px;
  background:rgba(250,204,21,.14);font-size:29px
}
.anm-view-all-card strong{font-size:17px}
.anm-view-all-card span:not(.anm-view-all-card__icon){color:#cbd5e1;font-size:12px;line-height:1.45}
.anm-view-all-card b{
  display:grid;place-items:center;width:36px;height:36px;border-radius:50%;
  background:linear-gradient(135deg,#facc15,#eab308);color:#10210f;font-size:20px
}

@media(max-width:680px){
  .anm-showcase-scroll{
    grid-auto-columns:minmax(158px,72vw);
    gap:8px;
    padding-bottom:9px;
  }
  .anm-view-all-card{border-radius:14px;padding:17px 12px}
  .anm-view-all-card__icon{width:48px;height:48px;border-radius:15px;font-size:24px}
  .anm-view-all-card strong{font-size:14px}
}


/* ============================================================
   Compact page navigation — homepage, shop view and market view
============================================================ */
.anm-home-shortcuts,
.anm-page-shortcuts{
  width:100%;
  box-sizing:border-box;
  display:grid;
  gap:5px;
  padding:5px;
  overflow:visible;
  border-radius:14px;
}
.anm-home-shortcuts{grid-template-columns:repeat(6,minmax(0,1fr))}
.anm-page-shortcuts{grid-template-columns:repeat(var(--anm-shortcut-count,4),minmax(0,1fr));margin:10px auto 14px}
.anm-home-shortcut,
.anm-page-shortcut{
  min-width:0!important;
  min-height:38px!important;
  padding:4px 2px!important;
  border-radius:8px!important;
  font-size:8.5px!important;
  font-weight:800!important;
  line-height:1.1;
  overflow:hidden;
}
.anm-home-shortcut__icon,
.anm-page-shortcut__icon{
  width:20px!important;
  height:20px!important;
  border-radius:6px!important;
  font-size:11px!important;
}
.anm-home-shortcut>span:last-child,
.anm-page-shortcut>span:last-child{
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.anm-page-shortcuts{
  border:1px solid rgba(255,255,255,.09);
  background:linear-gradient(145deg,rgba(15,23,42,.97),rgba(6,78,59,.42));
  box-shadow:0 10px 28px rgba(0,0,0,.18);
}
.anm-page-shortcut{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(2,6,23,.55);
  color:#f8fafc;
  text-align:center;
  text-decoration:none;
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.anm-page-shortcut:hover,.anm-page-shortcut:focus-visible{
  transform:translateY(-1px);
  border-color:rgba(250,204,21,.48);
  background:rgba(6,95,70,.62);
  outline:none;
}
.anm-page-shortcut__icon{display:grid;place-items:center;background:linear-gradient(145deg,#166534,#064e3b)}
.anm-market-live-updates{margin-top:16px;padding:16px;border:1px solid rgba(255,255,255,.09);border-radius:20px;background:linear-gradient(155deg,rgba(15,23,42,.98),rgba(2,6,23,.98));box-shadow:0 16px 40px rgba(0,0,0,.18)}
.anm-market-live-updates__heading{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:12px}
.anm-market-live-updates__heading h2{margin:0;font-size:clamp(18px,3vw,25px)}
.anm-market-live-updates__heading p{margin:4px 0 0;color:#aeb9c8;font-size:12px}
.anm-market-live-updates__count{flex:0 0 auto;padding:6px 9px;border-radius:999px;background:rgba(34,197,94,.11);color:#86efac;font-size:10px;font-weight:900}
@media(max-width:680px){
 .anm-home-shortcuts,.anm-page-shortcuts{gap:3px;padding:4px;border-radius:11px}
 .anm-home-shortcut,.anm-page-shortcut{min-height:34px!important;padding:3px 1px!important;font-size:6.8px!important;border-radius:6px!important}
 .anm-home-shortcut__icon,.anm-page-shortcut__icon{width:17px!important;height:17px!important;font-size:9px!important}
 .anm-market-live-updates{padding:11px;border-radius:15px}
 .anm-market-live-updates__heading{align-items:flex-start}
}
@media(max-width:390px){
 .anm-home-shortcut,.anm-page-shortcut{font-size:6.2px!important}
 .anm-home-shortcut__icon,.anm-page-shortcut__icon{width:15px!important;height:15px!important;font-size:8px!important}
}




/* =========================================================
   SMART STICKY SHOWCASE NAVIGATION
========================================================= */

:root {
    --anm-sticky-header-bottom: 0px;
}

.anm-sticky-showcase-marker {
    display: block;
    width: 100%;
    height: 1px;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.anm-sticky-showcase-spacer {
    width: 100%;
    margin: 0;
    padding: 0;
}

.anm-sticky-showcase-spacer[hidden] {
    display: none !important;
}

[data-sticky-showcase] {
    /*
     * Keeps the navigation above page content while allowing
     * the main sticky header to remain above it.
     */
    z-index: 950;
}

[data-sticky-showcase].is-showcase-sticky {
    position: fixed;
    top: var(--anm-sticky-header-bottom);
    left: 50%;
    width: min(1180px, calc(100% - 20px));
    margin: 0;
    transform: translateX(-50%);
    z-index: 950;

    border-color: rgba(134, 239, 172, .22);
    border-radius: 0 0 16px 16px;

    background:
        linear-gradient(
            145deg,
            rgba(15, 23, 42, .96),
            rgba(6, 78, 59, .92)
        );

    box-shadow:
        0 12px 30px rgba(2, 6, 23, .32),
        inset 0 1px 0 rgba(255, 255, 255, .06);

    backdrop-filter: blur(17px);
    -webkit-backdrop-filter: blur(17px);

    animation: anmShowcaseStickyEnter .2s ease-out;
}

@keyframes anmShowcaseStickyEnter {
    from {
        opacity: .65;
        transform: translate(-50%, -6px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/*
 * Current visible section.
 */
[data-sticky-showcase] .anm-home-shortcut.is-current-section {
    border-color: rgba(250, 204, 21, .72);
    background:
        linear-gradient(
            145deg,
            rgba(22, 163, 74, .92),
            rgba(6, 95, 70, .96)
        );
    color: #ffffff;
    box-shadow:
        0 7px 17px rgba(0, 0, 0, .22),
        inset 0 0 0 1px rgba(255, 255, 255, .08);
}

[data-sticky-showcase]
.anm-home-shortcut.is-current-section
.anm-home-shortcut__icon {
    background:
        linear-gradient(145deg, #facc15, #eab308);
    color: #17210d;
}

/*
 * Tap feedback without changing the navigation dimensions.
 */
[data-sticky-showcase] .anm-home-shortcut:active {
    transform: scale(.96);
}

/*
 * Prevent anchor targets from hiding beneath the sticky header
 * and sticky showcase navigation.
 */
.anm-showcase-section,
.anm-shop-section,
.anm-shop-feed,
.shop-products,
.shop-reviews,
.market-directory-section,
.market-directory-map-callout,
.market-live-updates {
    scroll-margin-top:
        calc(var(--anm-sticky-header-bottom) + 76px);
}

@media (max-width: 680px) {
    [data-sticky-showcase].is-showcase-sticky {
        width: calc(100% - 8px);
        border-radius: 0 0 13px 13px;
        padding: 4px;
    }

    [data-sticky-showcase].is-showcase-sticky
    .anm-home-shortcut {
        min-height: 38px;
        padding: 4px 2px;
    }

    [data-sticky-showcase].is-showcase-sticky
    .anm-home-shortcut__icon {
        width: 20px;
        height: 20px;
        border-radius: 6px;
        font-size: 11px;
    }

    [data-sticky-showcase].is-showcase-sticky
    .anm-home-shortcut > span:last-child {
        font-size: 8px;
        line-height: 1.1;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-sticky-showcase].is-showcase-sticky {
        animation: none;
    }

    [data-sticky-showcase] .anm-home-shortcut {
        scroll-behavior: auto;
    }
}


/* ============================================================
   ALLNAIJAMARKET — SAFE AUTOMATIC LIGHT / DARK MODE OVERRIDES
   Append-only compatibility layer. Existing selectors and states preserved.
============================================================ */
:root {
  color-scheme: light dark;
  --anm-auto-bg: #f5f7f6;
  --anm-auto-surface: #ffffff;
  --anm-auto-surface-2: #f8faf9;
  --anm-auto-text: #17211d;
  --anm-auto-muted: #66756e;
  --anm-auto-border: rgba(15, 75, 52, .14);
  --anm-auto-green: #087a52;
  --anm-auto-green-soft: #e8f7ef;
  --anm-auto-gold: #d7a900;
  --anm-auto-shadow: 0 12px 32px rgba(15, 23, 42, .09);
}

@media (prefers-color-scheme: dark) {
  :root {
    --anm-auto-bg: #07110d;
    --anm-auto-surface: #0d1914;
    --anm-auto-surface-2: #122019;
    --anm-auto-text: #f1f7f4;
    --anm-auto-muted: #a8b8b0;
    --anm-auto-border: rgba(180, 225, 203, .13);
    --anm-auto-green: #39d98a;
    --anm-auto-green-soft: rgba(34, 197, 94, .12);
    --anm-auto-gold: #f6cf3d;
    --anm-auto-shadow: 0 16px 40px rgba(0, 0, 0, .28);
  }
}

/* Generic surfaces are intentionally limited to common page components. */
@media (prefers-color-scheme: light) {
  .search-container, .card, .product-card, .promote-card, .shop-picker,
  .activate-container, .form-card, .pay-card, .upload-card,
  .nearby-summary, .slot-card, .popup-box, .modal-box {
    background: var(--anm-auto-surface);
    color: var(--anm-auto-text);
    border-color: var(--anm-auto-border);
    box-shadow: var(--anm-auto-shadow);
  }

  .markets-page-hero, .premium-section-title,
  .homepage-location-discovery, .anm-showcase-section,
  .anm-page-shortcuts, .anm-market-live-updates {
    color: var(--anm-auto-text);
  }

  .markets-page-hero {
    background: linear-gradient(135deg,#edf8f2,#f8faf9);
    border: 1px solid var(--anm-auto-border);
  }
  .markets-page-hero h1,
  .promote-header h2, .upload-hero h1,
  .premium-section-title, .product-info h1,
  .related-section h3, .saved-header h2 {
    color: var(--anm-auto-text);
  }
  .markets-page-hero p, .promote-header p, .upload-hero p,
  .saved-header p, .desc, .nearby-summary__message {
    color: var(--anm-auto-muted);
  }

  .marketSearch,
  .promote-form select, .promote-form input,
  .qty-wrapper, .price-box, .total-box,
  .upload-card input, .upload-card select, .upload-card textarea,
  .form-card input[type="email"], .form-card input[type="password"],
  .form-card input[type="phone"], .form-card input[type="text"],
  .activate-container input, .activate-container select {
    background: #fff;
    color: #17211d;
    border-color: #cfdad4;
  }

  .related-item, .image-box, .image-view,
  .main-image-container, .gallery-wrapper {
    background: #f3f7f5;
    border-color: var(--anm-auto-border);
  }
  .related-item h4 { color: var(--anm-auto-text); }

  .chat-list li { border-color: var(--anm-auto-border); }
  .chat-list a { color: var(--anm-auto-text); }
  .chat-list a:hover { background: #eef7f2; }
  .chat-list span, .time { color: var(--anm-auto-muted); }

  .saved-shops-wrapper .shop-card,
  .saved-shops-wrapper .empty-state {
    background: rgba(255,255,255,.9);
    border-color: var(--anm-auto-border);
    color: var(--anm-auto-text);
  }
  .saved-shops-wrapper .shop-body h3,
  .saved-shops-wrapper .shop-market,
  .saved-shops-wrapper .shop-description {
    color: var(--anm-auto-text);
  }
  .saved-shops-wrapper .saved-date { color: var(--anm-auto-muted); }
  .saved-shops-wrapper .shop-market { background: #edf5f1; }

  .homepage-location-discovery {
    background: linear-gradient(145deg,#fff,#eef8f2);
    border-color: rgba(8,122,82,.18);
    box-shadow: var(--anm-auto-shadow);
  }
  .homepage-location-discovery__summary-copy strong,
  .homepage-location-discovery__action h2,
  .nearby-summary__heading h3 { color: var(--anm-auto-text); }
  .homepage-location-discovery__summary-copy small,
  .homepage-location-discovery__action p,
  .nearby-summary__updated,
  .nearby-summary__nearest-label { color: var(--anm-auto-muted); }
  .nearby-summary, .nearby-summary__card { background: #fff; color: var(--anm-auto-text); }
  .nearby-summary__card--primary { background: linear-gradient(135deg,#e9f8ef,#fff); }

  .anm-home-shortcuts, .anm-page-shortcuts {
    background: linear-gradient(145deg,#fff,#edf8f2);
    border-color: var(--anm-auto-border);
    box-shadow: var(--anm-auto-shadow);
  }
  .anm-home-shortcut, .anm-page-shortcut {
    background: rgba(255,255,255,.82);
    color: var(--anm-auto-text);
    border-color: var(--anm-auto-border);
  }
  .anm-showcase-section, .anm-market-live-updates {
    background: linear-gradient(155deg,#fff,#f4f8f6);
    border-color: var(--anm-auto-border);
    box-shadow: var(--anm-auto-shadow);
  }
  .anm-showcase-heading h2, .anm-discovery-card__body h3 { color: var(--anm-auto-text); }
  .anm-showcase-heading p, .anm-discovery-card__meta,
  .anm-discovery-card__service-area, .anm-card-rating { color: var(--anm-auto-muted); }
  .anm-discovery-card {
    background: #fff;
    border-color: var(--anm-auto-border);
    box-shadow: 0 9px 24px rgba(15,23,42,.08);
  }

  .pay-shell { background: radial-gradient(circle at 15% 5%,rgba(34,197,94,.12),transparent 34%),#f3f7f5; }
  .pay-card h1, .pay-row strong { color: var(--anm-auto-text); }
  .pay-card p, .pay-row, .pay-security { color: var(--anm-auto-muted); }

  .anm-launch-popup__panel {
    color: var(--anm-auto-text);
    background: linear-gradient(145deg,#f7fbf9,#fff);
    border-color: var(--anm-auto-border);
  }
  .anm-launch-popup__content h1 { color: var(--anm-auto-text); }
  .anm-launch-popup__lead, .anm-launch-popup__seller-message p { color: var(--anm-auto-muted); }
  .anm-launch-popup__seller-message { background: #eef8f2; border-color: var(--anm-auto-border); }
  .anm-launch-popup__seller-message strong { color: var(--anm-auto-text); }
  .anm-launch-popup__highlights span { color: #185d42; background: #edf8f2; border-color: var(--anm-auto-border); }
  .anm-launch-popup__button--secondary { color: #155b40; background: #edf8f2; border-color: var(--anm-auto-border); }
  .anm-launch-popup__continue { color: #66756e; }

  .amb-public-shell { background: linear-gradient(145deg,#eef8f2,#f8fafc); }
  .amb-public-card { background:#fff; color:#0f172a; }

  .anm-market-directory {
    --anm-bg:#f4f7f5; --anm-surface:#fff; --anm-surface-deep:#f4f8f6;
    --anm-surface-soft:#edf4f0; --anm-border:#d9e4de; --anm-border-strong:#c6d5cd;
    --anm-text:#14211b; --anm-text-soft:#52635a; --anm-muted:#718078;
    --anm-green:#087a52; --anm-green-dark:#066844; --anm-green-deep:#05583b;
    --anm-shadow:0 14px 38px rgba(15,23,42,.10);
  }
  .anm-market-directory .market-directory-section,
  .anm-market-directory .market-directory-board,
  .anm-market-directory .anmis-search-panel,
  .anm-market-directory .anmis-filter-empty {
    background:#fff;
  }
  .anm-market-directory .anmis-search-control { background:#f5f8f6; border-color:#d2ddd7; }
  .anm-market-directory .anmis-search-control input { color:#17211d; }
  .anm-market-directory .market-directory-breadcrumb { background:#f5f8f6; }

  .leaflet-bar a, .leaflet-control-layers,
  .leaflet-control-layers-expanded, .leaflet-popup-content-wrapper,
  .leaflet-popup-tip, .leaflet-tooltip {
    background:#fff;
    color:#222;
  }
}

@media (prefers-color-scheme: dark) {
  body { color-scheme: dark; }

  .search-container, .card, .product-card, .promote-card, .shop-picker,
  .activate-container, .form-card, .popup-box, .modal-box {
    background: var(--anm-auto-surface);
    color: var(--anm-auto-text);
    border-color: var(--anm-auto-border);
  }
  .shop-picker__label, .activate-container form label,
  .activate-container .comments { color: var(--anm-auto-text); }
  .shop-picker__select, .activate-container input, .activate-container select {
    background:#09140f; color:#f1f7f4; border-color:#2b4036;
  }
  .popup-box, .modal-box { color:#f1f7f4; }
  .profile-avatar input, .password-box input {
    background:#09140f; color:#f1f7f4; border-color:#2b4036;
  }
  .danger-zone, .help-options, .pause-box {
    background:#0d1914; color:#f1f7f4; border-color:#2b4036;
  }
  .danger-note, .help-options li { color:#a8b8b0; }

  .leaflet-bar a, .leaflet-control-layers,
  .leaflet-control-layers-expanded, .leaflet-popup-content-wrapper,
  .leaflet-popup-tip, .leaflet-tooltip {
    background:#101b16;
    color:#eef7f2;
    border-color:#2b4036;
  }
  .leaflet-bar a { border-bottom-color:#2b4036; color:#eef7f2; }
  .leaflet-bar a:hover, .leaflet-bar a:focus,
  .leaflet-bar a.leaflet-disabled { background:#17261f; }
  .leaflet-container .leaflet-control-attribution,
  .leaflet-control-scale-line { background:rgba(16,27,22,.88); color:#d6e2dc; text-shadow:none; }
  .leaflet-tooltip-top:before { border-top-color:#101b16; }
  .leaflet-tooltip-bottom:before { border-bottom-color:#101b16; }
  .leaflet-tooltip-left:before { border-left-color:#101b16; }
  .leaflet-tooltip-right:before { border-right-color:#101b16; }
}

@media (max-width: 680px) {
  .search-container, .card, .promote-card, .form-card, .activate-container {
    width: calc(100% - 16px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
  .search-container { margin-top: 16px; padding: 15px; }
  .saved-shops-wrapper { padding-inline: 10px; }
  .saved-grid { grid-template-columns: minmax(0,1fr); }
  .shop-image { height: clamp(220px,72vw,300px); }
  .product-grid { margin-inline: 8px; gap: 18px; }
  .product-card { padding: 12px; border-radius: 15px; }
  .main-image-container { height: min(72vw,320px); }
  .action-buttons, .share-row { width:100%; }
  .action-buttons > *, .share-row > * { flex:1 1 130px; text-align:center; }
  .slot-grid { grid-template-columns: minmax(0,1fr); margin-inline:8px; }
  .total-bar { padding:10px 12px calc(12px + env(safe-area-inset-bottom)); gap:10px; }
  .login-container { padding:12px; }
  .form-card { padding:26px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}



/* ===== Nearest shops - Location Discovery ===== */
.nearby-summary__nearest{
    display:block;
    margin-top:18px;
    padding:0;
    background:transparent;
    border:0;
}

.nearby-summary__nearest-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
}

.nearby-summary__nearest-title strong{
    font-size:.95rem;
    color:inherit;
}

.nearby-summary__nearest-title span{
    font-size:.76rem;
    opacity:.72;
}

.nearby-shops-list{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:10px;
}

.nearby-shop-card{
    min-width:0;
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px;
    border:1px solid rgba(148,163,184,.18);
    border-radius:16px;
    background:linear-gradient(145deg,rgba(255,255,255,.08),rgba(255,255,255,.025));
    color:inherit;
    text-decoration:none;
    transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}

.nearby-shop-card:hover{
    transform:translateY(-2px);
    border-color:rgba(24,184,120,.55);
    box-shadow:0 10px 24px rgba(0,0,0,.12);
}

.nearby-shop-card__rank{
    flex:0 0 30px;
    width:30px;
    height:30px;
    border-radius:10px;
    display:grid;
    place-items:center;
    font-size:.78rem;
    font-weight:900;
    color:#fff;
    background:linear-gradient(135deg,#18b878,#0a8f5c);
}

.nearby-shop-card__copy{
    min-width:0;
    display:grid;
    gap:2px;
    flex:1;
}

.nearby-shop-card__copy strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:.86rem;
}

.nearby-shop-card__copy small{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    opacity:.68;
    font-size:.72rem;
}

.nearby-shop-card__distance{
    flex:0 0 auto;
    font-size:.74rem;
    font-weight:800;
    white-space:nowrap;
    color:#18b878;
}

@media (max-width:900px){
    .nearby-shops-list{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media (max-width:520px){
    .nearby-shops-list{
        grid-template-columns:1fr;
    }

    .nearby-shop-card{
        padding:11px 12px;
    }
}

@media (prefers-reduced-motion:reduce){
    .nearby-shop-card{
        transition:none;
    }
    .nearby-shop-card:hover{
        transform:none;
    }
}


/* ============================================================
   PUBLIC DIRECTORY GRID — HOMEPAGE CARDS, WRAPPED VERTICALLY
   Same discovery cards as the homepage, but directories do not
   scroll horizontally. Phone screens show two cards side-by-side.
============================================================ */
.directory-default-state .market-grid,
.directory-default-state .shop-directory-grid,
.anm-directory-showcase-grid{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:13px;
    width:100%;
    align-items:stretch;
}

.directory-default-state .anm-discovery-card,
.anm-directory-showcase-grid .anm-discovery-card{
    width:100%;
    min-width:0;
    max-width:none;
    height:100%;
}

@media(max-width:1180px){
    .directory-default-state .market-grid,
    .directory-default-state .shop-directory-grid,
    .anm-directory-showcase-grid{
        grid-template-columns:repeat(4,minmax(0,1fr));
    }
}

@media(max-width:920px){
    .directory-default-state .market-grid,
    .directory-default-state .shop-directory-grid,
    .anm-directory-showcase-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}

@media(max-width:680px){
    .directory-default-state .market-grid,
    .directory-default-state .shop-directory-grid,
    .anm-directory-showcase-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:8px;
    }
}

/*
 * Only an exceptionally narrow viewport may fall back to one column.
 * Normal phone widths remain two cards across.
 */
@media(max-width:280px){
    .directory-default-state .market-grid,
    .directory-default-state .shop-directory-grid,
    .anm-directory-showcase-grid{
        grid-template-columns:1fr;
    }
}


/* =========================================================
   DIRECTORY SEARCH — ALWAYS ABOVE MARKETPLACE CARDS
========================================================= */

.markets-page-hero{
    position:relative;
    z-index:100;
    overflow:visible;
}

.hero-inner{
    position:relative;
    overflow:visible;
}

.anm-directory-search,
.search-bar-wrapper{
    position:relative;
    z-index:110;
    overflow:visible;
}

.anm-directory-search__panel{
    position:absolute;
    z-index:120;

    top:100%;
    left:0;
    right:0;

    width:100%;
}

/* Marketplace content remains below search */
.markets{
    position:relative;
    z-index:1;
}

.anm-discovery-card{
    position:relative;
    z-index:1;
}