/* BarberKut map: home section and owner pin editor. Colors come from the site palette. */
.nearby-section { padding: 64px 0 24px; }
.nearby-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.nearby-head h2 { margin: 0 0 6px; font-size: clamp(2.2rem, 4.2vw, 3.3rem); font-weight: 900; line-height: .95; }
.nearby-head p { margin: 0; max-width: 34em; }
.nearby-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nearby-controls label { margin: 0; display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.nearby-controls select { width: auto; min-width: 0; padding: 10px 14px; }

.nearby-map {
    position: relative; z-index: 0; width: 100%; height: 450px; overflow: hidden;
    border-radius: 22px; border: 1px solid rgba(244, 239, 228, .14);
    background: #0e1814; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
}
@media (min-width: 900px) { .nearby-map { height: 600px; } }
.nearby-map.compact { height: 380px; }
.nearby-status { margin: 14px 2px 0; min-height: 1.5em; }

/* Pin: gold drop with the BarberKut logo. The tip (bottom center) sits on the coordinate. */
.bk-pin-wrap { background: none; border: 0; }
.bk-pin { position: relative; width: 44px; height: 44px; }
.bk-pin .bk-drop {
    display: block; width: 44px; height: 44px; border: 2px solid #101c18; border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, #c8ab78, #b9965b); transform: rotate(-45deg); box-shadow: 0 8px 16px rgba(0, 0, 0, .5);
    transition: transform .15s ease;
}
.bk-pin img { position: absolute; left: 9px; top: 7px; width: 26px; height: 26px; object-fit: contain; filter: brightness(0); }
.bk-pin-wrap:hover .bk-pin .bk-drop { transform: rotate(-45deg) scale(1.08); }

/* "You are here" */
.bk-user-dot { width: 18px; height: 18px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .3); }

/* Name on the pin (hidden by the script where two names would overlap) */
.bk-pin-label {
    position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); max-width: 150px; padding: 5px 11px; border-radius: 99px;
    background: rgba(16, 28, 24, .92); border: 1px solid rgba(200, 171, 120, .6); color: #f4efe4; box-shadow: 0 6px 14px rgba(0, 0, 0, .45);
    font: 700 .78rem/1.2 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.bk-pin-label.hidden { display: none; }

