/* =====================================================================
   Coffee World Map v2.1 — Тёплый, выразительный дизайн
   ===================================================================== */

/* ── Контейнер ── */
.coffee-world-map-container {
    max-width: 1200px;
    margin: 30px auto 50px;
    padding: 0;
    background: linear-gradient(165deg, #FFFCF5 0%, #FFF8EE 40%, #FFF5E6 100%);
    border-radius: 24px;
    box-shadow:
        0 1px 2px rgba(120,70,20,0.04),
        0 4px 12px rgba(120,70,20,0.06),
        0 16px 40px rgba(120,70,20,0.07);
    border: 1px solid rgba(200,168,130,0.25);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* ── Заголовочная область ── */
.coffee-map-header {
    padding: 32px 32px 0;
    text-align: center;
}

.coffee-map-title {
    color: #3C2415;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
    line-height: 1.2;
    padding: 32px 24px 0;
}
.coffee-map-title::before {
    content: '☕';
    margin-right: 10px;
    font-size: 26px;
}

.coffee-map-subtitle {
    color: #8B7355;
    font-size: 15px;
    font-weight: 400;
    text-align: center;
    margin: 0 0 24px;
    padding: 0 24px;
    line-height: 1.5;
}

/* ── Фильтры ── */
.cwm-filters-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.cwm-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 12px;
    background: rgba(60,36,21,0.06);
    color: #5D4E37;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.cwm-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 24px;
    margin-bottom: 20px;
}

.cwm-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1.5px solid rgba(139,115,85,0.2);
    border-radius: 24px;
    background: rgba(255,255,255,0.7);
    color: #5D4E37;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    font-family: inherit;
    line-height: 1;
    backdrop-filter: blur(4px);
}
.cwm-filter-btn:hover {
    background: rgba(255,255,255,0.95);
    border-color: rgba(139,115,85,0.35);
    box-shadow: 0 2px 8px rgba(120,70,20,0.1);
    transform: translateY(-1px);
}
.cwm-filter-btn.active {
    background: #3C2415;
    color: #FFF8EE;
    border-color: #3C2415;
    box-shadow: 0 4px 12px rgba(60,36,21,0.25);
}

.cwm-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(60,36,21,0.08);
    font-size: 11px;
    font-weight: 700;
}
.cwm-filter-btn.active .cwm-filter-count {
    background: rgba(255,248,238,0.2);
}

/* Цветные активные фильтры */
.cwm-filter-specialty.active {
    background: linear-gradient(135deg, #D97706, #B45309);
    border-color: #B45309;
    box-shadow: 0 4px 16px rgba(217,119,6,0.3);
}
.cwm-filter-commercial.active {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #047857;
    box-shadow: 0 4px 16px rgba(5,150,105,0.3);
}
.cwm-filter-exotic.active {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    border-color: #6D28D9;
    box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}

/* ── Карта ── */
.coffee-world-map {
    width: calc(100% - 32px);
    height: 520px !important;
    margin: 0 16px;
    border-radius: 16px;
    border: 1.5px solid rgba(139,115,85,0.15);
    background: #F5F0E8;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(120,70,20,0.06);
}

/* Leaflet overrides */
.coffee-world-map .leaflet-container {
    border-radius: 16px;
    font-family: inherit;
    background: #F5F0E8 !important;
}

.coffee-world-map .leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    border-radius: 12px !important;
    overflow: hidden;
}
.coffee-world-map .leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    color: #5D4E37 !important;
    border: none !important;
    background: rgba(255,252,245,0.95) !important;
    transition: background 0.15s;
}
.coffee-world-map .leaflet-control-zoom a:hover {
    background: #FFF8EE !important;
    color: #3C2415 !important;
}
.coffee-world-map .leaflet-control-zoom-in {
    border-bottom: 1px solid rgba(139,115,85,0.12) !important;
    border-radius: 12px 12px 0 0 !important;
}
.coffee-world-map .leaflet-control-zoom-out {
    border-radius: 0 0 12px 12px !important;
}

.leaflet-control-attribution {
    background: rgba(255,252,245,0.85) !important;
    font-size: 10px !important;
    color: #A89880 !important;
    border-radius: 6px 0 0 0 !important;
    padding: 3px 8px !important;
    border: none !important;
}
.leaflet-control-attribution a {
    color: #8B7355 !important;
}

/* ── Тултип ── */
.cwm-tooltip {
    padding: 10px 14px !important;
    background: #3C2415 !important;
    color: #FFF8EE !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(60,36,21,0.25) !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
    font-weight: 500 !important;
}
.cwm-tooltip::before {
    border-top-color: #3C2415 !important;
}

/* ── Маркеры на карте ── */
.cwm-marker {
    cursor: pointer !important;
}

/* Leaflet marker pane блокирует клики по SVG circleMarker'ам (z-index 600 vs 400).
   Делаем его прозрачным для кликов, т.к. мы не используем L.marker. */
.leaflet-marker-pane {
    pointer-events: none !important;
}

/* Пульсация маркеров */
@keyframes cwmPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

/* ── Модальное окно ── */
.cwm-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30,20,10,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cwmFadeIn 0.2s ease;
}

