/* Spitoulis Map Draw Search v3.3.0 */

/* ── Trigger button (bottomright στον κύριο χάρτη) ── */
.spitoulis-draw-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 7px 15px !important;
    background: #fff !important;
    border: 2px solid rgba(0,0,0,.15) !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #333 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.15) !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
    transition: all .18s !important;
    width: auto !important; height: auto !important;
}
.spitoulis-draw-btn:hover {
    border-color: #7C3AED !important;
    color: #7C3AED !important;
    background: #faf5ff !important;
}

/* ── Modal overlay ── */
.smd-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

body.smd-modal-open { overflow: hidden; }

/* ── Modal inner ── */
.smd-modal-inner {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ── Header ── */
.smd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.smd-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #111;
}

.smd-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background .15s;
}
.smd-modal-close:hover { background: #f5f5f5; color: #111; }

/* ── Hint bar ── */
.smd-modal-hint {
    padding: 8px 18px;
    font-size: 13px;
    color: #555;
    background: #faf5ff;
    border-bottom: 1px solid #ede9fe;
    flex-shrink: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}

/* ── Map ── */
#smd-modal-map {
    flex: 1;
    min-height: 320px;
    max-height: 420px;
    z-index: 1;
}

/* ── Footer ── */
.smd-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    gap: 10px;
}

.smd-btn-reset {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    transition: all .15s;
}
.smd-btn-reset:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }

.smd-btn-search {
    background: #7C3AED;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
    flex: 1;
    max-width: 260px;
}
.smd-btn-search:hover:not(:disabled) { background: #6D28D9; }
.smd-btn-search:disabled { opacity: .5; cursor: not-allowed; }

/* ── Results panel ── */
.smd-results {
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    max-height: 280px;
    overflow-y: auto;
}

.smd-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    font-size: 13px;
    color: #555;
    background: #f9f9f9;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
}

.smd-results-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #888;
    padding: 2px 6px;
    border-radius: 4px;
}
.smd-results-close:hover { background: #eee; }

.smd-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 14px 18px;
}

.smd-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, transform .15s;
}
.smd-card:hover { box-shadow: 0 4px 16px rgba(124,58,237,.15); transform: translateY(-2px); }

.smd-card-img {
    position: relative;
    height: 120px;
    background: #f3f4f6;
    overflow: hidden;
}
.smd-card-img img { width: 100%; height: 100%; object-fit: cover; }
.smd-no-thumb { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 32px; }

.smd-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: #7C3AED;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    text-transform: uppercase;
}

.smd-card-body { padding: 10px 12px; }
.smd-card-title { font-size: 12px; font-weight: 500; color: #111; margin-bottom: 4px; line-height: 1.3; }
.smd-card-price { font-size: 15px; font-weight: 700; color: #7C3AED; margin-bottom: 4px; }
.smd-card-addr  { font-size: 11px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.smd-no-results { padding: 20px 18px; text-align: center; color: #888; font-size: 14px; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .smd-modal { padding: 8px; }
    .smd-modal-inner { max-height: 96vh; border-radius: 12px; }
    #smd-modal-map { max-height: 300px; }
    .smd-results-grid { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; }
    .smd-modal-footer { flex-wrap: wrap; }
    .smd-btn-search { max-width: 100%; }
}

/* ── Fix spacing ── */
.smd-results-header strong { margin-right: 2px; }
.smd-modal-hint strong { margin: 0 2px; }
