/* Estilos Premium para el Radar GSM */
.radar-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px); /* Ocupa el espacio restante bajo la cabecera */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#radar-map {
    flex: 1;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Filtros Flotantes de Categorías */
.radar-filters-bar {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 90%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

/* Buscador Dinámico Flotante */
.radar-search-container {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 22;
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
}

.radar-search-wrapper {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    padding: 4px 8px 4px 16px;
}

.radar-search-icon {
    font-size: 16px;
    color: var(--text-muted);
    margin-right: 8px;
}

.radar-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
}

.radar-search-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.radar-search-clear:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark);
}

.radar-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    z-index: 23;
}

.radar-search-result-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.radar-search-result-item:last-child {
    border-bottom: none;
}

.radar-search-result-item:hover {
    background: var(--primary-light);
}

.radar-search-result-icon {
    font-size: 20px;
    min-width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-search-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.radar-search-result-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.radar-search-result-desc {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.radar-filters-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.radar-filter-pill {
    white-space: nowrap;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.radar-filter-pill:hover,
.radar-filter-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Botón flotante GPS */
.gps-btn {
    position: absolute;
    bottom: 95px; /* Por encima de la barra inferior móvil */
    right: 20px;
    z-index: 20;
    width: 50px;
    height: 50px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.gps-btn:hover {
    transform: scale(1.08);
    background: var(--primary-light);
    color: var(--primary);
}

/* Popups Leaflet Estilizados */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md) !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg) !important;
    background: var(--card-bg) !important;
    max-width: 260px;
}

.leaflet-popup-content {
    margin: 0 !important;
    line-height: 1.4;
    font-family: 'Outfit', sans-serif;
}

.map-popup-card {
    display: flex;
    flex-direction: column;
}

.map-popup-header {
    position: relative;
    height: 80px;
    background: linear-gradient(135deg, var(--dark) 0%, #1E3A8A 100%);
    color: #fff;
    padding: 12px;
    display: flex;
    align-items: flex-end;
}

.map-popup-header.premium {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.map-popup-logo {
    position: absolute;
    bottom: -20px;
    right: 15px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #fff;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.map-popup-cat-badge {
    font-size: 10px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: auto;
}

.map-popup-body {
    padding: 15px;
    padding-top: 10px;
}

.map-popup-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-popup-title .verify-badge {
    color: var(--primary);
    font-size: 11px;
}

.map-popup-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-popup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.map-popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 8px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.map-popup-btn.primary {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.map-popup-btn.primary:hover {
    background: var(--primary);
    color: #fff;
}

.map-popup-btn.whatsapp {
    background: #25D366;
    color: #fff;
}

.map-popup-btn.whatsapp:hover {
    background: #20BA5A;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.2);
}

/* Pulso Premium para pines VIP */
.vip-marker-container {
    position: relative;
}

.vip-marker-pulse {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.4);
    animation: pulse-ring 1.8s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% { transform: scale(0.35); opacity: 1; }
    80%, 100% { transform: scale(1.5); opacity: 0; }
}

/* Ajuste en móviles */
@media (max-width: 768px) {
    .radar-container {
        height: calc(100vh - 55px);
    }
    .gps-btn {
        bottom: 85px;
        right: 15px;
    }
}

/* Estilos de los Cofres de Promociones (Estilo Poképarada) */
.chest-marker-container {
    position: relative;
}

.chest-marker-bounce {
    animation: chest-bounce 2s ease-in-out infinite;
}

@keyframes chest-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.chest-pulse-locked {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.4);
    animation: pulse-ring 2s infinite;
    z-index: -1;
}

.chest-pulse-unlocked {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.5);
    animation: pulse-ring 1.5s infinite;
    z-index: -1;
}

.coupon-blur-container {
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.coupon-blur-text {
    filter: blur(4px);
    font-family: monospace;
    font-weight: 800;
    font-size: 16px;
    user-select: none;
    color: #64748b;
}

.coupon-hint-text {
    font-size: 10px;
    color: #ef4444;
    font-weight: 700;
    margin-top: 6px;
    display: block;
}

.coupon-unlocked-container {
    background: #fffdf5;
    border: 1px dashed #f59e0b;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.copy-coupon-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.copy-coupon-btn:hover {
    background: #d97706;
    transform: scale(1.05);
}