@keyframes cwmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cwm-modal {
    background: linear-gradient(180deg, #FFFCF5 0%, #FFFFFF 30%);
    border-radius: 20px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow:
        0 8px 24px rgba(60,36,21,0.12),
        0 24px 64px rgba(60,36,21,0.18);
    animation: cwmSlideUp 0.3s cubic-bezier(0.16,1,0.3,1);
    border: 1px solid rgba(200,168,130,0.2);
}

@keyframes cwmSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cwm-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 28px 28px 18px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.cwm-modal-title {
    font-size: 24px;
    font-weight: 800;
    color: #3C2415;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.cwm-modal-country {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #8B7355;
    margin-top: 6px;
    padding: 4px 10px;
    background: rgba(60,36,21,0.05);
    border-radius: 8px;
    font-weight: 500;
}

.cwm-modal-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(60,36,21,0.06);
    border-radius: 12px;
    cursor: pointer;
    font-size: 22px;
    color: #8B7355;
    transition: all 0.2s;
    line-height: 1;
}
.cwm-modal-close:hover {
    background: rgba(60,36,21,0.12);
    color: #3C2415;
    transform: scale(1.05);
}

.cwm-modal-body {
    padding: 0 28px 28px;
}

.cwm-modal-desc {
    font-size: 15px;
    line-height: 1.75;
    color: #5D4E37;
    margin: 0 0 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(217,119,6,0.06), rgba(217,119,6,0.02));
    border-radius: 14px;
    border-left: 3px solid #D97706;
}

.cwm-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #A89880;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 28px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid rgba(139,115,85,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cwm-section-title::before {
    content: '';
    width: 4px;
    height: 14px;
    background: #D97706;
    border-radius: 2px;
}

/* ── Карточки ── */
.cwm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.cwm-card {
    background: linear-gradient(135deg, #FFFCF5, #FFFFFF);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(139,115,85,0.1);
    transition: all 0.2s ease;
    position: relative;
}
.cwm-card:hover {
    border-color: rgba(217,119,6,0.25);
    box-shadow: 0 2px 8px rgba(217,119,6,0.08);
    transform: translateY(-1px);
}

.cwm-card-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #A89880;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.cwm-card-icon {
    font-size: 13px;
    vertical-align: middle;
    margin-right: 2px;
}

.cwm-card-value {
    display: block;
    font-size: 14px;
    color: #3C2415;
    line-height: 1.55;
    font-weight: 500;
}

.cwm-history-text {
    font-size: 14px;
    line-height: 1.75;
    color: #5D4E37;
    margin: 8px 0 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FFFBEB, #FFF8EE);
    border-radius: 14px;
    border-left: 3px solid #D97706;
    font-style: italic;
}

/* ── Загрузка ── */
.cwm-loading-box {
    background: #FFFCF5;
    border-radius: 16px;
    padding: 36px 44px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(60,36,21,0.2);
    border: 1px solid rgba(200,168,130,0.2);
}
.cwm-loading-box p {
    margin: 14px 0 0;
    color: #8B7355;
    font-size: 14px;
    font-weight: 500;
}
.cwm-loading-spinner {
    width: 36px; height: 36px;
    margin: 0 auto;
    border: 3px solid rgba(139,115,85,0.15);
    border-top-color: #D97706;
    border-radius: 50%;
    animation: cwmSpin 0.8s linear infinite;
}
@keyframes cwmSpin {
    to { transform: rotate(360deg); }
}

/* ── Панель регионов ── */
.cwm-regions-panel {
    margin: 0;
    padding: 28px 24px 24px;
    background: linear-gradient(180deg, transparent, rgba(60,36,21,0.02));
}

.cwm-panel-title {
    font-size: 20px;
    font-weight: 800;
    color: #3C2415;
    margin: 0 0 14px;
    letter-spacing: -0.3px;
}
.cwm-panel-title::before {
    content: '📋';
    margin-right: 8px;
    font-size: 18px;
}

.cwm-search {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid rgba(139,115,85,0.18);
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    color: #3C2415;
    background: rgba(255,255,255,0.8);
    box-sizing: border-box;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    font-weight: 500;
}
.cwm-search:focus {
    outline: none;
    border-color: #D97706;
    box-shadow: 0 0 0 4px rgba(217,119,6,0.1);
    background: #FFFFFF;
}
.cwm-search::placeholder {
    color: #B8A68E;
    font-weight: 400;
}

.cwm-regions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.cwm-cat-section {
    min-width: 0;
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(139,115,85,0.08);
}

.cwm-cat-header {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cwm-cat-count {
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,0.06);
    padding: 2px 8px;
    border-radius: 10px;
}

.cwm-cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 420px;
    overflow-y: auto;
}

.cwm-region-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cwm-region-item:hover {
    background: rgba(217,119,6,0.07);
    transform: translateX(3px);
}

.cwm-region-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 1px 3px rgba(0,0,0,0.15);
}

.cwm-region-name {
    font-size: 13px;
    color: #5D4E37;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .cwm-regions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .coffee-world-map-container {
        margin: 12px auto 28px;
        border-radius: 20px;
    }
    .coffee-map-title {
        font-size: 22px;
        padding: 24px 16px 0;
    }
    .coffee-map-subtitle {
        padding: 0 16px;
        margin-bottom: 16px;
    }
    .cwm-filters {
        padding: 0 16px;
        gap: 6px;
    }
    .cwm-filter-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    .coffee-world-map {
        width: calc(100% - 16px);
        margin: 0 8px;
        height: 380px !important;
    }
    .cwm-modal {
        max-height: 90vh;
        border-radius: 16px;
    }
    .cwm-modal-overlay {
        padding: 10px;
    }
    .cwm-modal-header {
        padding: 20px 20px 14px;
    }
    .cwm-modal-body {
        padding: 0 20px 20px;
    }
    .cwm-modal-title {
        font-size: 20px;
    }
    .cwm-cards {
        grid-template-columns: 1fr 1fr;
    }
    .cwm-regions-panel {
        padding: 20px 16px;
    }
}

