/* ============================================
   ESTILOS PARA EL MAPA INTERACTIVO
   Buscador avanzado unificado para escritorio y móvil
   ============================================ */

/* ============================================
   PANEL DE BÚSQUEDA AVANZADA
   ============================================ */
.advanced-search-panel {
    position: relative;
    z-index: 1000;
}

.advanced-search-toggle {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.advanced-search-toggle:hover {
    background: #005a87;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 90, 135, 0.3);
}

.advanced-search-toggle .dashicons {
    font-size: 22px;
    color: #005a87;
}

.advanced-search-toggle:hover .dashicons {
    color: white;
}

.advanced-search-content {
    display: none;
    width: 340px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideInRight 0.3s ease;
}

.advanced-search-panel.is-open .advanced-search-content {
    display: flex;
    flex-direction: column;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Header del panel */
.search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #005a87 0%, #007acc 100%);
    color: white;
}

.search-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.search-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.search-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.search-close-btn .dashicons {
    font-size: 20px;
}

/* Cuerpo del panel */
.search-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.search-section {
    margin-bottom: 20px;
}

.search-section:last-child {
    margin-bottom: 0;
}

.search-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.search-label .dashicons {
    font-size: 16px;
    color: #005a87;
}

/* Input de búsqueda */
.map-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.map-search-input:focus {
    border-color: #005a87;
    box-shadow: 0 0 0 3px rgba(0, 90, 135, 0.1);
}

.map-search-input::placeholder {
    color: #9ca3af;
}

/* Items de filtro */
.filter-item {
    margin-bottom: 12px;
}

.filter-item:last-child {
    margin-bottom: 0;
}

.filter-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.map-filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
}

.map-filter-select:focus {
    border-color: #005a87;
    box-shadow: 0 0 0 3px rgba(0, 90, 135, 0.1);
}

.map-filter-select:hover {
    border-color: #005a87;
}

/* Estilos para el Selector Buscable Híbrido en el Mapa */
.map-searchable-container {
    position: relative;
    width: 100%;
    z-index: 10;
    margin-bottom: 12px;
}

.map-searchable-container.is-open {
    z-index: 1005;
    /* Asegura que se superpone a los filtros y botones de abajo */
}

.map-searchable-input {
    width: 100% !important;
    padding: 10px 35px 10px 14px !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    background: white !important;
    cursor: text !important;
    transition: all 0.2s ease;
    box-sizing: border-box !important;
}

.map-searchable-container i.toggle-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    font-size: 12px;
    transition: transform 0.2s;
}

.map-searchable-container.is-open i.toggle-icon {
    transform: translateY(-50%) rotate(180deg);
}

.map-searchable-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    padding: 5px 0;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
}

/* Toggle switches para capas */
.layer-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.layer-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 10px;
    transition: background 0.2s;
}

.layer-toggle:hover {
    background: #f3f4f6;
}

.layer-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 12px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.layer-toggle input:checked+.toggle-slider {
    background: #005a87;
}

