/* ============================================================================
   RG dealer page styles (breadcrumb + locate panel + results + pagination)
   Loaded together with rg-list.css (global base/header/footer styles).
   ============================================================================ */

/* ============ Breadcrumb ============ */
.breadcrumb{background:var(--gray-bg);border-bottom:1px solid var(--border);padding:12px 0;}
.breadcrumb .crumb{font-size:13px;color:#888;}
.breadcrumb a{color:var(--orange);}
.breadcrumb a:hover{text-decoration:underline;}
.breadcrumb .sep{margin:0 8px;color:#bbb;}
.breadcrumb .cur{color:#444;font-weight:600;}

/* ============ Dealer main ============ */
.dealer-main{max-width:1280px;margin:0 auto;padding:36px 24px 64px;}
.dealer-wrap{display:flex;gap:28px;align-items:flex-start;}

/* ---- Left: search + service filter + map ---- */
.dealer-left{flex:0 0 472px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:24px;}
.locate-title{font-size:24px;font-weight:800;color:var(--text);margin-bottom:18px;}
.search-box{display:flex;align-items:center;border:1px solid var(--border);border-radius:6px;padding:4px;background:#fafafa;transition:border .2s;}
.search-box:focus-within{border-color:var(--orange);}
.search-box input{flex:1;min-width:0;border:none;outline:none;background:transparent;padding:8px 10px;font-size:14px;font-family:inherit;color:var(--text);}
.search-box input::placeholder{color:#aaa;}
.icon-btn{width:38px;height:38px;flex:0 0 38px;border:none;border-radius:5px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;}
.search-btn{background:var(--orange);color:#fff;margin-left:4px;}
.search-btn:hover{background:var(--orange-dark);}
.locate-btn{background:#fff;border:1px solid var(--border);color:#888;margin-right:4px;}
.locate-btn:hover{color:var(--orange);border-color:var(--orange);}
.search-hint{display:flex;justify-content:space-between;align-items:center;margin-top:10px;font-size:12px;color:#999;}
.reset-link{color:var(--orange);cursor:pointer;font-weight:600;}
.reset-link:hover{text-decoration:underline;}

.service-block{margin-top:22px;}
.service-label{font-size:13px;font-weight:800;color:var(--text);margin-bottom:10px;}
.chips{display:flex;flex-wrap:wrap;gap:8px;}
.chip{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;border-radius:20px;background:#f2f2f2;border:1px solid var(--border);font-size:13px;color:#444;cursor:pointer;transition:all .2s;user-select:none;}
.chip:hover{border-color:var(--orange);color:var(--orange);}
.chip .x{font-size:14px;line-height:1;color:#999;transition:color .2s;}
.chip:hover .x{color:var(--orange);}

.map-box{margin-top:22px;border:1px solid var(--border);border-radius:8px;overflow:hidden;position:relative;background:#e7f1f8;}
/* Legacy rule from the old static-map image, removed: `.map-box svg` also hit
   Leaflet's attribution flag (the small blue/yellow CARTO flag inside the
   bottom-right attribution bar) and stretched it to 100% width — it rendered
   as the big blue/yellow block over the map's bottom-right corner.
   Tile <img>s are sized by leaflet.css; card images have their own rules. */
.map-box .leaflet-control-attribution svg{width:1em;height:auto;display:inline;}
/* Edit mode: the real Leaflet map renders above; underneath it the static
   China map (with pins) shows through ONLY where basemap tiles fail to load,
   so the admin edit view never sees a bare grey box. International dealers
   appear on the real tiles (the under-layer only carries China-extent pins). */
.map-edit{position:relative;}
.map-static-under{position:absolute;inset:0;}
.map-static-under img{width:100%;height:100%;object-fit:fill;display:block;}
.map-static-under .map-pin{position:absolute;width:12px;height:12px;margin:-14px 0 0 -6px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--orange);border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,.3);}
.map-edit .leaflet-container{background:transparent;}
/* Real map container (Leaflet + Tianditu tiles): needs an explicit height */
.map-canvas{position:relative;width:100%;height:420px;background:#e7f1f8;}
.leaflet-container{background:#e7f1f8;font-family:inherit;font-size:12px;}
.leaflet-container a{color:var(--orange);}
.leaflet-popup-content{margin:10px 12px;line-height:1.6;}
.leaflet-popup-content-wrapper{border-radius:8px;}
.map-fallback{padding:28px 18px;text-align:center;font-size:13px;color:#888;line-height:1.7;}
/* Info window content */
.tmap-info{min-width:160px;max-width:230px;line-height:1.6;}
.tmap-info .tmap-name{font-size:13px;font-weight:700;color:var(--text);margin-bottom:2px;}
.tmap-info .tmap-line{font-size:12px;color:#666;word-break:break-all;}
/* Hint layer that used to sit on top of the map — removed from the map on
   request. Kept here as `display:none` so a stale cached page (or a template
   that still renders .map-note) shows no overlay either. */
.map-note{display:none !important;}
/* z-index must clear the Leaflet panes (tiles 200 / markers 600 / popup 700) */
.map-note{position:absolute;left:10px;bottom:8px;background:rgba(255,255,255,.94);font-size:11px;color:#888;padding:4px 10px;border-radius:12px;border:1px solid var(--border);z-index:900;}
.map-controls{position:absolute;top:10px;right:10px;z-index:800;display:flex;flex-direction:column;gap:6px;opacity:0;transition:opacity .2s;}
.map-box:hover .map-controls{opacity:1;}
.map-controls button{width:30px;height:30px;border:1px solid var(--border);border-radius:6px;background:rgba(255,255,255,.95);color:var(--text);font-size:15px;line-height:1;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.12);transition:all .15s;font-family:inherit;}
.map-controls button:hover{color:#fff;background:var(--orange);border-color:var(--orange);}
.map-controls button:active{transform:scale(.94);}
@media (hover:none){.map-controls{opacity:1;}}

/* ---- Right: result list ---- */
.dealer-right{flex:1;min-width:0;}
.result-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:16px;}
.result-title{font-size:20px;font-weight:800;color:var(--text);}
.result-count{font-size:13px;color:#999;}
.dealer-card{display:flex;gap:18px;background:#fff;border:1px solid var(--border);border-radius:10px;padding:18px;margin-bottom:16px;cursor:pointer;transition:all .25s;}
.dealer-card:hover{border-color:#d6d6d6;box-shadow:0 8px 20px rgba(0,0,0,.07);}
.dealer-card.active{border:2px solid var(--orange);box-shadow:0 10px 26px rgba(235,97,0,.14);background:#fffaf6;}
.card-map{flex:0 0 168px;border:1px solid #f0f0f0;border-radius:8px;overflow:hidden;background:#f2f7fa;}
.card-map img{width:100%;height:100%;display:block;object-fit:cover;}
.card-info{flex:1;min-width:0;}
.card-name{font-size:17px;font-weight:800;color:var(--text);display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.card-name .badge{font-size:11px;font-weight:700;color:var(--orange);background:#fff0e5;border:1px solid #ffd9bf;padding:2px 8px;border-radius:10px;}
.card-line{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--text-gray);margin-top:6px;}
.card-line svg{flex:0 0 15px;color:var(--orange);}
.card-line b{color:var(--text);font-weight:600;}
.card-addr{font-size:12.5px;color:#777;margin-top:4px;line-height:1.7;}
.no-result{display:none;text-align:center;padding:60px 20px;border:1px dashed var(--border);border-radius:10px;color:#999;font-size:14px;}

/* ---- Pagination (dealer, server-rendered links) ---- */
.pagination{display:flex;justify-content:center;align-items:center;gap:6px;margin-top:36px;}
.pagination a,.pagination span{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 6px;border:1px solid var(--border);border-radius:4px;font-size:14px;color:#555;background:#fff;cursor:pointer;transition:all .2s;font-family:inherit;text-decoration:none;box-sizing:border-box;}
.pagination a:hover:not(.active){border-color:var(--orange);color:var(--orange);}
.pagination .active{background:var(--orange);border-color:var(--orange);color:#fff;font-weight:700;cursor:default;}
.pagination .page-gap{border:none;color:#bbb;cursor:default;min-width:24px;}
.pagination .page-prev,.pagination .page-next{font-size:17px;line-height:1;}

/* ============ Responsive ============ */
@media (max-width:1024px){
  .dealer-wrap{flex-direction:column;}
  .dealer-left{flex:none;width:100%;}
  .dealer-main{padding:28px 16px 48px;}
}
@media (max-width:640px){
  /* page paddings */
  .dealer-main{padding:18px 12px 40px;}
  .dealer-wrap{gap:16px;}
  .breadcrumb{padding:10px 0;}
  .breadcrumb .crumb{font-size:12.5px;}
  .breadcrumb .sep{margin:0 5px;}
  /* left panel: search + chips + map */
  .dealer-left{padding:14px;}
  .locate-title{font-size:20px;margin-bottom:14px;}
  .search-hint{flex-wrap:wrap;gap:6px;}
  .service-block{margin-top:16px;}
  .chip{padding:6px 10px;font-size:12.5px;}
  .map-box{margin-top:16px;}
  .map-canvas{height:320px;}
  .map-note{left:8px;bottom:6px;font-size:10px;padding:3px 8px;max-width:62%;}
  .map-controls{top:8px;right:8px;}
  .map-controls button{width:32px;height:32px;}
  /* result cards stack vertically */
  .result-head{margin-bottom:12px;}
  .result-title{font-size:18px;}
  .dealer-card{flex-direction:column;gap:12px;padding:14px;}
  .card-map{flex:none;height:150px;}
  .card-name{font-size:16px;}
  .card-line{font-size:13px;}
  /* pagination: wrap instead of overflowing */
  .pagination{flex-wrap:wrap;gap:5px;margin-top:24px;}
  .pagination a,.pagination span{min-width:34px;height:34px;font-size:13px;}
  .pagination .page-gap{min-width:20px;}
}
