/* =========================================================
   DISTRIBUTORS (cleaned for tray-only layout)
   ========================================================= */
.distributor {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    padding: var(--vspace-2) 0;
    margin-top: 80px;
}

/* Head */
.distributor-head {
    display: flex;
    align-items: center;
    padding: 0 0 var(--vspace-1_5) 0;
    position: relative;
    z-index: 0;
}

.distributor-title {
    line-height: 1;
    color: var(--color-black);
    padding: 0 0 0 calc(var(--gutter) * 2);
    position: relative;
    font-family: 'Monument Extended Ultra Bold';
    margin: 0;
}

.distributor-map {
    line-height: 1;
    color: var(--color-black);
    padding: 0 calc(var(--gutter) * 2);
    position: relative;
    font-family: 'Monument Extended Ultra Bold';
    margin: 0;
}

/* =========================================================
   CARD (tray variant – compact)
   ========================================================= */
.distributor-card { /* base kept for compatibility */
    position: relative;
    margin: 0;
    transition: 0.3s;
}

.distributor-card--tray .distributor-detail {
    /* use tray's dark .map-card background; keep content tight */
    background: transparent;
    width: 100%;
    padding: 10px 12px 8px;
    aspect-ratio: auto;
    font-family: 'Monument Extended Regular';
}

.distributor-detail .date {
    margin-bottom: var(--vspace-0_25);
}

.distributor-detail .date p {
    font-family: 'Montserrat Medium';
    font-size: var(--text-xs);
    line-height: 1.1;
}

.distributor-detail .header {
    margin-bottom: var(--vspace-0_375);
}

.distributor-detail .header a {
    font-family: 'Monument Extended Ultra Bold';
    font-size: var(--text-md);
    font-weight: 400;
    color: var(--color-black);
    line-height: 1.15;
}

.distributor-detail .title {
    margin-bottom: var(--vspace-0_25);
}

.distributor-detail .title .a,
.distributor-detail .title p {
    font-family: 'Monument Extended Regular';
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-black);
}

.distributor-detail .subtitle {
    margin-bottom: var(--vspace-0_25);
}

.distributor-detail .subtitle p,
.distributor-detail .subtitle {
    font-family: 'Montserrat Medium';
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-black);
    line-height: 1.35;
}

/* Small, iconized rows inside tray card (no .row/.column) */
.tray-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 8px;
}

.tray-icon {
    flex: 0 0 auto;
    line-height: 0;
}

.tray-text .title {
    font-size: var(--text-xs);
    opacity: 0.8;
    margin-bottom: 4px;
}

.tray-text .subtitle {
    font-size: var(--text-xs);
    line-height: 1.35;
}

/* Make tray cards visually smaller without changing your inline #map-tray grid */
.map-card {
    padding: 15px !important;
    margin: 2px;
    min-height: 96px;
}

/* =========================================================
   FILTERS (deduped & kept)
   ========================================================= */
.filters {
    text-align: left;
    margin-bottom: 20px;
    /* padding: 0 calc(var(--gutter) * 3 + var(--vspace-0_25)); */
}

.filters.region {
    margin: 0px;
}

.filters-title {
    font-family: 'Montserrat Medium';
    text-transform: uppercase;
    font-size: var(--text-sm);
    margin-bottom: 10px;
    color: var(--color-black);
    letter-spacing: 0.5px;
}

/* Dropdown */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
    font-family: 'Monument Extended Regular';
    cursor: pointer;
    user-select: none;
    width: var(--vspace-10);
    margin: 5px 0;
}

.dropdown-wrapper.disabled { opacity: 0.6; pointer-events: none; }

.dropdown-toggle {
    padding: 10px 20px;
    background: #ddd;
    border-radius: 5px;
    font-size: var(--text-sm);
    transition: background 0.3s ease;
}

.dropdown-toggle:hover { background: #ccc; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 10;
    pointer-events: none;
}

.dropdown-wrapper.open .dropdown-menu {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
    z-index: 999;
}

