/* ==========================================================================
   RED LATINOAMERICANA DE POLIGRAFISTAS - MAP & MARKER CSS
   ========================================================================== */

#map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: var(--z-map);
}

#map {
    width: 100%;
    height: 100%;
}

/* Efecto Plomo / Plateado estilo Uber 100% GRATIS y sin API Key (Filtro CSS sobre OpenStreetMap) */
.leaflet-tile-pane .leaflet-tile {
    filter: grayscale(100%) invert(2%) contrast(94%) brightness(103%) !important;
    -webkit-filter: grayscale(100%) invert(2%) contrast(94%) brightness(103%) !important;
}

/* Ocultar atribución por defecto en móviles pequeños o hacerla discreta */
.leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

/* Posición de los controles de zoom (abajo a la izquierda para no estorbar el buscador) */
.leaflet-bottom.leaflet-left {
    bottom: 24px;
    left: 16px;
}

.leaflet-bar {
    border-radius: var(--radius-sm) !important;
    overflow: hidden;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid var(--color-border) !important;
}

.leaflet-bar a {
    background-color: #ffffff !important;
    color: var(--color-secondary) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
}

/* Contenedor transparente de Leaflet divIcon (anula fondo blanco y borde gris por defecto) */
.leaflet-div-icon.custom-pin-container {
    background: transparent !important;
    border: none !important;
}

/* Marcadores Personalizados de Poligrafistas (Mismo tamaño de 30px que el círculo del cluster) */
.custom-pin {
    width: 30px !important;
    height: 30px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    overflow: hidden;
}

.custom-pin svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    fill: #ffffff !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
    pointer-events: none;
}

.custom-pin i {
    font-size: 15px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
    pointer-events: none;
}

.custom-pin.pin-individual {
    background: #2563eb !important;
    border: 2px solid #ffffff !important;
}

.custom-pin.pin-company {
    background: #0f172a !important;
    border: 2px solid #f59e0b !important;
}

.custom-pin:hover,
.custom-pin.active {
    transform: scale(1.18);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

/* Marker Cluster Custom Styling */
.marker-cluster-small {
    background-color: rgba(37, 99, 235, 0.3) !important;
}
.marker-cluster-small div {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-family: var(--font-family) !important;
}

.marker-cluster-medium {
    background-color: rgba(15, 23, 42, 0.3) !important;
}
.marker-cluster-medium div {
    background-color: #0f172a !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-family: var(--font-family) !important;
}

.marker-cluster-large {
    background-color: rgba(245, 158, 11, 0.3) !important;
}
.marker-cluster-large div {
    background-color: #d97706 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-family: var(--font-family) !important;
}

/* Asegurar que los popups siempre se muestren por encima de la barra de búsqueda */
.leaflet-pane.leaflet-popup-pane {
    z-index: 1010 !important;
}

/* Popup de Escritorio Elegante y Sutil */
.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 14px !important;
    overflow: hidden;
    box-shadow: 0 16px 32px -4px rgba(15, 23, 42, 0.14), 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(226, 232, 240, 0.85) !important;
    background: #ffffff !important;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.08) !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
}

.leaflet-popup-close-button {
    top: 10px !important;
    right: 10px !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    color: #94a3b8 !important;
    font: 16px/14px Tahoma, Verdana, sans-serif !important;
    transition: all 0.15s ease !important;
    padding: 0 !important;
}

.leaflet-popup-close-button:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.35 !important;
    width: 280px !important;
    font-family: 'Poppins', sans-serif !important;
}

.poly-card-popup {
    padding: 0.95rem 1rem 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-family: 'Poppins', sans-serif !important;
}

.poly-popup-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.poly-popup-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 20px; /* Espacio para el botón de cerrar */
}

.poly-popup-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.015em;
    margin: 0;
    line-height: 1.3;
    font-family: 'Poppins', sans-serif !important;
    word-break: break-word;
}

.poly-popup-loc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 1px;
}

.poly-popup-loc-text {
    font-size: 12.5px !important;
    font-weight: 400 !important;
    color: #64748b;
    line-height: 1.35;
    font-family: 'Poppins', sans-serif !important;
}

.badge-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.badge-verified-star {
    display: block;
    width: 19px;
    height: 19px;
}

.badge-cert {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.badge-cert-img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    border-radius: 50%;
    display: block;
}

.poly-popup-address {
    font-size: 0.76rem;
    color: #1e293b;
    font-weight: 500;
    background: #f1f5f9;
    padding: 7px 10px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
    margin-top: 4px;
    font-family: 'Poppins', sans-serif !important;
}

.poly-popup-address svg {
    flex-shrink: 0;
}

.poly-contact-header {
    font-size: 0.68rem;
    font-weight: 700;
    color: #8c9bb0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid #f1f5f9;
    font-family: 'Poppins', sans-serif !important;
}

.poly-contact-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.leaflet-container a.poly-contact-line,
.poly-contact-line {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 2px 0 !important;
    text-decoration: none !important;
    color: #1e293b !important;
    font-size: 0.82rem !important;
    font-weight: 550 !important;
    font-family: 'Poppins', sans-serif !important;
    line-height: 1.3 !important;
    transition: color 0.15s ease !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
}

.leaflet-container a.poly-contact-line:hover,
.poly-contact-line:hover {
    color: #1d68f6 !important;
}

.leaflet-container a.poly-contact-line:hover .contact-line-text,
.poly-contact-line:hover .contact-line-text {
    text-decoration: underline !important;
    color: #1d68f6 !important;
}

.contact-line-icon {
    width: 17px !important;
    height: 17px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    color: #1d68f6 !important;
}

.contact-line-icon svg {
    stroke: #1d68f6 !important;
}

.contact-line-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #1e293b !important;
    font-weight: 550 !important;
    font-family: 'Poppins', sans-serif !important;
}

/* Botón WhatsApp Exacto al Diseño */
.btn-card-whatsapp {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    height: 46px !important;
    background: #1d68f6 !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    margin-top: 9px !important;
    box-shadow: 0 4px 14px rgba(29, 104, 246, 0.32) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-sizing: border-box !important;
    border: none !important;
    cursor: pointer !important;
    user-select: none !important;
}

.btn-card-whatsapp:hover {
    background: #1557d6 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(29, 104, 246, 0.45) !important;
    color: #ffffff !important;
}

.btn-card-whatsapp:active {
    transform: scale(0.98) !important;
}

.btn-card-whatsapp .wa-circle-icon {
    width: 25px !important;
    height: 25px !important;
    background: #25d366 !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

.btn-card-whatsapp .wa-circle-icon svg {
    width: 13px !important;
    height: 13px !important;
    fill: #ffffff !important;
}

.btn-card-whatsapp span {
    color: #ffffff !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    letter-spacing: -0.01em !important;
}