@media (max-width: 600px) {
    .cwm-regions-grid {
        grid-template-columns: 1fr;
    }
    .cwm-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .coffee-world-map {
        width: calc(100% - 8px);
        margin: 0 4px;
        height: 300px !important;
    }
    .coffee-map-title {
        font-size: 20px;
    }
    .cwm-filter-btn {
        padding: 7px 12px;
        font-size: 11px;
    }
    .cwm-modal-title {
        font-size: 18px;
    }
    .cwm-modal-header {
        padding: 16px 16px 12px;
    }
    .cwm-modal-body {
        padding: 0 16px 16px;
    }
}

/* ── Скроллбары ── */
.cwm-cat-list::-webkit-scrollbar,
.cwm-modal::-webkit-scrollbar {
    width: 5px;
}
.cwm-cat-list::-webkit-scrollbar-track,
.cwm-modal::-webkit-scrollbar-track {
    background: transparent;
}
.cwm-cat-list::-webkit-scrollbar-thumb,
.cwm-modal::-webkit-scrollbar-thumb {
    background: rgba(139,115,85,0.2);
    border-radius: 3px;
}
.cwm-cat-list::-webkit-scrollbar-thumb:hover,
.cwm-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(139,115,85,0.35);
}

/* ── Панель управления для не-администраторов (скрытие) ── */
body:not(.coffee-admin-user) .coffee-icon-control-panel,
body:not(.coffee-admin-user) .icon-control-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
/* =====================================================================
   Coffee World Map v2.0 — Современные минималистичные стили
   ===================================================================== */

/* Контейнер */
.coffee-world-map-container {
    max-width: 1200px;
    margin: 30px auto 50px;
    padding: 24px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.05);
    border: 1px solid #E5E7EB;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Заголовок */
.coffee-map-title {
    color: #111827;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

/* Подзаголовок */
.coffee-map-subtitle {
    color: #6B7280;
    font-size: 15px;
    font-weight: 400;
    text-align: center;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ── Фильтры ── */
.cwm-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.cwm-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 20px;
    background: #FFFFFF;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
}
.cwm-filter-btn:hover {
    border-color: #9CA3AF;
    background: #F9FAFB;
}
.cwm-filter-btn.active {
    background: #111827;
    color: #FFFFFF;
    border-color: #111827;
}

.cwm-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: rgba(0,0,0,0.08);
    font-size: 11px;
    font-weight: 600;
}
.cwm-filter-btn.active .cwm-filter-count {
    background: rgba(255,255,255,0.2);
}

/* Цветные фильтры */
.cwm-filter-specialty.active { background: #D97706; border-color: #D97706; }
.cwm-filter-commercial.active { background: #059669; border-color: #059669; }
.cwm-filter-exotic.active { background: #7C3AED; border-color: #7C3AED; }

/* ── Карта ── */
.coffee-world-map {
    width: 100%;
    height: 500px !important;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    overflow: hidden;
    position: relative;
}

/* Leaflet overrides */
.coffee-world-map .leaflet-container {
    border-radius: 12px;
    font-family: inherit;
}
.coffee-world-map .leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    color: #374151 !important;
    border: 1px solid #D1D5DB !important;
    background: #FFFFFF !important;
}
.coffee-world-map .leaflet-control-zoom a:hover {
    background: #F3F4F6 !important;
}
.coffee-world-map .leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
}

/* ── Тултип ── */
.cwm-tooltip {
    padding: 8px 12px !important;
    background: #1F2937 !important;
    color: #FFFFFF !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
}
.cwm-tooltip::before {
    border-top-color: #1F2937 !important;
}

/* ── Модальное окно ── */
.cwm-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cwmFadeIn 0.2s ease;
}

@keyframes cwmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cwm-modal {
    background: #FFFFFF;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: cwmSlideUp 0.25s ease;
}

@keyframes cwmSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cwm-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-radius: 16px 16px 0 0;
}

.cwm-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.cwm-modal-country {
    display: block;
    font-size: 14px;
    color: #6B7280;
    margin-top: 4px;
}

.cwm-modal-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
    cursor: pointer;
    font-size: 22px;
    color: #6B7280;
    transition: all 0.15s;
    line-height: 1;
}
.cwm-modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #111827;
}

.cwm-modal-body {
    padding: 0 24px 24px;
}

.cwm-modal-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    margin: 0 0 20px;
}

.cwm-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #F3F4F6;
}

/* ── Карточки ── */
.cwm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.cwm-card {
    background: #F9FAFB;
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #F3F4F6;
    transition: border-color 0.15s;
}
.cwm-card:hover {
    border-color: #D1D5DB;
}

.cwm-card-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.cwm-card-icon {
    font-size: 13px;
    vertical-align: middle;
    margin-right: 2px;
}

.cwm-card-value {
    display: block;
    font-size: 14px;
    color: #111827;
    line-height: 1.5;
    font-weight: 500;
}

.cwm-history-text {
    font-size: 14px;
    line-height: 1.7;
    color: #4B5563;
    margin: 8px 0 0;
    padding: 12px 16px;
    background: #FFFBEB;
    border-radius: 10px;
    border-left: 3px solid #D97706;
}

/* ── Загрузка ── */
.cwm-loading-box {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.cwm-loading-box p {
    margin: 12px 0 0;
    color: #6B7280;
    font-size: 14px;
}
.cwm-loading-spinner {
    width: 32px; height: 32px;
    margin: 0 auto;
    border: 3px solid #E5E7EB;
    border-top-color: #D97706;
    border-radius: 50%;
    animation: cwmSpin 0.8s linear infinite;
}
@keyframes cwmSpin {
    to { transform: rotate(360deg); }
}

/* ── Панель регионов ── */
.cwm-regions-panel {
    margin-top: 24px;
}

.cwm-panel-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px;
}

