/* Coverage Map — Front-end Styles */

.ccm-coverage-wrap {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
}

/* Search Bar */
.ccm-search-bar {
    padding: 20px 24px 16px;
}

.ccm-search-input-wrap {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 4px 4px 4px 16px;
    gap: 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.ccm-search-input-wrap:focus-within {
    border-color: #FB5700;
    background: #fff;
}

.ccm-search-icon {
    flex-shrink: 0;
    color: #999;
}

#ccm-address-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    padding: 10px 0;
    outline: none;
    color: #333;
}

#ccm-address-input::placeholder {
    color: #aaa;
}

.ccm-search-submit {
    flex-shrink: 0;
    background: #FB5700;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ccm-search-submit:hover {
    background: #e04e00;
}

/* Search Result */
.ccm-search-result {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
    display: none;
}

.ccm-search-result.visible {
    display: block;
}

.ccm-search-result.ccm-found {
    color: #4CAF50;
    background: #e8f5e9;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.ccm-search-result.ccm-not-found {
    color: #e04e00;
    background: #fff3e0;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
}

.ccm-search-result.ccm-error {
    color: #999;
    background: #fafafa;
    padding: 12px 16px;
    border-radius: 8px;
}

/* Map Container */
.ccm-map {
    width: 100%;
    min-height: 400px;
}

/* Legend */
.ccm-legend {
    display: flex;
    gap: 24px;
    padding: 16px 24px;
    background: #fafafa;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.ccm-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.ccm-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .ccm-search-bar {
        padding: 16px;
    }

    .ccm-search-input-wrap {
        flex-wrap: wrap;
    }

    #ccm-address-input {
        min-width: 0;
        font-size: 14px;
    }

    .ccm-search-submit {
        width: 100%;
        padding: 12px;
    }

    .ccm-legend {
        gap: 12px;
        padding: 12px 16px;
    }

    .ccm-map {
        height: 60vh !important;
        min-height: 320px;
    }

    .ccm-modal__dialog {
        width: 98vw;
        height: 95vh;
        border-radius: 12px;
        padding: 16px;
    }

    .ccm-modal__header h2 {
        font-size: 18px;
    }
}

/* ============================
   Coverage Modal
   ============================ */
.ccm-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
}

.ccm-modal.active {
    display: block;
}

.ccm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: ccmFadeIn 0.25s ease;
}

.ccm-modal__dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 90vw;
    max-width: 1100px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ccmSlideIn 0.3s ease;
}

.ccm-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    transition: color 0.2s;
}

.ccm-modal__close:hover {
    color: #FB5700;
}

.ccm-modal__header {
    text-align: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.ccm-modal__header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.ccm-modal__header p {
    font-size: 14px;
    color: #888;
    margin: 4px 0 0;
}

.ccm-coverage-wrap--modal {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
    box-shadow: none;
}

.ccm-coverage-wrap--modal .ccm-map {
    flex: 1;
    height: auto !important;
    min-height: 200px;
}

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

@keyframes ccmSlideIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* ============================
   Footer Map Arrow Button
   ============================ */
.footer__map-trigger {
    position: relative;
    overflow: hidden;
    border-radius: inherit;
}

.footer__map-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    background: rgba(251, 87, 0, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.footer__map-expand:hover {
    background: #e04e00;
    transform: scale(1.1);
}

/* Hide Yandex branding in coverage maps */
#ccm-footer-map [class*="copyrights"],
#ccm-footer-map [class*="copyright"],
#ccm-footer-map [class*="ground-pane"] ~ [class*="controls"],
#ccm-map [class*="copyrights"],
#ccm-map [class*="copyright"],
#ccm-map [class*="ground-pane"] ~ [class*="controls"] {
    display: none !important;
}
