/* ═══════════════════════════════════════════════════
   SP Yandex Map — Frontend Styles
   Modern, dark, glass-morphism design
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

.spym-wrapper {
    --spym-accent: #00e5a0;
    --spym-bg: #0a0a0f;
    --spym-panel-bg: #0d0d14;
    --spym-card-bg: rgba(255, 255, 255, 0.04);
    --spym-card-border: rgba(255, 255, 255, 0.08);
    --spym-text: #e8e8ec;
    --spym-text-dim: #6b6b80;
    --spym-radius: 16px;
    --spym-glow: 0 0 20px rgba(0, 229, 160, 0.15);
    
    display: flex;
    position: relative;
    border-radius: var(--spym-radius);
    overflow: hidden;
    background: var(--spym-bg);
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    box-shadow: 0 8px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Panel ────────────────────────────────────── */

.spym-panel {
    width: 380px;
    min-width: 380px;
    background: var(--spym-panel-bg);
    display: flex;
    flex-direction: column;
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.spym-panel-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.spym-panel-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: var(--spym-text);
    letter-spacing: -0.02em;
}

.spym-panel-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--spym-accent);
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 8px var(--spym-accent);
    vertical-align: middle;
}

/* ─── Search ───────────────────────────────────── */

.spym-search-wrap {
    position: relative;
}

.spym-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--spym-text-dim);
    pointer-events: none;
}
.spym-info-btn svg {
	width:24px;
}
.spym-search {
    width: 100%;
    padding: 10px 14px 10px 38px !important;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--spym-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.spym-search:focus {
    border-color: var(--spym-accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 229, 160, 0.1);
}

.spym-search::placeholder {
    color: var(--spym-text-dim);
}

/* ─── Branch List ──────────────────────────────── */

.spym-branch-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.spym-branch-list::-webkit-scrollbar {
    width: 4px;
}

.spym-branch-list::-webkit-scrollbar-track {
    background: transparent;
}

.spym-branch-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* ─── Branch Item ──────────────────────────────── */

.spym-branch-item {
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.spym-branch-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--spym-accent);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 0 4px 4px 0;
}

.spym-branch-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.spym-branch-item:hover::before {
    opacity: 0.5;
}

.spym-branch-item.active {
    background: rgba(0, 229, 160, 0.06);
    border-color: rgba(0, 229, 160, 0.2);
}

.spym-branch-item.active::before {
    opacity: 1;
}

.spym-branch-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--spym-text);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spym-branch-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--spym-accent);
    color: #000;
}

.spym-branch-addr {
    font-size: 12px;
    color: var(--spym-text-dim);
    margin: 0 0 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.spym-branch-addr svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.spym-branch-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.spym-branch-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--spym-text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.spym-branch-meta-item svg {
    width: 12px;
    height: 12px;
    color: var(--spym-accent);
    flex-shrink: 0;
}

/* ─── Map Container ────────────────────────────── */

.spym-map-container {
    flex: 1;
    position: relative;
    min-height: 500px;
}

.spym-map {
    width: 100%;
    height: 100%;
}

/* Override Yandex Map controls styling */
.spym-map .ymaps-2-1-79-controls-pane {
    filter: none;
}

/* ─── Floating Info Card ───────────────────────── */

.spym-info-card {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 480px;
    z-index: 100;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.spym-info-card.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Card Style: Glass */
.spym-wrapper[data-card-style="glass"] .spym-info-card,
.spym-info-card {
    background: rgba(13, 13, 20, 0.85);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--spym-glow);
}

/* Card Style: Solid */
.spym-wrapper[data-card-style="solid"] .spym-info-card {
    background: #12121c;
    backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card Style: Outline */
.spym-wrapper[data-card-style="outline"] .spym-info-card {
    background: rgba(10, 10, 15, 0.95);
    border: 2px solid var(--spym-accent);
    box-shadow: 0 0 30px rgba(0, 229, 160, 0.15);
}

/* Card Style: Neon */
.spym-wrapper[data-card-style="neon"] .spym-info-card {
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid var(--spym-accent);
    box-shadow: 0 0 30px rgba(0, 229, 160, 0.2),
                inset 0 0 30px rgba(0, 229, 160, 0.03);
}

/* Card Style: Minimal */
.spym-wrapper[data-card-style="minimal"] .spym-info-card {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.spym-wrapper[data-card-style="minimal"] .spym-info-card .spym-info-name,
.spym-wrapper[data-card-style="minimal"] .spym-info-card .spym-info-row {
    color: #1a1a2e;
}

.spym-wrapper[data-card-style="minimal"] .spym-info-card .spym-info-desc {
    color: #555;
}

/* ─── Info Card Content ────────────────────────── */

.spym-info-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--spym-text-dim);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.spym-info-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--spym-text);
}