.cwm-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: #FFFFFF;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 16px;
}
.cwm-search:focus {
    outline: none;
    border-color: #D97706;
    box-shadow: 0 0 0 3px rgba(217,119,6,0.1);
}
.cwm-search::placeholder {
    color: #9CA3AF;
}

.cwm-regions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.cwm-cat-section {
    min-width: 0;
}

.cwm-cat-header {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cwm-cat-count {
    font-size: 11px;
    font-weight: 600;
    background: rgba(0,0,0,0.06);
    padding: 1px 7px;
    border-radius: 8px;
}

.cwm-cat-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 400px;
    overflow-y: auto;
}

.cwm-region-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.cwm-region-item:hover {
    background: #F3F4F6;
}

.cwm-region-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cwm-region-name {
    font-size: 13px;
    color: #374151;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Маркеры на карте ── */
.cwm-marker {
    cursor: pointer !important;
    transition: r 0.15s ease;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .cwm-regions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .coffee-world-map-container {
        padding: 16px;
        margin: 16px auto 32px;
        border-radius: 12px;
    }
    .coffee-map-title {
        font-size: 22px;
    }
    .coffee-world-map {
        height: 360px !important;
    }
    .cwm-filters {
        gap: 6px;
    }
    .cwm-filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .cwm-modal {
        max-height: 90vh;
        border-radius: 12px;
    }
    .cwm-modal-overlay {
        padding: 10px;
    }
    .cwm-modal-header {
        padding: 16px 16px 12px;
    }
    .cwm-modal-body {
        padding: 0 16px 16px;
    }
    .cwm-modal-title {
        font-size: 18px;
    }
    .cwm-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .cwm-regions-grid {
        grid-template-columns: 1fr;
    }
    .cwm-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .coffee-world-map {
        height: 280px !important;
    }
    .cwm-filter-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    .cwm-modal-title {
        font-size: 16px;
    }
}

/* Скроллбар панели регионов */
.cwm-cat-list::-webkit-scrollbar {
    width: 4px;
}
.cwm-cat-list::-webkit-scrollbar-track {
    background: transparent;
}
.cwm-cat-list::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 2px;
}
.cwm-cat-list::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Скроллбар модала */
.cwm-modal::-webkit-scrollbar {
    width: 6px;
}
.cwm-modal::-webkit-scrollbar-track {
    background: transparent;
}
.cwm-modal::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}
/* Контейнер карты - легкий корейский стиль */
.coffee-world-map-container {
    max-width: 1200px;
    margin: 30px auto 50px auto;
    padding: 25px;
    background: linear-gradient(145deg, #FEFEFE, #F8F9FA);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border: 1px solid #E8E9EA;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Заголовок карты - корейский стиль */
.coffee-map-title {
    color: #374151;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 16px 0;
    padding: 0;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

/* Подзаголовок карты - корейский стиль */
.coffee-map-subtitle {
    color: #6B7280;
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    margin: 0 0 30px 0;
    padding: 0 20px;
    line-height: 1.6;
    letter-spacing: 0.2px;
}

/* Основная карта */
.coffee-world-map {
    width: 100%;
    height: 500px !important;
    border-radius: 15px;
    border: 2px solid #E0E7FF;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.08), inset 0 1px 3px rgba(139, 92, 246, 0.05);
    background: #F8FAFC; /* Нейтральный светло-серый фон */
    overflow: hidden;
    position: relative;
}

/* Убираем любые возможные отступы и поля */
.coffee-world-map * {
    box-sizing: border-box;
}

.coffee-world-map .leaflet-container {
    margin: 0 !important;
    padding: 0 !important;
    background: #F8FAFC !important; /* Нейтральный светло-серый фон */
}

/* Принудительное растяжение на всю ширину */
.coffee-world-map #leaflet-map {
    position: relative !important;
    width: 100% !important;
    height: 500px !important;
    min-width: 100% !important;
}

/* Стили для Leaflet карты */
#leaflet-map {
    height: 500px !important;
    width: 100% !important;
    border-radius: 12px;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif !important;
    min-height: 500px !important;
    background: #F8FAFC !important; /* Нейтральный светло-серый фон */
}

/* Стилизация тайлов карты */
#leaflet-map .leaflet-tile-pane {
    filter: brightness(1.05) saturate(0.9) contrast(1.05);
    width: 100% !important;
    height: 100% !important;
}

/* Убираем возможные ограничения */
.leaflet-tile {
    max-width: none !important;
    max-height: none !important;
}

.leaflet-layer {
    width: 100% !important;
    height: 100% !important;
}

/* Принудительное заполнение всего пространства */
.leaflet-control-container {
    width: 100% !important;
    height: 100% !important;
}

.leaflet-top, .leaflet-bottom {
    width: 100% !important;
}

.leaflet-left, .leaflet-right {
    height: 100% !important;
}

/* Убираем возможные пустые области */
.leaflet-overlay-pane {
    width: 100% !important;
    height: 100% !important;
}

.leaflet-marker-pane {
    width: 100% !important;
    height: 100% !important;
}

/* Фиксация размеров контейнера */
.leaflet-container {
    height: 500px !important;
    width: 100% !important;
    max-width: none !important;
    background: #F8FAFC !important; /* Нейтральный светло-серый фон */
    position: relative !important;
}

.leaflet-map-pane {
    width: 100% !important;
    height: 100% !important;
}

.leaflet-tile-pane {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .leaflet-container {
        height: 350px !important;
    }
}

/* Кастомные маркеры кофе */
.coffee-marker {
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
}