/* The shop card that opens on a pin: banner, round photo in the corner, name, comforts, actions */
.nearby-popup .leaflet-popup-content-wrapper {
    padding: 0; overflow: hidden; border-radius: 20px; color: var(--chalk);
    background: linear-gradient(160deg, rgba(36, 53, 45, .98), rgba(16, 28, 24, .98)); border: 1px solid rgba(200, 171, 120, .55);
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .8);
}
.nearby-popup .leaflet-popup-tip { background: #172620; border: 1px solid rgba(200, 171, 120, .55); }
.nearby-popup .leaflet-popup-content { margin: 0; width: 300px !important; min-width: 0; }
@media (max-width: 420px) { .nearby-popup .leaflet-popup-content { width: min(300px, 76vw) !important; } }
@media (max-width: 520px) {
    .nearby-map { height: 540px; }
    .pop-banner { height: 84px; }
    .pop-name { font-size: 1.35rem; margin-top: 8px; }
    .pop-body { padding-bottom: 14px; }
    .pop-actions { margin-top: 12px; }
}
.nearby-popup .leaflet-popup-content p { word-break: break-word; margin: 0; }
.nearby-popup .leaflet-popup-close-button {
    top: 10px; right: 10px; width: 28px; height: 28px; padding: 0; border-radius: 50%; display: grid; place-items: center;
    font: 400 20px/1 var(--font-body); color: #f4efe4; background: rgba(10, 18, 15, .6); z-index: 2;
}
.nearby-popup .leaflet-popup-close-button:hover { background: rgba(10, 18, 15, .9); color: #fff; }
.pop-banner {
    position: relative; height: 112px; background-size: cover; background-position: center;
    background-image: radial-gradient(ellipse 70% 120% at 50% 100%, rgba(185, 150, 91, .22), transparent 70%),
        repeating-linear-gradient(-24deg, rgba(185, 150, 91, .10) 0 14px, transparent 14px 28px, rgba(122, 122, 114, .10) 28px 42px, transparent 42px 56px),
        linear-gradient(180deg, #24352d, #172620);
}
.pop-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10, 18, 15, .55)); }
.pop-body { position: relative; padding: 0 18px 18px; }
.pop-avatar {
    display: block; width: 64px; height: 64px; margin-top: -32px; border-radius: 50%; object-fit: cover; position: relative; z-index: 1;
    border: 3px solid #172620; background: #24352d; box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}
.pop-avatar.is-default { object-fit: contain; padding: 14px; box-sizing: border-box; opacity: .85; }
.pop-name { display: block; margin: 10px 0 6px; font: 800 1.5rem/1.05 var(--font-display); color: var(--chalk); }
.pop-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; font-size: .86rem; }
.pop-rating, .pop-dist { display: inline-flex; align-items: center; gap: 5px; color: #d8c29a; font-weight: 700; }
.pop-address { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; line-height: 1.4; color: var(--text-muted); }
.pop-card svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pop-address svg, .pop-amenity svg { stroke: var(--accent); }
.pop-rating svg { fill: currentColor; stroke: none; }
.pop-address svg { margin-top: 2px; }
.pop-note { margin-top: 6px !important; font-size: .78rem; color: #d8c29a; }
.pop-amenities { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 2px; }
.pop-amenity { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: .78rem; color: var(--chalk); background: rgba(244, 239, 228, .07); border: 1px solid rgba(244, 239, 228, .12); }
.pop-amenity svg { width: 14px; height: 14px; }
.pop-amenity.more { color: var(--text-muted); font-weight: 700; }
.pop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.pop-actions .btn { width: 100%; padding: 11px 8px; justify-content: center; gap: 7px; font-size: .9rem; transition: transform .15s ease, filter .15s ease; }
.pop-actions .btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.leaflet-container { font-family: var(--font-body); background: #0e1814; }
.leaflet-control-attribution { background: rgba(16, 28, 24, .75) !important; color: var(--text-muted) !important; }
.leaflet-control-attribution a { color: #d8c29a !important; }
.leaflet-bar a { background: rgba(16, 28, 24, .9); color: var(--chalk); border-color: rgba(244, 239, 228, .15); }
.leaflet-bar a:hover { background: #24352d; color: var(--chalk); }

/* Result cards under the map */
.nearby-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-top: 18px; }
.nearby-card {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 18px; text-align: left; cursor: pointer;
    background: linear-gradient(160deg, rgba(244, 239, 228, .07), rgba(244, 239, 228, .025)); border: 1px solid rgba(244, 239, 228, .1);
    color: var(--text); font: inherit; transition: border-color .15s ease, transform .15s ease;
}
.nearby-card:hover, .nearby-card:focus-visible { border-color: rgba(185, 150, 91, .6); transform: translateY(-2px); }
.nearby-card strong { font-size: 1.05rem; }
.nearby-card span { font-size: .88rem; color: var(--text-muted); }
.nearby-card .dist { color: #d8c29a; font-weight: 700; }

/* Owner editor */
.owner-map-box { margin-top: 24px; }
.owner-map-box .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.map-hint { font-size: .85rem; color: var(--text-muted); margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .bk-pin .bk-drop, .nearby-card, .pop-actions .btn { transition: none; } }

/* Leaflet paints every link inside the map blue; buttons keep their own colors. */
.leaflet-container .nearby-popup a.pop-cta,
.nearby-popup .leaflet-popup-content a.pop-cta { color: var(--accent-text); text-decoration: none; font-weight: 700; }
.leaflet-container .nearby-popup a.pop-how,
.nearby-popup .leaflet-popup-content a.pop-how { color: var(--chalk); text-decoration: none; font-weight: 700; }

/* "Você está aqui" is a plain one-line popup, not the shop card. */
.nearby-popup.user-pop .leaflet-popup-content { width: auto !important; margin: 12px 18px; font-weight: 600; }

/* "Encontre barbearia com horário livre" */
.free-search {
    display: grid; gap: 14px; margin: 0 0 18px; padding: 18px 20px; border-radius: 20px;
    background: linear-gradient(160deg, rgba(244, 239, 228, .07), rgba(244, 239, 228, .025)); border: 1px solid rgba(200, 171, 120, .35);
}
.free-search.on { border-color: rgba(200, 171, 120, .8); }
.free-title { display: flex; align-items: center; gap: 14px; }
.free-title > svg { width: 38px; height: 38px; flex: none; padding: 8px; border-radius: 12px; background: rgba(200, 171, 120, .14); fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.free-title strong { display: block; font-size: 1.05rem; }
.free-title span { display: block; color: var(--text-muted); font-size: .88rem; line-height: 1.4; }
.free-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.free-fields label { margin: 0; display: grid; gap: 6px; font-size: .85rem; }
.free-fields input { width: auto; min-width: 150px; padding: 11px 14px; }
.free-fields .btn { padding: 12px 22px; }
.free-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.free-quick button { padding: 7px 14px; border-radius: 99px; border: 1px solid rgba(244, 239, 228, .16); background: rgba(244, 239, 228, .05); color: var(--text-muted); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.free-quick button:hover { color: var(--text); border-color: var(--accent); }
.free-quick button.on { background: var(--accent-gradient); border-color: transparent; color: var(--accent-text); }
@media (max-width: 520px) { .free-fields label, .free-fields input { width: 100%; } .free-fields .btn { flex: 1 1 0; } }

/* Free starts found by the search: on the map card and on the list cards */
.pop-free { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; padding: 9px 11px; border-radius: 12px; background: rgba(62, 207, 142, .12); border: 1px solid rgba(62, 207, 142, .35); font-size: .84rem; color: #bff2d9; }
.pop-free b { color: #fff; font-weight: 700; }
.nearby-card .free { color: #8be4b8; font-weight: 700; }
.free-fields input { min-height: 46px; box-sizing: border-box; }

/* "Na barbearia | Cortar em casa" switch above the map */
.nearby-mode { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(12, 22, 18, .8); border: 1px solid rgba(244, 239, 228, .13); }
.nearby-mode button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 7px; padding: 8px 14px; background: transparent; color: var(--text-muted); font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer; transition: color .15s ease, background .15s ease; }
.nearby-mode button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nearby-mode button:hover:not([aria-pressed="true"]) { color: var(--text); }
.nearby-mode button[aria-pressed="true"] { background: var(--inv-bg, #f4efe4); color: var(--inv-text, #101c18); font-weight: 600; }
.pop-home { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: .84rem; color: var(--text-muted); line-height: 1.35; }
.pop-home svg { width: 16px; height: 16px; flex: none; margin-top: 1px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nearby-card .home { color: var(--text-muted); }
@media (max-width: 640px) { .nearby-mode { width: 100%; } .nearby-mode button { flex: 1 1 0; justify-content: center; } }