.dropdown-menu li {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}
.dropdown-menu li:last-child { border-bottom: none; }
.dropdown-menu li:hover { background: #f0f0f0; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media screen and (max-width: 900px) {
    .distributor-title { padding: 0 0 0 calc(var(--gutter) * 1); }
    .distributor-map   { padding: 0 0 0 calc(var(--gutter) * 1); }
    /* .filters { padding: 0 calc(var(--gutter) * 2 + var(--vspace-0_25)); } */

    .distributor-detail .header a { font-size: var(--text-sm); }
    .tray-text .subtitle { font-size: calc(var(--text-xs) * 0.95); }
}

@media screen and (max-width: 750px) {
    .distributor-title { padding: 0 0 0 calc(var(--gutter) * 0.5); font-size: var(--text-xxxl); }
    .distributor-map   { padding: 0 0 0 calc(var(--gutter) * 0.5); }
    /* .filters           { padding: 0 calc(var(--gutter) * 1.5 + var(--vspace-0_25)); } */
}

@media screen and (max-width: 650px) {
    .distributor-title { font-size: var(--text-xxl); }
}

/* =========================================================
   REMOVED (previously unused by new layout)
   - .distributor-body, ::before, .distributor-body-wrapper, .distributor-card-wrapper
   - .distributor-category, .distributor-img iframe
   - .distributor-detail aspect-ratio forcing + .row/.column styling
   - filters button-based styles (you now use dropdowns)
   ========================================================= */

/* map */
#leaflet-map { width: 100%; height: 500px; border-radius: 8px; }

/* Bottom tray – light, near white */
#map-tray{
  position: sticky; bottom: 0; z-index: 5;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.92);
  border: 1px solid #e6e7ea;
  padding: 12px; display: grid; gap: 12px;
  margin-top: 8px; border-radius: 8px;
}
#map-tray .handle{ width:44px; height:4px; border-radius:999px; background:#dadde3; margin:0 auto; }

/* Scroller of cards */
#map-card-list{
  display: flex;
  flex-flow: row wrap;
  /* display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(300px,340px); */
  /* gap:12px; */
  overflow-x:auto;
  padding-bottom:4px;
}

