/* =====================================================
   Stonesy Partner Map v3 – Stacked Layout + Avatars
   ===================================================== */

.spm-wrap {
    font-family: inherit;
    margin: 0 auto;
}

/* ---- Suchleiste ---- */
.spm-search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}

.spm-search-bar input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 14px;
    color: #111;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .spm-search-bar { flex-wrap: wrap; }
    .spm-search-bar input[type="text"] { flex: 1 1 100%; }
}
.spm-search-bar input[type="text"]:focus { border-color: #111; }
.spm-search-bar input[type="text"]::placeholder { color: #bbb; }

.spm-search-bar select {
    padding: 11px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 13px;
	width: 25% !important;
    color: #111;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.spm-search-bar select:focus { border-color: #111; }

.spm-btn {
    padding: 13px 22px !important;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.spm-btn:hover   { background: #333; }
.spm-btn:disabled { background: #999; cursor: default; }

.spm-reset-link {
    color: #c0392b !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer;
    white-space: nowrap;
    align-self: center;
}
.spm-reset-link:hover { color: #a02020 !important; }

/* ---- Layout: Karte oben, Liste darunter ---- */
.spm-body {
    display: flex;
    flex-direction: column;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

/* ---- Karte ---- */
#stonesy-partner-map {
    height: 520px;
    background: #f3f3f3;
    z-index: 0;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    #stonesy-partner-map { height: 320px; }
}

/* ---- Popup ---- */
.spm-popup {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 180px;
}
.spm-popup__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.spm-popup__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.spm-popup strong {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    display: block;
    margin-bottom: 2px;
}
.spm-popup span {
    font-size: 12px;
    color: #888;
    display: block;
    line-height: 1.5;
}
.spm-popup span:first-of-type {
    color: #444;
}
.spm-popup__link {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-top: 6px;
}
.spm-popup__link:hover { color: #555; }

/* Leaflet Popup Overrides */
.leaflet-popup-content-wrapper {
    border-radius: 0 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.13) !important;
    padding: 0 !important;
    border: 1px solid #e8e8e8 !important;
}
.leaflet-popup-content { margin: 16px 18px 16px 18px !important; }
.leaflet-popup-tip-container { margin-top: -1px; }
.leaflet-popup-tip { background: #fff !important; box-shadow: none !important; border: none !important; }
.leaflet-popup-close-button {
    font-size: 20px !important;
    color: #bbb !important;
    top: 10px !important;
    right: 10px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 18px !important;
    text-align: center !important;
    font-weight: 300 !important;
}
.leaflet-popup-close-button:hover { color: #111 !important; background: none !important; }

/* ---- Custom Marker Pin ---- */
.spm-pin {
    width: 20px;
    height: 28px;
    background: #111;
    clip-path: polygon(50% 100%, 0% 30%, 10% 0%, 90% 0%, 100% 30%);
    transition: background .15s;
}
.spm-pin--active,
.spm-pin:hover { background: #555; }

/* ---- Cluster ---- */
.spm-cluster {
    width: 36px; height: 36px;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ---- Partnerliste (unter der Karte) ---- */
.spm-list-panel {
    border-top: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

.spm-list-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #aaa;
    flex-shrink: 0;
}

/* Grid-Liste für die Cards */
#spm-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
    max-height: 420px;
    overflow-y: auto;
}
#spm-list::-webkit-scrollbar { width: 4px; }
#spm-list::-webkit-scrollbar-thumb { background: #ddd; }

@media (max-width: 768px) {
    #spm-list {
        grid-template-columns: 1fr;
        max-height: 320px;
    }
}

/* ---- Card mit Avatar ---- */
.spm-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .12s;
}
.spm-card:hover     { background: #f7f7f7; }
.spm-card.is-active { background: #f3f3f3; border-left: 3px solid #111; padding-left: 13px; }

.spm-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.spm-card__body {
    flex: 1;
    min-width: 0;
}

.spm-card__firma {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    margin-bottom: 2px;
}
.spm-card__name {
    font-size: 12px;
    color: #555;
    margin-bottom: 1px;
}
.spm-card__adresse {
    font-size: 11px;
    color: #aaa;
    line-height: 1.4;
}
.spm-card__dist {
    font-size: 11px;
    color: #111;
    font-weight: 600;
    margin-top: 4px;
}
.spm-card__link {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #111;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-top: 6px;
}
.spm-card__link:hover { color: #555; }

#spm-noresults {
    padding: 32px 16px;
    font-size: 13px;
    color: #aaa;
    text-align: center;
    display: none;
}