.coffee-marker-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* PNG иконка кофе */
.coffee-icon-png {
    width: 32px;
    height: 32px;
    margin-bottom: 2px;
    background-image: url('https://justacup.ru/wp-content/uploads/2024/12/Logo-Just-1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: coffee-pulse 2s infinite ease-in-out;
    flex-shrink: 0;
/*    filter: hue-rotate(300deg) saturate(0.8) brightness(1.1);   */
}

.coffee-label {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #E0E7FF;
    white-space: nowrap;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
    max-width: 120px;
    min-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

/* Стили для разных типов кофе - корейские пастельные тона */
.arabica-marker .coffee-label {
    background: rgba(255, 228, 230, 0.95); /* Мягкий розовый для арабики */
    border: 1px solid #FCA5A5;
    color: #374151;
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.15);
}

.robusta-marker .coffee-label {
    background: rgba(209, 250, 229, 0.95); /* Мятный зеленый для робусты */
    border: 1px solid #6EE7B7;
    color: #374151;
    box-shadow: 0 2px 8px rgba(52, 211, 153, 0.15);
}

.liberica-marker .coffee-label {
    background: rgba(237, 233, 254, 0.95); /* Лавандовый для либерики */
    border: 1px solid #C4B5FD;
    color: #374151;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

/* Стили для разных типов кофе - PNG иконки */
.arabica-icon {
    /* Золотистый фильтр для арабики 
    filter: hue-rotate(0deg) saturate(1.2) brightness(1.1);*/
}

.robusta-icon {
    /* Коричневый фильтр для робусты 
    filter: hue-rotate(210deg) saturate(0.8) brightness(0.8) sepia(0.3);*/
}

.liberica-icon {
    /* Фиолетовый фильтр для либерики 
    filter: hue-rotate(240deg) saturate(1.3) brightness(0.9); */
}

/* Анимация для кофейных иконок */
@keyframes coffee-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Тултипы Leaflet */
.coffee-tooltip-leaflet {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid #E0E7FF !important;
    border-radius: 12px !important;
    color: #374151 !important;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1) !important;
    padding: 12px 16px !important;
    text-shadow: none !important;
    letter-spacing: 0.2px !important;
    line-height: 1.4 !important;
    min-width: 150px !important;
    text-align: center !important;
}

/* Контролы Leaflet */
.leaflet-control-zoom a {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #E0E7FF !important;
    color: #6366F1 !important;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif !important;
    font-weight: 500 !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(238, 242, 255, 0.98) !important;
    border-color: #C4B5FD !important;
}

.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #E0E7FF !important;
    border-radius: 8px !important;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif !important;
    font-size: 10px !important;
    color: #9CA3AF !important;
}

/* Модальные окна - корейский стиль */
.coffee-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    overflow-y: auto;
}

.coffee-modal-content {
    position: relative;
    background: linear-gradient(145deg, #FFFFFF, #F9FAFB);
    margin: 2% auto;
    padding: 0;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    width: 90%;
    max-width: 1200px;
    max-height: 95vh;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: modalSlideIn 0.4s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.coffee-modal-header {
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    color: #374151;
    padding: 20px 25px;
    border-radius: 19px 19px 0 0;
    border-bottom: 1px solid #E5E7EB;
    position: relative;
    flex-shrink: 0;
}

.coffee-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-shadow: none;
}

.coffee-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
}

.coffee-close:hover {
    color: #6B7280;
    background: rgba(243, 244, 246, 0.8);
    transform: translateY(-50%) scale(1.05);
}

.coffee-modal-body {
    padding: 30px;
    color: #374151;
    overflow-y: auto;
    flex: 1;
    max-height: calc(95vh - 120px);
}

/* Кастомный скроллбар для модального окна */
.coffee-modal-body::-webkit-scrollbar {
    width: 6px;
}

.coffee-modal-body::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 3px;
}

.coffee-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #E0E7FF, #C4B5FD);
    border-radius: 3px;
}

.coffee-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #C4B5FD, #A78BFA);
}

.coffee-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.coffee-info-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #F3F4F6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.coffee-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.08);
}

.coffee-info-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #374151;
    font-weight: 600;
    border-bottom: 1px solid #F3F4F6;
    padding-bottom: 8px;
}

.q-grade-badge {
    background: linear-gradient(135deg, #FDE68A, #F59E0B);
    color: #92400E;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

/* Секции модального окна */
.coffee-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 1px solid #F3F4F6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.section-title {
    color: #374151;
    font-size: 18px;
    margin: 0 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #E0E7FF;
    font-weight: 600;
    text-shadow: none;
}

/* Легенда */
.coffee-regions-legend {
    margin-top: 45px;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 1px solid #F3F4F6;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.coffee-regions-legend h3 {
    color: #374151;
    font-size: 18px;
    margin: 0 0 25px 0;
    text-align: center;
    font-weight: 600;
    text-shadow: none;
}

/* Анимации */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .coffee-world-map-container {
        margin: 15px 15px 40px 15px;
        padding: 15px;
    }
    
    .coffee-world-map, #leaflet-map {
        height: 350px !important;
        min-height: 350px !important;
    }
    
    .coffee-marker-content {
        transform: scale(0.8);
    }
    
    .coffee-icon-png {
        width: 26px;
        height: 26px;
    }
    
    .coffee-label {
        font-size: 10px;
        padding: 2px 4px;
        max-width: 100px;
        min-width: 50px;
        letter-spacing: 0.2px;
    }
    
    .coffee-types-legend {
        gap: 10px !important;
        margin-top: 10px !important;
    }
    
    .legend-item span:last-child {
        font-size: 10px !important;
    }
    
    .coffee-modal-content {
        width: 95%;
        margin: 1% auto;
        max-height: 98vh;
    }
    
    .coffee-modal-body {
        padding: 20px;
        max-height: calc(98vh - 100px);
    }
    
    .coffee-modal-header {
        padding: 15px 20px;
    }
    
    .coffee-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .coffee-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