/* Card */
.map-card{
  border:1px solid #e6e7ea;
  border-radius:12px;
  padding:14px;
  background:#f9fafb;                  /* light gray */
  min-height:500px;                     /* not too big */
  display:flex;                         /* so we can push actions to bottom */
  flex-direction:column;
  color:#101214;
}
.map-card h4{ margin:0; font-size:16px; color:#0d0f12; font-weight:700; }
.map-card .meta{ display:grid; gap:2px; font-size:12px; color:#4b5563; }

/* Make the action row sit at the bottom of each card */
.distributor-card--tray,
.distributor-card--tray .distributor-detail{
  display:flex; flex-direction:column; flex:1; background:transparent; padding:0;
}
.map-actions{ 
    margin-top: auto;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Buttons */
.map-btn{
  appearance:none;
  border:1px solid #d0d5dd;
  background:#fff;
  color:#111827;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
}
.map-btn.primary{
  background:#22c55e;   /* green */
  color:#0b1412;
  border-color:#22c55e;
}

a.map-btn{
    appearance:none;
    border:1px solid #d0d5dd;
    background:#fff;
    color:#111827;
    padding:8px 12px;
    border-radius:10px;
    cursor:pointer;
    font-family: 'Montserrat Medium';
    font-size: small;
}

a.map-btn.primary{
  background:#22c55e;   /* green */
  color:#0b1412;
  border-color:#22c55e;
  scroll-behavior: smooth !important;
}

/* Icons & small layout in tray cards */
.distributor-card--tray .row{
  display:grid;
  grid-template-columns:24px 1fr;
  column-gap:8px;
  align-items:start;
  margin-top:10px;
}
.distributor-card--tray .row svg{ margin-top:2px; }
.distributor-card--tray .title a{ font-size:12px; }
.distributor-card--tray .subtitle p{ font-size:12px; }

/* @media (min-width: 900px){
  #map-card-list{ grid-auto-columns:minmax(320px,360px); }
} */




.search-box { display:inline-block; width: var(--vspace-10); margin: 5px 0; }
#dist-search{
  width:100%; padding:10px 14px; border:1px solid #ccc; border-radius:5px;
  font-family:'Monument Extended Regular'; font-size:var(--text-sm);
  background:#fff; outline:0; transition:border-color .2s ease;
  height: 35px;
}
#dist-search:focus{ border-color:#999; }


/* Tray nav buttons */
#map-tray { position: sticky; } /* already sticky; keeps absolute children anchored */
.tray-nav{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid #e6e7ea;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 18, 20, 0.08);
  display: grid; place-items: center;
  color: #111827;
  cursor: pointer;
  z-index: 2; /* above cards */
}
.tray-nav--prev{ left: 8px; }
.tray-nav--next{ right: 8px; }
.tray-nav:hover{ background:#f7f7f8; }
.tray-nav:disabled{
  opacity: .45; cursor: default; pointer-events: none;
}

/* optional: hide the buttons on smaller screens */
@media (max-width: 640px){
  .tray-nav{ display:none; }
}


/* bottom row that holds the nav */
.tray-bottom{
  display:flex;
  justify-content:center;
  padding-top:8px;
  border-top:1px solid #e6e7ea;
  margin-top:4px;
  gap: 10px;
}

/* circular buttons */
.tray-nav{
  width:40px; height:40px;
  border-radius:999px;
  border:1px solid #e6e7ea;
  background:#ffffff;
  box-shadow:0 2px 8px rgba(16,18,20,0.08);
  display:grid; place-items:center;
  color:#111827;
  cursor:pointer;
}
.tray-nav:hover{ background:#f7f7f8; }
.tray-nav:disabled{ opacity:.45; cursor:default; }

@media (max-width:640px){
  .tray-bottom{ padding-top:6px; }
  .tray-nav{ width:36px; height:36px; }
}

/* ensure bottom-of-tray buttons are in normal flow */
.tray-bottom .tray-nav{
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  transform: none !important;
  display:flex;
  gap:10px;
}

#tray-prev,
#tray-next {
    width: 40px;
    display: flex;
    justify-content: center;
}


.mini-map {
  width: 100%;
  height: 180px; /* tweak as you like */
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}



/* --------------------------------------------------------------------
 * # MAP + INTERACTION OVERLAY
 * ------------------------------------------------------------------- */

/* Shell untuk posisi overlay & tombol lock */
.map-shell {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* Ukuran map */
#leaflet-map {
    position: relative;       /* stacking context agar z-index bekerja */
    width: 100%;
    height: 500px;
    border-radius: 12px;
    z-index: 1;               /* di bawah overlay & tombol */
}

/* Overlay anti-interaksi (LOCKED) */
.map-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: linear-gradient(to bottom, rgba(22,22,22,0.35), rgba(22,22,22,0.55));
    color: #fff;
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    pointer-events: auto;      /* tangkap interaksi, biar halaman bisa scroll */
    backdrop-filter: blur(0px);
    z-index: 3;                /* di atas map */
}

/* Teks helper di overlay */
.map-overlay span {
    font-family: 'Monument Extended Regular', sans-serif;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    letter-spacing: .08em;
    background: rgba(0,0,0,.35);
    padding: .6rem .9rem;
    margin: 0 0 .9rem 0;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.18);
}

/* Saat overlay disembunyikan (map AKTIF) */
.map-overlay.is-hidden {
    display: none;
}

.map-overlay:hover {
    background-color: rgba(0,0,0,.1) !important;
}

/* Tombol Lock di pojok kanan bawah (muncul saat aktif) */
.map-lock-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 4;                /* di atas overlay & map */
    padding: .5rem .8rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(0,0,0,.45);
    color: #fff;
    font-family: 'Monument Extended Regular', sans-serif;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    letter-spacing: .06em;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}

.map-lock-btn:hover {
    background-color: rgba(0,0,0,.6) !important;
    border-color: rgba(255,255,255,.35);
}

.map-lock-btn:active {
    transform: translateY(1px);
}

.map-lock-btn.is-hidden {
    display: none;
}

/* Fail-safe: saat terkunci, matikan pointer events map + redupkan kontrol zoom */
.map-shell.is-locked #leaflet-map {
    pointer-events: none;
}

.map-shell:not(.is-locked) #leaflet-map {
    pointer-events: auto;
}

.map-shell.is-locked .leaflet-control-zoom {
    opacity: .35;
    pointer-events: none;
}

/* Mobile tweak: tinggi map */
@media (max-width: 750px) {
    #leaflet-map { height: 380px; }
}

@media (max-width: 480px) {
    #leaflet-map { height: 320px; }
}
