
.map-section-title { color: var(--primary); margin-top: 0; }
.map-section-desc { color: var(--text-light); line-height: 1.6; }
.map-empty-states { color: var(--text-light); font-size: 14px; margin-top: 15px; }
.map-noscript-notice { margin-top: 10px; padding: 12px; background: #fef3c7; border-radius: 4px; font-size: 14px; }

.map-section.sm-map-fullwidth { padding: 40px 0 0; }
.sm-map-header { margin-bottom: 20px; }
.sm-map-visual-fullwidth {
    position: relative;
    width: 100%; min-height: 450px;
    max-width: 1200px; margin: 0 auto; padding: 0 20px; box-sizing: border-box;
}
.sm-map-visual-fullwidth .map-visual { width: 100%; }
.sm-map-links-fullwidth { width: 100%; margin-top: 16px; padding: 24px 0 40px; background: white; border-top: 1px solid var(--border); }
.sm-map-links-fullwidth .state-list.state-list-wide {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 12px;
    max-width: 100%;
    align-items: start;
}

.sm-map-links-fullwidth .state-list.state-list-wide .state-link {
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    align-self: start;
    min-width: 0;
}

.sm-map-loc-name {
    padding: 2px 5px;
    margin: 0 -1px 0 0;
    border-radius: 3px;
    background: rgba(184, 95, 31, 0.12);
}
.state-link:hover .sm-map-loc-name,
.sc-state-link:hover .sm-map-loc-name {
    color: inherit;
    background: rgba(255, 255, 255, 0.2);
}
.sm-map-popup-link .sm-map-loc-name {
    padding: 1px 4px;
    border-radius: 2px;
    background: rgba(184, 95, 31, 0.12);
}
.sm-map-popup-link:hover .sm-map-loc-name { color: inherit; background: rgba(255, 255, 255, 0.15); }
.sm-map-cities-block { margin-bottom: 0; }
.sm-map-cities-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 10px 0;
}
.sm-map-other-states {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.sm-map-other-states-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 10px;
}
.sm-map-other-states .state-list { margin-top: 0; }

.sm-map-noscript-links .state-link {
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: min(100%, 22rem);
    min-width: 0;
}