/* Дополнительная адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .coffee-modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 99vh;
    }
    
    .coffee-modal-body {
        padding: 15px;
        max-height: calc(99vh - 80px);
    }
    
    .coffee-modal-header {
        padding: 12px 15px;
    }
    
    .coffee-modal-header h2 {
        font-size: 20px;
    }
    
    .coffee-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .coffee-types-legend {
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .legend-item span:last-child {
        font-size: 9px !important;
    }
}

/* ============================================
   УЛУЧШЕНИЯ ЧИТАЕМОСТИ (v2.0)
   ============================================
   ✅ Увеличены размеры шрифтов маркеров с 9px до 11px
   ✅ Улучшена контрастность фона меток (белый фон)
   ✅ Добавлены четкие границы и тени для лучшей видимости
   ✅ Улучшены тултипы: больше размер, белый фон, темные границы
   ✅ Оптимизированы цвета для разных типов кофе
   ✅ Добавлены лучшие тени и фильтры для иконок
   ✅ Обновлены мобильные стили для сохранения читаемости
   ✅ Увеличены размеры маркеров для лучшего восприятия
   
   UPDATE v2.1 - ЗАМЕНА ИКОНОК НА SVG:
   ✅ Заменена emoji иконка ☕ на качественную SVG иконку кофейной чашки
   ✅ Убраны все тени как запрашивал пользователь
   ✅ Добавлены цветовые фильтры для разных типов кофе
   ✅ Создана детализированная иконка с чашкой, блюдцем, ручкой и паром
   ✅ Оптимизированы размеры: десктоп 32x32px, мобильные 26x26px
   
   UPDATE v2.2 - ДОБАВЛЕН СПИСОК РЕГИОНОВ:
   ✅ Добавлен интерактивный список всех 40 регионов
   ✅ Группировка по типам кофе (Арабика, Робуста, Либерика)
   ✅ Поиск по названию региона
   ✅ Клик по региону открывает подробную информацию
   ✅ Красивые стили и адаптивный дизайн
   ============================================ */

/* ============================================
   СТИЛИ ДЛЯ СПИСКА РЕГИОНОВ
   ============================================ */

.coffee-regions-list-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #E0E7FF;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.08);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.coffee-regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.region-category {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #F3F4F6;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.06);
}

.category-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
}

.category-header:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.toggle-icon {
    font-size: 12px;
    margin-left: 8px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.region-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.region-list::-webkit-scrollbar {
    width: 6px;
}

.region-list::-webkit-scrollbar-track {
    background: rgba(243, 244, 246, 0.5);
    border-radius: 3px;
}

.region-list::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 3px;
}

.region-list::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

.region-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 6px 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.8);
}

.region-list-item:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.12);
    transform: translateY(-1px);
    border-color: #E0E7FF;
}

.region-list-item:active {
    transform: translateY(0px);
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.15);
}

.region-list-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid;
}

.region-list-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

/* Стили для разных типов кофе в списке - корейские пастельные тона */
.arabica-region .region-list-marker {
    background: #FCA5A5;
    border-color: #F87171;
}

.arabica-region:hover {
    border-color: #F87171;
    background: rgba(252, 165, 165, 0.15);
}

.robusta-region .region-list-marker {
    background: #6EE7B7;
    border-color: #34D399;
}

.robusta-region:hover {
    border-color: #34D399;
    background: rgba(110, 231, 183, 0.15);
}

.liberica-region .region-list-marker {
    background: #C4B5FD;
    border-color: #A78BFA;
}

.liberica-region:hover {
    border-color: #A78BFA;
    background: rgba(196, 181, 253, 0.15);
}

/* Стили для поиска */
#region-search {
    padding: 10px 16px;
    border: 1px solid #E0E7FF;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #374151;
    font-size: 14px;
    width: 300px;
    max-width: 90%;
    transition: all 0.3s ease;
    font-family: "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

#region-search:focus {
    outline: none;
    border-color: #8B5CF6;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 1);
}

#region-search::placeholder {
    color: #9CA3AF;
    opacity: 0.8;
}

/* Мобильные стили для списка регионов */
@media (max-width: 768px) {
    .coffee-regions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .coffee-regions-list-container {
        padding: 15px;
    }
    
    .region-list {
        max-height: 250px;
    }
    
    .region-list-item {
        padding: 8px 10px;
    }
    
    .region-list-name {
        font-size: 12px;
    }
    
    #region-search {
        width: 95%;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .region-category {
        padding: 12px;
    }
}

/* Улучшенная мобильная адаптация */

/* Большие планшеты и маленькие десктопы */
@media (max-width: 1024px) {
    .coffee-world-map-container {
        max-width: 95%;
        margin: 20px auto 40px auto;
        padding: 20px;
    }
    
    .coffee-world-map, #leaflet-map {
        height: 450px !important;
        min-height: 450px !important;
    }
    
    .coffee-modal-content {
        width: 92%;
        max-height: 90vh;
    }
    
    .coffee-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
    }
}