.layer-toggle input:checked+.toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.toggle-count {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Botones de acción */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn .dashicons {
    font-size: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, #005a87 0%, #007acc 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 90, 135, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

/* Sección de resultados de búsqueda */
.search-results-section {
    margin-bottom: 20px;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.search-results-list::-webkit-scrollbar {
    width: 6px;
}

.search-results-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.search-result-card {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.search-result-card:hover {
    background: #f8fafc;
    border-color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-result-card.is-main {
    border-color: #005a87;
    background: #f0f9ff;
    border-width: 2px;
}

.card-thumb {
    width: 95px;
    height: 95px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.card-thumb-placeholder {
    width: 95px;
    height: 95px;
    background: linear-gradient(135deg, #005a87 0%, #007acc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
    min-width: 0;
    padding-left: 12px;
}

.card-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.card-category {
    font-size: 11px;
    color: #005a87;
    background: #e0f2fe;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.card-address-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
}

.card-address-inline .dashicons {
    font-size: 12px;
    color: #94a3b8;
}

.card-link-wrapper {
    margin-top: 4px;
}

.card-simple-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #005a87;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap !important;
}

.card-simple-link:hover {
    color: #007acc;
    transform: translateX(2px);
}

.card-simple-link .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    line-height: normal;
    margin-top: 10px;
    /* Ajuste fino para la tipografía */
}

.search-result-card .stars,
.stars-small,
.map-popup-rating .stars {
    display: inline-block;
    color: #3483fa;
    font-size: 14px;
    letter-spacing: -1px;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
}

/* Footer con estadísticas */
.search-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stats-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-value {
    font-size: 18px;
    font-weight: 700;
    color: #005a87;
}

/* ============================================
   ESTILOS EXISTENTES (mejorados)
   ============================================ */

/* Controles de geolocalización */
.geo-control {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 10px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.geo-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2) !important;
}

.geo-icon {
    font-size: 20px;
    color: #005a87;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ============================================
   TUTORIAL INTERACTIVO (ONBOARDING)
   ============================================ */
.map-tour-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    pointer-events: auto;
}

.map-tour-step {
    position: absolute;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 280px;
    z-index: 10001;
    display: none;
    animation: fadeInTour 0.3s ease;
}

@keyframes fadeInTour {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tour-step-icon {
    width: 32px;
    height: 32px;
    background: #005a87;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-step-title {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
}

.tour-step-content {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 15px;
}

.tour-step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-progress {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

.tour-btn-next {
    background: #005a87;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.tour-btn-next:hover {
    background: #007acc;
}

.tour-highlight {
    position: absolute;
    border: 3px solid #005a87;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    pointer-events: none;
}

/* Botón de Ayuda en el mapa */
.help-control {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 10px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-top: 10px !important;
}

.help-control i {
    color: #005a87 !important;
    font-size: 20px !important;
    display: block;
    text-align: center;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.help-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2) !important;
}

/* Tooltip de Ruta */
.custom-route-tooltip {
    background: white !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
    color: #1e293b !important;
    font-family: inherit !important;
    overflow: hidden;
}

.custom-route-tooltip::before {
    display: none !important;
}

.route-info-tooltip {
    padding: 12px 15px;
    min-width: 160px;
    position: relative;
}

.btn-close-tooltip {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border: none;
    background: #f1f5f9;
    color: #94a3b8;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    z-index: 10;
}

.btn-close-tooltip:hover {
    background: #e2e8f0;
    color: #ef4444;
}

.route-tooltip-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
    font-size: 10px;
    color: #94a3b8;
    font-style: italic;
    text-align: center;
}

.route-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding-right: 15px;
    /* Espacio para la X */
}

.route-tooltip-header i {
    font-size: 16px;
}

.route-info-tooltip strong {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.route-tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.route-tooltip-body span {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-tooltip-body i {
    width: 14px;
    text-align: center;
    font-size: 12px;
}

/* Animación para líneas punteadas (marcha de hormigas) */
.leaflet-interactive[stroke-dasharray] {
    stroke-linecap: round;
    animation: dash-marching-ants 30s linear infinite;
}

@keyframes dash-marching-ants {
    to {
        stroke-dashoffset: -500;
    }
}

@keyframes pulse-btn {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(66, 133, 244, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
    }
}

/* Popup de Usuario Premium */
.user-map-popup {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    min-width: 220px;
}

.user-popup-icon-container {
    flex-shrink: 0;
}

.user-popup-icon-bg {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4285F4 0%, #34a853 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.3);
}

.user-popup-icon-bg .dashicons {
    color: white;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.user-popup-text {
    flex: 1;
}

.user-popup-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.user-popup-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

/* Mi Ubicación Mejorada con Pulso Estilo Google Maps */
.user-location-marker {
    background: transparent !important;
    border: none !important;
}

.user-location-pulse {
    width: 14px;
    height: 14px;
    background: #4285F4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(66, 133, 244, 0.5);
    position: relative;
}

.user-location-pulse::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 3px solid #4285F4;
    border-radius: 50%;
    animation: pulse-location 2s infinite;
    opacity: 0;
}

@keyframes pulse-location {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.card-distance {
    font-size: 11px;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Controles personalizados */
.leaflet-control-custom {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 10px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaflet-control-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-control-custom .dashicons {
    font-size: 20px;
    color: #005a87;
    display: block;
    text-align: center;
}

/* Popups del mapa */
.map-popup {
    line-height: 1.5;
    max-width: 300px;
    border-radius: 12px;
    overflow: hidden;
}

.map-popup-header {
    position: relative;
    width: 100%;
    height: 140px;
    background: #f1f5f9;
}

.map-popup-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-popup-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-popup-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none !important;
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    gap: 8px;
}

.map-popup-thumb-link:hover .thumb-overlay {
    opacity: 1;
}

.thumb-overlay span {
    font-size: 18px;
}

.map-popup-content {
    padding: 15px;
    background: white;
}

.map-popup-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.map-popup-title a {
    color: #1e293b;
    text-decoration: none;
}

.map-popup-title a:hover {
    color: #005a87;
}

.map-popup-category {
    font-size: 11px;
    color: #005a87;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    background: #f0f9ff;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
}

.map-popup-address {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-popup-actions-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn-popup-primary {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #005a87 0%, #007acc 100%);
    color: white !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 90, 135, 0.2);
}

.btn-popup-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 90, 135, 0.3);
}

.route-modes-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.route-mode-btn {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.route-mode-btn:hover {
    background: #f1f5f9;
    color: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
}

.route-mode-btn.active {
    background: #005a87;
    color: white;
    border-color: #005a87;
    box-shadow: 0 4px 12px rgba(0, 90, 135, 0.2);
    font-weight: bold;
}

.route-mode-btn.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
}

.btn-popup-main-actions {
    width: 100%;
}

.btn-popup-route-draw {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f0f9ff;
    color: #4285F4 !important;
    border: 2px solid #4285F4;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-popup-route-draw:hover {
    background: #4285F4;
    color: white !important;
}

.btn-popup-secondary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-popup-link-ext {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f8fafc;
    color: #64748b !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.btn-popup-link-ext:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b !important;
}

.btn-popup-link-ext span {
    font-size: 14px;
}

/* Estrellas de valoración */
.map-popup-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.map-popup-rating .stars {
    --star-size: 16px;
    font-size: var(--star-size);
    color: #3483fa;
    font-size: var(--star-size);
    color: #3483fa;
}

.map-popup-rating .rating-text {
    font-size: 12px;
    color: #666;
}

/* Iconos personalizados */
.custom-map-icon {
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-map-icon:hover {
    transform: scale(1.1);
}

.map-emoji-icon {
    background: none;
    border: none;
    box-shadow: none;
    transition: transform 0.2s ease;
}

/* Marcadores encontrados en búsqueda */
.found-marker {
    animation: foundPulse 2s infinite;
}

.found-marker .custom-map-icon {
    box-shadow: 0 0 0 0 rgba(0, 90, 135, 0.7),
        0 0 0 10px rgba(0, 90, 135, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.2);
}

.found-marker .map-emoji-icon {
    transform: scale(1.5);
    filter: drop-shadow(0 0 8px rgba(0, 90, 135, 0.8));
}

@keyframes foundPulse {
    0% {
        filter: drop-shadow(0 0 0 rgba(0, 90, 135, 0.7));
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(0, 90, 135, 0.5));
    }

    100% {
        filter: drop-shadow(0 0 0 rgba(0, 90, 135, 0.7));
    }
}

/* Marcadores ocultos */
.hidden-marker {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================
   MARCADORES ESTILO GOOGLE MAPS
   (Pin clásico con círculo blanco en el centro)
   ============================================ */

/* Contenedor principal del marcador */
.gmap-marker-container {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.gmap-marker-container:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

/* Pin estilo Google Maps */
.gmap-marker {
    position: relative;
    display: inline-block;
}

.gmap-marker .gmap-marker-pin {
    display: block;
    width: var(--marker-size, 32px);
    height: calc(var(--marker-size, 32px) + 8px);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Ícono de categoría dentro del círculo blanco */
.gmap-marker .gmap-marker-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    z-index: 10;
    pointer-events: none;
}

.gmap-marker .gmap-marker-icon .marker-category-icon {
    border-radius: 2px;
}

/* Marcador principal (más grande) */
.gmap-marker-container.main {
    z-index: 999 !important;
}

/* Animación para marcador encontrado (rojo con pulso) */
.found-marker .gmap-marker-container {
    animation: foundPulse 2s infinite;
}

@keyframes foundPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 0 rgba(234, 67, 53, 0));
    }

    50% {
        filter: drop-shadow(0 0 10px rgba(234, 67, 53, 0.5));
    }
}

/* Marcadores ocultos */
.hidden-marker {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ============================================
   RESPONSIVE PARA MÓVILES
   ============================================ */
@media (max-width: 768px) {

    /* Marcadores más grandes en móvil */
    .gmap-marker-container {
        transform: scale(1.5);
    }

    .gmap-marker-container.main {
        transform: scale(1.6);
    }

    .advanced-search-content {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 10000;
        animation: slideInFull 0.3s ease;
    }

    @keyframes slideInFull {
        from {
            opacity: 0;
            transform: translateX(100%);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .search-body {
        padding: 16px;
    }

    .search-header {
        padding: 16px;
    }

    .search-header h3 {
        font-size: 18px;
    }

    .quick-actions {
        gap: 12px;
    }

    .action-btn {
        padding: 14px 16px;
        font-size: 15px;
    }

    .map-search-input {
        padding: 14px 16px;
        font-size: 16px;
    }

    .map-filter-select {
        padding: 12px 14px;
        font-size: 15px;
    }

    .layer-toggle {
        padding: 12px 16px;
    }

    .search-footer {
        padding: 16px;
    }

    .stats-value {
        font-size: 22px;
    }

    /* Ajustar controles del mapa */
    .leaflet-control-custom,
    .geo-control {
        padding: 12px !important;
        border-radius: 14px !important;
    }

    .leaflet-control-custom .dashicons,
    .geo-icon {
        font-size: 22px;
    }

    /* Popup más pequeño en móvil */
    .map-popup-thumb {
        height: 140px;
    }

    .map-popup-content {
        padding: 10px;
    }

    .map-popup-title {
        font-size: 15px;
    }

    .map-popup-address {
        font-size: 12px;
    }

    .map-popup-directions {
        font-size: 11px;
        padding: 7px 10px;
    }
}

/* ============================================
   OVERLAY PARA EL MAPA
   ============================================ */
#comercio-map {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Overlay para ver mapa (todos los dispositivos) */
.map-mobile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 90, 135, 0.85) 0%, rgba(0, 122, 204, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.map-mobile-overlay span {
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.map-mobile-overlay span i {
    font-size: 24px;
}

.map-mobile-overlay:hover {
    background: linear-gradient(135deg, rgba(0, 90, 135, 0.95) 0%, rgba(0, 122, 204, 0.95) 100%);
}

#comercio-map:fullscreen {
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    border-radius: 0;
}

/* Asegurar que los popups se vean bien */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 300px !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    font-size: 22px;
    padding: 8px 12px 0 0;
    z-index: 10;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #eee;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.advanced-search-content {
    animation: fadeInUp 0.4s ease-out;
}

/* ============================================
   CONTROL DE CAPAS (Leaflet default)
   ============================================ */
.leaflet-control-layers {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 10px !important;
}

.leaflet-control-layers-toggle {
    background-size: 22px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
}

.leaflet-control-layers-expanded {
    padding: 10px !important;
    border-radius: 12px !important;
}

/* ============================================
   ESTADOS DE CARGA
   ============================================ */
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.map-loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top-color: #005a87;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ESTILOS PARA MARCADORES PERSONALIZADOS
   ============================================ */
.gmap-marker {
    position: relative;
    width: var(--marker-size);
    height: calc(var(--marker-size) * 1.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gmap-marker-pin {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.gmap-marker-icon {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35%;
    height: 35%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-category-icon {
    object-fit: contain;
}

.gmap-marker-container {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gmap-marker-container:hover {
    z-index: 1000 !important;
    transform: scale(1.2) translateY(-5px);
}

.gmap-marker-container.main {
    z-index: 1001 !important;
}

.user-location-pulse {
    width: 16px;
    height: 16px;
    background: #3483fa;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(52, 131, 250, 0.8);
    position: relative;
}

.user-location-pulse::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #3483fa;
    border-radius: 50%;
    animation: user-pulse 1.5s ease-out infinite;
    opacity: 0;
}

@keyframes user-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}