.spym-info-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.spym-info-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.spym-info-body {
    flex: 1;
    min-width: 0;
}

.spym-info-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--spym-text);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spym-info-desc {
    font-size: 12px;
    color: var(--spym-text-dim);
    margin: 0 0 12px;
    line-height: 1.5;
}

.spym-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.spym-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--spym-text);
    padding: 6px 0;
}

.spym-info-row svg {
    width: 14px;
    height: 14px;
    color: var(--spym-accent);
    flex-shrink: 0;
}

.spym-info-row a {
    color: var(--spym-accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.spym-info-row a:hover {
    opacity: 0.8;
}

.spym-info-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.spym-info-btn {
    flex: 1;
    padding: 9px 16px;
    border-radius: 10px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
}

.spym-info-btn-primary {
    background: var(--spym-accent);
    color: #000;
}

.spym-info-btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(0, 229, 160, 0.3);
}

.spym-info-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--spym-text);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.spym-info-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ─── Map Style Switcher ───────────────────────── */

.spym-style-switcher {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    gap: 4px;
    background: rgba(13, 13, 20, 0.8);
    backdrop-filter: blur(10px);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
}

.spym-style-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.5;
}

.spym-style-btn:hover {
    opacity: 0.8;
    background: rgba(255,255,255,0.06);
}

.spym-style-btn.active {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

/* ─── Fit All Button ───────────────────────────── */

.spym-fit-btn {
    position: absolute;
    top: 16px;
    right: 160px;
    z-index: 50;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(13, 13, 20, 0.8);
    backdrop-filter: blur(10px);
    color: var(--spym-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
	padding:unset !important;
}

.spym-fit-btn:hover {
    background: rgba(13, 13, 20, 0.95);
    border-color: var(--spym-accent);
    color: var(--spym-accent);
}

/* ─── Loading State ────────────────────────────── */

.spym-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    color: var(--spym-text-dim);
    font-size: 13px;
}

.spym-loading-pulse {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.06);
    border-top-color: var(--spym-accent);
    animation: spym-spin 0.8s linear infinite;
}

@keyframes spym-spin {
    to { transform: rotate(360deg); }
}

/* ─── Custom Marker ────────────────────────────── */

.spym-marker {
    width: 40px;
    height: 40px;
    position: relative;
    cursor: pointer;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4));
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spym-marker:hover {
    transform: scale(1.15);
}

.spym-marker-dot {
    width: 40px;
    height: 40px;
    border-radius: 50% 50% 50% 0;
    background: var(--spym-accent);
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 229, 160, 0.4);
}

.spym-marker-dot svg {
    width: 18px;
    height: 18px;
    transform: rotate(45deg);
    color: #000;
}

.spym-marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--spym-accent);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    animation: spym-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes spym-pulse {
    0% { opacity: 0.4; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

/* Marker enter animation */
.spym-marker-enter {
    animation: spym-marker-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes spym-marker-drop {
    from { opacity: 0; transform: translateY(-30px) scale(0.5); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Empty State ──────────────────────────────── */

.spym-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--spym-text-dim);
    font-size: 13px;
}

.spym-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ─── Responsive ───────────────────────────────── */

@media (max-width: 900px) {
    .spym-wrapper {
        flex-direction: column-reverse;
    }
    
    .spym-panel {
        width: 100%;
        min-width: 100%;
        max-height: 300px;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .spym-map-container {
        min-height: 400px;
    }
    
    .spym-info-card {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .spym-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .spym-info-top {
        flex-direction: column;
    }
    
    .spym-info-image {
        width: 100%;
        height: 120px;
    }
    
    .spym-info-actions {
        flex-direction: column;
    }
}
