/* ===========================
   DG Mapa Cobertura - Public CSS
   =========================== */

.dgmc-coverage-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Auto-fit mode for Divi / custom containers */
.dgmc-coverage-wrapper.dgmc-auto-fit {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.dgmc-coverage-wrapper.dgmc-auto-fit .dgmc-map-container {
    flex: 1;
    min-height: 0;
}
.dgmc-coverage-wrapper.dgmc-auto-fit #dgmc-public-map {
    height: 100% !important;
    min-height: 300px;
}

/* ---- Legend ---- */
.dgmc-legend {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.dgmc-legend-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #333;
}

.dgmc-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dgmc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s, opacity 0.2s;
}

.dgmc-legend-item:hover {
    background: #f5f5f5;
}

.dgmc-legend-item.dgmc-legend-dimmed {
    opacity: 0.35;
}

.dgmc-legend-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.dgmc-legend-name {
    white-space: nowrap;
}

/* ---- Map container ---- */
.dgmc-map-container {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    position: relative;
}

#dgmc-public-map {
    width: 100%;
    z-index: 1;
}

/* Loading */
.dgmc-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 15px;
    color: #888;
    gap: 10px;
}

.dgmc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: dgmc-spin 0.8s linear infinite;
}

@keyframes dgmc-spin {
    to { transform: rotate(360deg); }
}

/* Popup styles */
.dgmc-popup {
    text-align: center;
    min-width: 120px;
}

.dgmc-popup-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.dgmc-popup-route {
    font-size: 12px;
    color: #777;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dgmc-popup-route-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Business marker popup */
.dgmc-business-popup {
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: #c0392b;
    min-width: 100px;
}

/* ---- Contact bar ---- */
.dgmc-contact-bar {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-top: 15px;
}

.dgmc-contact-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 14px;
}

.dgmc-contact-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.dgmc-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    line-height: 1.2;
}

.dgmc-contact-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Icon sizing */
.dgmc-contact-btn .dgmc-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* WhatsApp button */
.dgmc-btn-whatsapp {
    background: #25d366;
    color: #fff !important;
}
.dgmc-btn-whatsapp:hover {
    background: #20bd5a;
    color: #fff !important;
}

/* Phone button */
.dgmc-btn-phone {
    background: #2271b1;
    color: #fff !important;
}
.dgmc-btn-phone:hover {
    background: #1a5a8e;
    color: #fff !important;
}

/* Email button */
.dgmc-btn-email {
    background: #e74c3c;
    color: #fff !important;
}
.dgmc-btn-email:hover {
    background: #c0392b;
    color: #fff !important;
}

/* ---- Divi compatibility ---- */
.et_pb_section .dgmc-coverage-wrapper {
    max-width: 100%;
}
.et_pb_code_inner .dgmc-coverage-wrapper.dgmc-auto-fit {
    height: 100%;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .dgmc-legend {
        padding: 12px 15px;
    }
    .dgmc-legend-list {
        gap: 8px;
    }
    .dgmc-legend-item {
        font-size: 13px;
        padding: 3px 8px;
    }
    .dgmc-contact-bar {
        padding: 15px;
    }
    .dgmc-contact-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .dgmc-contact-btn {
        justify-content: center;
        padding: 10px 18px;
        font-size: 13px;
    }
}