.map-visual { position: relative; min-height: 450px; height: 450px; }
#sm-map-root { height: 450px !important; min-height: 450px !important; width: 100% !important; }
#sm-map-root.leaflet-container { height: 450px !important; }
.map-visual .map-loading {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 12px;
    background: #f1f5f9; color: var(--text-light); font-size: 14px;
    border-radius: 3px; z-index: 10;
}
.map-loading-spinner {
    width: 32px; height: 32px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: sm-map-spin 0.8s linear infinite;
}
@keyframes sm-map-spin { to { transform: rotate(360deg); } }
.map-visual .map-empty {
    display: flex; align-items: center; justify-content: center; min-height: 300px;
    padding: 30px; text-align: center; color: var(--text-light); font-size: 14px;
}
.sm-map-popup { padding: 4px 0; min-width: 200px; }
.sm-map-popup-name { display: block; font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.sm-map-popup-metal { font-size: 13px; color: var(--text-main); margin-bottom: 4px; }
.sm-map-popup-price { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.sm-map-popup-date { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.sm-map-popup-prices-grid { margin: 8px 0 10px 0; }
.sm-map-popup-prices-grid .sm-map-popup-date { margin-bottom: 6px; }
.sm-map-prices-grid-scroll { max-height: 260px; overflow-y: auto; overflow-x: hidden; }
.sm-map-prices-grid-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    font-size: 12px;
}
.sm-map-price-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.sm-map-price-item:last-child { border-bottom: none; }
.sm-map-prices-by-category { margin-top: 12px; }
.sm-map-prices-by-category:first-child { margin-top: 0; }
.sm-map-prices-category-title { font-size: 12px; font-weight: 600; color: var(--text-main, #334155); margin: 0 0 6px 0; padding-bottom: 4px; border-bottom: 1px solid var(--border, #e2e8f0); }
.sm-map-price-name { color: var(--text-main, #334155); word-wrap: break-word; flex: 1; min-width: 0; }
.sm-map-price-val { color: var(--primary); font-weight: 600; flex-shrink: 0; }
.sm-map-popup-address { font-size: 13px; color: var(--text-main); margin-bottom: 6px; line-height: 1.4; }
.sm-map-popup-phone { margin-bottom: 6px; }
.sm-map-popup-phone a { font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; }
.sm-map-popup-phone a:hover { text-decoration: underline; }
.sm-map-popup-loc { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.sm-map-popup-links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sm-map-popup-link { font-size: 12px; font-weight: 600; color: var(--accent); display: inline-block; }
.sm-map-popup-link:hover { text-decoration: underline; }
.leaflet-popup-content-wrapper { border-radius: 3px; }
.leaflet-container { font-family: inherit; }

.sm-map-state-popup .sm-map-popup-link { margin-top: 8px; display: inline-block; }

.sm-map-cluster-divicon { background: none !important; border: none !important; }
.sm-map-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}
.sm-map-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.sm-map-cluster span {
    line-height: 30px;
    color: #fff;
}
.sm-map-cluster.sm-map-cluster-small { background-color: rgba(181, 226, 140, 0.6); }
.sm-map-cluster.sm-map-cluster-small div { background-color: rgba(110, 204, 57, 0.6); }
.sm-map-cluster.sm-map-cluster-medium { background-color: rgba(241, 211, 87, 0.6); }
.sm-map-cluster.sm-map-cluster-medium div { background-color: rgba(240, 194, 12, 0.6); }
.sm-map-cluster.sm-map-cluster-large { background-color: rgba(253, 156, 115, 0.6); }
.sm-map-cluster.sm-map-cluster-large div { background-color: rgba(241, 128, 23, 0.6); }

.sm-map-back-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0 12px 0;
}
.sm-map-back-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.sm-map-back-bar .sm-map-current-state {
    font-size: 15px; font-weight: 600; color: var(--primary);
    background: white; padding: 6px 12px; border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.sm-map-back-bar .sm-map-back-btn {
    background: var(--primary) !important; color: white !important;
    padding: 8px 14px !important; border-radius: 3px !important;
    font-size: 14px !important; font-weight: 600 !important;
    cursor: pointer !important; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: none;
}
.sm-map-back-bar .sm-map-back-btn:hover { filter: brightness(1.1); }

.sm-map-price-marker-wrap { background: none !important; border: none !important; }
.sm-map-price-marker { 
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 4px 8px 6px;
    background: #fff;
    color: var(--primary, #ea580c);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border: 2px solid var(--primary, #ea580c);
    border-radius: 6px 6px 6px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.sm-map-price-marker-val { line-height: 1.2; }
.sm-map-price-marker.sm-map-price-marker-range { min-width: 64px; padding: 4px 10px 6px; font-size: 11px; }
.sm-map-price-marker-date {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-light, #64748b);
    line-height: 1.2;
    margin-top: 2px;
}

.sm-map-price-marker::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    margin-left: -6px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 12px solid var(--primary, #ea580c);
}
.sm-map-price-marker span {
    display: inline-block;
    position: relative;
    z-index: 1;
}
.leaflet-control .sm-map-back-btn,
.leaflet-control-container .sm-map-back-btn { cursor: pointer !important; user-select: none; }

.sm-map-company-modal {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
}
.sm-map-company-modal.sm-map-company-modal-visible {
    pointer-events: auto;
    visibility: visible;
}
.sm-map-company-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.2s;
}
.sm-map-company-modal.sm-map-company-modal-visible::before {
    opacity: 1;
}
.sm-map-company-modal-content {
    position: relative;
    min-width: 260px;
    max-width: 340px;
    padding: 44px 20px 20px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    pointer-events: auto;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s, transform 0.2s;
}
.sm-map-company-modal.sm-map-company-modal-visible .sm-map-company-modal-content {
    opacity: 1;
    transform: scale(1);
}
.sm-map-company-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sm-map-company-modal-close:hover {
    background: #e2e8f0;
    color: #334155;
}

@media (max-width: 992px) {
    .sm-map-links-fullwidth .state-list.state-list-wide { grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }
    .sm-map-links-fullwidth .state-list.state-list-wide .state-link { padding: 5px 8px; font-size: 12px; }
}
@media (max-width: 768px) {
    .sm-map-visual-fullwidth .map-visual { min-height: 320px; height: 320px; }
    #sm-map-root { height: 320px !important; min-height: 320px !important; }
    .sm-map-links-fullwidth .state-list.state-list-wide { grid-template-columns: repeat(2, 1fr); gap: 5px 6px; }
    .sm-map-links-fullwidth .state-list.state-list-wide .state-link { padding: 5px 6px; font-size: 11px; }
}
@media (max-width: 360px) {
    .sm-map-links-fullwidth .state-list.state-list-wide { grid-template-columns: 1fr; gap: 4px; }
    .sm-map-links-fullwidth .state-list.state-list-wide .state-link { padding: 6px 10px; font-size: 13px; }
}