/* Планшеты */
@media (max-width: 768px) {
    .coffee-world-map-container {
        margin: 15px 10px 30px 10px;
        padding: 15px;
        border-radius: 15px;
    }
    
    .coffee-world-map, #leaflet-map {
        height: 350px !important;
        min-height: 350px !important;
        border-radius: 12px;
        border-width: 2px;
    }
    
    /* Маркеры для планшетов */
    .coffee-marker-content {
        transform: scale(0.9);
        transition: transform 0.2s ease;
    }
    
    .coffee-marker-content:hover {
        transform: scale(1.0);
    }
    
    .coffee-icon-png {
        width: 28px;
        height: 28px;
    }
    
    .coffee-label {
        font-size: 10px;
        padding: 2px 5px;
        max-width: 110px;
        min-width: 55px;
        letter-spacing: 0.2px;
        border-width: 1.5px;
    }
    
    /* Модальные окна для планшетов */
    .coffee-modal-content {
        width: 95%;
        margin: 3% auto;
        max-height: 94vh;
        border-radius: 15px;
    }
    
    .coffee-modal-body {
        padding: 25px 20px;
        max-height: calc(94vh - 110px);
    }
    
    .coffee-modal-header {
        padding: 18px 20px;
    }
    
    .coffee-modal-header h2 {
        font-size: 22px;
        padding-right: 50px;
    }
    
    .coffee-close {
        width: 35px;
        height: 35px;
        font-size: 28px;
        right: 15px;
    }
    
    .coffee-info-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .coffee-info-card {
        padding: 15px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    /* Легенда для планшетов */
    .coffee-regions-legend {
        margin-top: 25px;
        padding: 20px;
    }
    
    .coffee-types-legend {
        gap: 15px !important;
        margin-top: 15px !important;
        flex-wrap: wrap;
    }
    
    .legend-item {
        flex: 1 1 calc(50% - 7.5px);
        min-width: 120px;
    }
    
    .legend-item span:last-child {
        font-size: 11px !important;
    }
}

/* Мобильные телефоны */
@media (max-width: 480px) {
    .coffee-world-map-container {
        height: 535px !important;
        margin: 10px 5px 20px 5px;
        padding: 12px;
        border-radius: 12px;
        border-width: 1px;
    }
    
    .coffee-world-map, #leaflet-map {
        height: 280px !important;
        min-height: 280px !important;
        border-radius: 10px;
        border-width: 2px;
    }
    
    /* Маркеры для мобильных */
    .coffee-marker-content {
        transform: scale(0.7);
        transition: transform 0.3s ease;
    }
    
    .coffee-marker-content:active {
        transform: scale(0.8);
    }
    
    .coffee-icon-png {
        width: 36px;
        height: 36px;
    }
    
    .coffee-label {
        font-size: 18px;
        padding: 1px 4px;
        max-width: 200px;
        min-width: 45px;
        letter-spacing: 0.1px;
        border-width: 1px;
        border-radius: 6px;
        line-height: 1.1;
    }
    
    /* Увеличенная область касания для мобильных */
    .leaflet-marker-icon {
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0.2);
    }
    
    /* Модальные окна для мобильных */
    .coffee-modal {
        padding: 0;
    }
    
    .coffee-modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 98vh;
        border-radius: 12px;
        border-width: 2px;
    }
    
    .coffee-modal-header {
        padding: 15px;
        border-radius: 10px 10px 0 0;
    }
    
    .coffee-modal-header h2 {
        font-size: 18px;
        line-height: 1.2;
        padding-right: 40px;
        margin: 0;
    }
    
    .coffee-close {
        width: 30px;
        height: 30px;
        font-size: 24px;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .coffee-modal-body {
        padding: 20px 15px;
        max-height: calc(98vh - 90px);
        font-size: 14px;
    }
    
    .coffee-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .coffee-info-card {
        padding: 12px;
        border-radius: 8px;
    }
    
    .coffee-info-card h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .coffee-section {
        margin-bottom: 20px;
        padding: 15px;
        border-radius: 8px;
    }
    
    .section-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    /* Легенда для мобильных */
    .coffee-regions-legend {
        margin-top: 30px;
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 10px;
    }
    
    .coffee-regions-legend h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .coffee-types-legend {
        flex-direction: column !important;
        gap: 10px !important;
        margin-top: 10px !important;
    }
    
    .legend-item {
        flex: none;
        width: 100%;
        padding: 8px;
        font-size: 12px;
    }
    
    .legend-item span:first-child {
        width: 20px;
        height: 20px;
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .legend-item span:last-child {
        font-size: 16px !important;
        line-height: 1.3;
    }
    
    /* Регионы список для мобильных */
    .coffee-regions-list-container {
        margin-top: 15px;
        padding: 15px;
    }
    
    .coffee-regions-grid {
        display: block !important;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .region-category {
        margin-bottom: 15px;
    }
    
    .category-header {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .region-list {
        max-height: 200px;
    }
    
    .region-list-item {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .region-list-name {
        font-size: 12px;
    }
    
    .region-list-marker {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
    
    #region-search {
        padding: 10px 12px;
        font-size: 14px;
        margin-bottom: 15px;
    }
}

/* Экстра маленькие экраны */
@media (max-width: 360px) {
    .coffee-world-map-container {
        margin: 8px 3px 15px 3px;
        padding: 10px;
    }
    
    .coffee-world-map, #leaflet-map {
        height: 250px !important;
        min-height: 250px !important;
    }
    
    .coffee-marker-content {
        transform: scale(0.6);
    }
    
    .coffee-label {
        font-size: 8px;
        padding: 1px 3px;
        max-width: 70px;
        min-width: 35px;
    }
    
    .coffee-modal-body {
        padding: 15px 10px;
        font-size: 13px;
    }
    
    .coffee-modal-header h2 {
        font-size: 16px;
    }
    
    .coffee-info-card {
        padding: 10px;
    }
    
    .coffee-section {
        padding: 12px;
        margin-bottom: 15px;
    }
}

/* Улучшения для сенсорного взаимодействия */
@media (hover: none) and (pointer: coarse) {
    /* Стили для устройств с сенсорным экраном */
    .coffee-marker-content {
        transition: transform 0.2s ease;
    }
    
    .coffee-marker-content:active {
        transform: scale(1.1);
    }
    
    .leaflet-marker-icon {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
        tap-highlight-color: rgba(255, 215, 0, 0.3);
    }
    
    .coffee-close:active {
        transform: translateY(-50%) scale(0.9);
    }
    
    .coffee-modal {
        -webkit-overflow-scrolling: touch;
    }
    
    .coffee-modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Ландшафтная ориентация для мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .coffee-world-map, #leaflet-map {
        height: 300px !important;
        min-height: 300px !important;
    }
    
    .coffee-modal-content {
        max-height: 95vh;
    }
    
    .coffee-modal-body {
        max-height: calc(95vh - 100px);
    }
}

@media (max-width: 480px) and (orientation: landscape) {
    .coffee-world-map, #leaflet-map {
        height: 250px !important;
        min-height: 250px !important;
    }
}

/* Дополнительная защита: скрытие панели управления для не-администраторов */
body:not(.coffee-admin-user) .coffee-icon-control-panel,
body:not(.coffee-admin-user) .icon-control-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Панель управления иконками */
.coffee-icon-control-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(145deg, #F5F1E8, #E8DCC0);
    border: 2px solid #C8A882;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(101, 67, 33, 0.2);
    z-index: 10000;
    min-width: 250px;
    font-family: "Times New Roman", serif;
    transition: all 0.3s ease;
    transform: translateX(calc(100% + 20px));
}

.coffee-icon-control-panel.open {
    transform: translateX(0);
}

.icon-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #C8A882;
}

.icon-control-header h3 {
    margin: 0;
    color: #654321;
    font-size: 16px;
    font-weight: bold;
}

.icon-control-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #654321;
    cursor: pointer;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.icon-control-close:hover {
    background: rgba(101, 67, 33, 0.1);
    transform: rotate(90deg);
}

.icon-type-selector {
    margin-bottom: 15px;
}

.icon-type-selector label {
    display: block;
    color: #654321;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.icon-type-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #C8A882;
    border-radius: 8px;
    background: white;
    color: #654321;
    font-family: "Times New Roman", serif;
    font-size: 14px;
}

.icon-upload-section {
    margin-bottom: 15px;
}

.icon-upload-label {
    display: block;
    color: #654321;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.icon-upload-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #C8A882;
    border-radius: 8px;
    background: white;
    color: #654321;
    font-family: "Times New Roman", serif;
    font-size: 12px;
}

.icon-preset-section {
    margin-bottom: 15px;
}

.icon-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.icon-preset-item {
    width: 40px;
    height: 40px;
    border: 2px solid #C8A882;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: white;
    font-size: 20px;
}

.icon-preset-item:hover {
    border-color: #B8956F;
    transform: scale(1.05);
}

.icon-preset-item.selected {
    border-color: #8B4513;
    background: #FFF8DC;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.icon-control-buttons {
    display: flex;
    gap: 10px;
}

.icon-control-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #C8A882;
    border-radius: 8px;
    background: linear-gradient(135deg, #C8A882, #B8956F);
    color: white;
    font-family: "Times New Roman", serif;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.icon-control-btn:hover {
    background: linear-gradient(135deg, #B8956F, #A0522D);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(101, 67, 33, 0.3);
}

.icon-control-btn:active {
    transform: translateY(0);
}

.icon-control-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #C8A882, #B8956F);
    border: 2px solid #8B4513;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(101, 67, 33, 0.3);
    transition: all 0.3s ease;
    font-weight: bold;
}

.icon-control-toggle:hover {
    background: linear-gradient(135deg, #B8956F, #A0522D);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(101, 67, 33, 0.4);
}

.icon-control-toggle.panel-open {
    right: 290px;
}

/* Превью выбранной иконки */
.icon-preview {
    width: 50px;
    height: 50px;
    border: 2px solid #C8A882;
    border-radius: 8px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 24px;
}

.icon-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Мобильная адаптация для панели управления иконками */
@media (max-width: 768px) {
    .coffee-icon-control-panel {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        transform: translateY(100%);
        border-radius: 0;
        min-width: unset;
        width: 100%;
        height: 100%;
        padding: 20px;
        overflow-y: auto;
        z-index: 20000;
    }
    
    .coffee-icon-control-panel.open {
        transform: translateY(0);
    }
    
    .icon-control-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .icon-control-toggle.panel-open {
        right: 15px;
        top: 15px;
    }
    
    .icon-control-header h3 {
        font-size: 18px;
    }
    
    .icon-preset-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }
    
    .icon-preset-item {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .icon-control-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
    }
    
    .icon-control-btn {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .coffee-icon-control-panel {
        padding: 15px;
    }
    
    .icon-control-toggle {
        width: 40px;
        height: 40px;
        font-size: 16px;
        top: 12px;
        right: 12px;
    }
    
    .icon-preset-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .icon-preset-item {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}


/* Regions panel outside container */
.cwm-regions-panel {
    max-width: 1200px;
    margin: 0 auto 40px;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .cwm-regions-panel {
        margin: 0 0 30px;
        padding: 20px 16px;
    }
}


/* Hide non-working filter heading button on mobile */
@media (max-width: 768px) {
    .coffee-filter-heading {
        display: none !important;
    }
    .cwm-sb-open-btn {
        display: block !important;
    }
}
